/* ==========================================================================
   «Канон v2» (19.11.2026; the chosen variant since 27.11.2026, rules scoped by html:root = the old html:root specificity).
   Same system — white, ink, Forum, square corners — with the price signals a first-time visitor in Samara needs:
   prices on the first screen, a per-100 g price list, the reason for the price, readable product names,
   sale and harvest marks, shops and reviews, a plain desktop header with every section in view.
   One new colour only: --deal, a deep caviar red, used for sale prices, sale marks and the best pack in the price list.
   ========================================================================== */

:root { --deal: #b3261e; }

/* ---------- header (desktop): wordmark left, every section in the bar, phone and bag right; no drawer ---------- */
@media (min-width: 1024px) {
	html:root .x-header .x-burger { display: none; }
	html:root .x-header .x-logo { position: relative; left: auto; top: auto; order: -3; flex: none; flex-direction: row; align-items: center; gap: 14px; transform: none; }
	html:root .x-header .x-logo__mark { width: 100px; height: 38px; transform: none; transform-origin: 0 50%; -webkit-mask-position: 0 50%; mask-position: 0 50%; }
	html:root .x-header .x-logo__name {
		margin: 0; padding-left: 14px; border-left: 1px solid var(--line-strong); text-align: left; white-space: nowrap;
		font-size: 10.5px; line-height: 1.5; letter-spacing: .2em;
	}
	html:root .x-header .x-logo__name br { display: inline; }
	html:root .x-header.is-compact .x-logo { transform: none; }
	html:root .x-header.is-compact .x-logo__mark { transform: scale(.86); }
	html:root .x-header.is-compact .x-logo__name { opacity: 1; visibility: visible; transform: none; }
	html:root .x-header .x-nav { order: 0; flex: 1; justify-content: center; gap: clamp(18px, 2.3vw, 40px); padding-left: 0; }
	html:root .x-header .x-nav::before { content: none; }
	html:root .x-header .x-nav__link { display: inline-block; font-size: 12px; }
	html:root .x-header .x-nav__link[href="/"] { display: none; }
	html:root .x-header .x-phone { margin-left: 0; }
}
/* narrow desktops: the mark alone, a tighter bar */
@media (min-width: 1024px) and (max-width: 1279px) {
	html:root .x-header .x-logo__name { display: none; }
	html:root .x-header .x-nav { gap: 18px; }
	html:root .x-header .x-nav__link { font-size: 11.5px; letter-spacing: .1em; }
}

/* ---------- hero: the price, said once and plainly, under the reason for it ---------- */
.c-hero__prices { display: flex; flex-wrap: wrap; margin-top: clamp(22px, 3.4svh, 40px); }
.c-hero__prices a { display: grid; gap: 4px; padding-right: clamp(22px, 2.4vw, 40px); color: #fff; text-decoration: none; }
.c-hero__prices a + a { padding-left: clamp(22px, 2.4vw, 40px); border-left: 1px solid rgba(237, 237, 234, .22); }
.c-hero__prices span { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(237, 237, 234, .62); }
.c-hero__prices b { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.7rem, min(2.3vw, 3.6svh), 2.6rem); line-height: 1.05; font-variant-numeric: lining-nums; }
.c-hero__prices small { font-size: 13px; color: rgba(237, 237, 234, .7); }
/* hover: the theme's link line (x-base «.x-uline»): a 1 px rule drawn left to right under the price, same duration and curve */
.c-hero__prices b {
	justify-self: start; padding-bottom: 3px;
	background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
	transition: background-size var(--dur) var(--ease);
}
.c-hero__prices a:hover b, .c-hero__prices a:focus-visible b { background-size: 100% 1px; }
.c-hero__prices a:focus-visible { outline: none; }
html:root .c-hero__prices + .c-hero__actions { margin-top: clamp(24px, 3.6svh, 44px); }
@media (max-width: 767px) {
	.c-hero__prices { margin-top: clamp(16px, 2.6svh, 24px); }
	.c-hero__prices b { font-size: 1.6rem; }
	.c-hero__prices span { font-size: 10.5px; }
	html:root .c-hero__lead { font-size: 1rem; line-height: 1.5; }
	html:root .c-hero__actions { padding-top: clamp(20px, 3.4svh, 36px); }
}
@media (max-width: 640px) and (max-height: 720px) {
	html:root .c-hero__title { font-size: 2rem; }
	html:root .c-hero__lead { font-size: .95rem; }
	.c-hero__prices b { font-size: 1.4rem; }
}

/* ---------- product cards ---------- */
/* the price keeps the v1 size; «руб.» takes the price's own weight so the line reads as one */
html:root .x-card__price i::after { font-weight: inherit; }
html:root .x-card.akciya .x-card__price { color: var(--deal); }
html:root .x-card__price span strike { color: var(--ink-3); font-weight: 400; }
/* every button in a row sits at the bottom, level with its neighbours */
html:root .x-grid > .x-card > .x-card__buy { align-self: stretch; align-content: space-between; }
/* tighter air between title, price and button */
html:root .x-card__buy { padding-top: var(--space-2); row-gap: var(--space-2); }
.x-card__media { position: relative; }
.x-badge {
	position: absolute; top: 10px; left: 10px; z-index: 1; padding: 5px 8px 4px;
	background: #fff; color: var(--ink); font-family: var(--font-ui); font-size: 10.5px; font-weight: 500; line-height: 1.2;
	letter-spacing: .12em; text-transform: uppercase; pointer-events: none;
}
.x-badge--sale { left: auto; right: 10px; background: var(--deal); color: #fff; letter-spacing: .04em; font-size: 12px; font-weight: 600; }
/* like on the live site: the «−N%» mark shows only when the «Акция» box is ticked */
.x-card:not(.akciya) .x-badge--sale { display: none; }
@media (max-width: 640px) { .x-badge { top: 6px; left: 6px; font-size: 9.5px; padding: 4px 6px 3px; } .x-badge--sale { left: auto; right: 6px; font-size: 11px; } }
/* caviar: the price per 100 g, bottom-left on the photo; reads as a price tag, so no caps and no tracking */
.x-badge--unit {
	top: auto; bottom: 10px; left: 10px; white-space: nowrap; text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500;
	font-variant-numeric: tabular-nums lining-nums; color: var(--ink);
}
@media (max-width: 640px) { .x-badge--unit { top: auto; bottom: 6px; left: 6px; font-size: 11px; } }
/* the gaps inside «5 500 руб. / 100 г» (a space in Onest is .27em): thousands .17em, before «руб.» and «г» .2em, round the slash .12em */
.x-badge--unit i { display: inline-block; font-style: normal; }
.x-badge--unit i.th { width: .17em; }
.x-badge--unit i.cur { width: .2em; }
.x-badge--unit i.sl { width: .12em; }

/* ---------- v2 home: shops ---------- */
.kv-pl__sub { margin-top: calc(var(--space-3) * -1); margin-bottom: var(--space-5); max-width: 62ch; color: var(--ink-2); font-size: 15px; }
.kv-shops__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); }
.kv-shops__list li { display: flex; flex-direction: column; gap: 6px; padding: var(--space-5) clamp(20px, 2.2vw, 32px); font-size: 15px; color: var(--ink-2); }
.kv-shops__list li + li { border-left: 1px solid var(--line); }
.kv-shops__list a { color: var(--ink); text-decoration: none; align-self: flex-start; }
.kv-shops__addr { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.15; margin-bottom: 4px; }
.kv-shops__rev { margin-top: auto; padding-top: var(--space-3); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
@media (max-width: 1023px) {
	.kv-shops__list { grid-template-columns: minmax(0, 1fr); }
	.kv-shops__list li + li { border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- v2 home: «Скидки» + «Чаще всего берут», one row each ---------- */
.x-contents { display: contents; }
/* no product on sale → no shelf */
.c-sale:not(:has(.x-card)) { display: none; }
/* every width: a shelf is one row that scrolls sideways, four cards in view on a desktop, the same columns as the grid */
html:root .x-grid--row {
	--cols: 4; grid-template-columns: none; grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--cols) - 1) * var(--grid-gap-x, var(--space-5))) / var(--cols));
	overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
}
html:root .x-grid--row::-webkit-scrollbar { display: none; }
html:root .x-grid--row > .x-card { scroll-snap-align: start; }
@media (max-width: 1023px) and (min-width: 641px) { html:root .x-grid--row { --cols: 3; } }
/* «Чаще всего берут» right under «Скидки» reads as one showcase: less air between them */
html:root .c-sale + .c-hits { padding-top: var(--space-7); }

/* the arrows: two quiet squares in the shelf head, Apple-store style paddles; shown by the script only when the row
   overflows, greyed out at either end; the same hairline and timing as the rest of the theme */
.x-section__tools { display: inline-flex; align-items: center; gap: var(--space-5); }
.x-shelf-nav { display: inline-flex; gap: 6px; align-self: center; }
.x-shelf-nav[hidden] { display: none; }
.x-shelf-nav__btn {
	position: relative; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line-strong); border-radius: 0;
	background: none; color: var(--ink); cursor: pointer;
	transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.x-shelf-nav__btn::before {
	content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px;
	border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: translate(-65%, -50%) rotate(45deg);
}
.x-shelf-nav__btn--prev::before { transform: translate(-35%, -50%) rotate(-135deg); }
.x-shelf-nav__btn:hover:not(:disabled), .x-shelf-nav__btn:focus-visible { background: var(--ink); border-color: var(--ink); color: #fff; outline: none; }
.x-shelf-nav__btn:disabled { opacity: .3; cursor: default; }
@media (min-width: 641px) { .c-sale .x-section__head { align-items: center; } }
@media (max-width: 640px) {
	/* phone: a swipe row, ~2.2 cards in view so the cut card says «there is more»; it runs to the screen edges; no arrows */
	html:root .x-grid--row {
		grid-auto-columns: 44%; column-gap: var(--space-3);
		margin-inline: calc(-1 * var(--gutter, 16px)); padding-inline: var(--gutter, 16px); scroll-padding-inline: var(--gutter, 16px);
	}
	.x-shelf-nav { display: none !important; }
}

/* ---------- catalog rail: «Подборки» above «Разделы» (22.11.2026) ----------
   Desktop: a short group with its own small caps title, a hairline, then the sections as before.
   Phone: the same two groups inside the opened «Все разделы» panel; the box border moves from the list to the panel. */
.x-cats__deal { margin-left: .5em; color: var(--deal); font-size: .86em; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.x-sets { padding-bottom: var(--space-4); margin-bottom: var(--space-5); border-bottom: 1px solid var(--line); }
.x-sale-empty { display: none; padding: var(--space-6) 0; color: var(--ink-2); font-size: 16px; }
.x-catalog__list:not(:has(.x-card)) .x-sale-empty { display: block; }
@media (max-width: 1023px) {
	.x-catalog__panelbox { border: 1px solid var(--ink); border-top: 0; padding: 4px 16px 10px; }
	.x-catalog__panelbox .x-cats { border: 0; padding: 0; }
	.x-catalog__panelbox .x-catalog__railtitle { display: block; margin: 14px 0 2px; font-size: 11px; letter-spacing: .16em; color: var(--ink-3); }
	.x-sets { padding-bottom: 4px; margin-bottom: 0; }
	.x-sets .x-cats .x-cats__item:nth-child(n) { border-bottom: 0; } /* beats the phone rule for the last row of the sections grid */
	/* no hairline under the very last section: the panel box closes the list */
	.x-catalog__panelbox .x-cats .x-cats__item:last-child { border-bottom: 0; }
	.x-cats__link .x-cats__deal { position: static; }
}

/* ---------- hero (27.11.2026): no prices — an eyebrow, the lead about our own production and its proof ---------- */
.c-hero__eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(16px, 2.6svh, 28px); font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; color: rgba(237, 237, 234, .7); }
.c-hero__eyebrow::before { content: ""; width: 36px; height: 1px; background: currentColor; flex: none; }
.c-hero__proof { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; margin: clamp(22px, 3.4svh, 40px) 0 0; padding: 0; list-style: none; }
.c-hero__proof li { display: grid; gap: 6px; align-content: start; padding-right: clamp(20px, 2.2vw, 36px); }
.c-hero__proof li + li { padding-left: clamp(20px, 2.2vw, 36px); border-left: 1px solid rgba(237, 237, 234, .22); }
.c-hero__proof b { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, min(2vw, 3.2svh), 2.3rem); line-height: 1; color: #fff; }
.c-hero__proof span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(237, 237, 234, .6); }
@media (max-width: 1023px) {
	.c-hero__proof { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; }
	.c-hero__proof li { padding-right: 14px; align-content: start; }
	.c-hero__proof li + li { padding-left: 14px; }
	.c-hero__proof b { font-size: 1.3rem; }
	.c-hero__proof span { font-size: 9.5px; letter-spacing: .06em; line-height: 1.35; }
}

/* ---------- 27.11.2026: «Скидки» head stays one row on every width (title left, «Все скидки» right);
   «Добавьте к заказу» becomes the same swipe row as the shelves on a phone ---------- */
@media (max-width: 1023px) {
	html:root .c-sale .x-section__head { flex-direction: row; align-items: baseline; justify-content: space-between; }
}
@media (max-width: 640px) {
	html:root .c-addons .x-grid--compact {
		grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 44%; column-gap: var(--space-3);
		overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
		margin-inline: calc(-1 * var(--gutter, 16px)); padding-inline: var(--gutter, 16px); scroll-padding-inline: var(--gutter, 16px);
	}
	html:root .c-addons .x-grid--compact::-webkit-scrollbar { display: none; }
	html:root .c-addons .x-grid--compact > .x-card { scroll-snap-align: start; }
}

/* 27.11.2026: phone/tablet header has no bag — the cart lives in the bottom cart bar and in the drawer («Корзина») */
@media (max-width: 1023px) { html:root .x-header .x-cart { display: none; } }
