/* =========================================
   MANROPE — self-hosted (fonts/*.woff2), replaces Montserrat sitewide
   (--font-main) per the user's reference (donpuer.com uses Gilroy, a
   paid font we can't redistribute — Manrope is the free/SIL-OFL
   Cyrillic-supporting stand-in). One @font-face pair (cyrillic+latin)
   per weight actually used across the site's CSS. Font-weight 900 has
   no distinct Manrope cut (its heaviest is 800), so 900 is mapped to
   the same 800 files below rather than falling back to a mismatched
   system font.
   ========================================= */
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/ManropeExtraLight-cyrillic.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
    font-display: optional;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/ManropeExtraLight-latin.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
    font-display: optional;
}
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/ManropeLight-cyrillic.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: optional;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/ManropeLight-latin.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: optional;
}
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/ManropeRegular-cyrillic.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: optional;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/ManropeRegular-latin.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: optional;
}
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/ManropeMedium-cyrillic.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: optional;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/ManropeMedium-latin.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: optional;
}
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/ManropeSemiBold-cyrillic.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: optional;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/ManropeSemiBold-latin.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: optional;
}
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/ManropeBold-cyrillic.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: optional;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/ManropeBold-latin.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: optional;
}
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/ManropeExtraBold-cyrillic.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: optional;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/ManropeExtraBold-latin.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: optional;
}
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/ManropeExtraBold-cyrillic.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: optional;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Manrope';
    src: url('../fonts/ManropeExtraBold-latin.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: optional;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =========================================
   CORE VARIABLES & RESET
   ========================================= */
:root {
    /* ByMax white & blue theme (docs/BYMAX-BRIEF.md → Visual direction) */
    --bg-body: #FFFFFF;          /* page background */
    --bg-soft: #F4F7FB;          /* section bands, sidebar boxes, inputs, image boxes */
    --bg-card: #FFFFFF;          /* cards (with a 1px --border-light border) */
    --bg-header: #FFFFFF;

    --accent: #05539C;           /* primary blue: buttons, links, active states, focus */
    --accent-hover: #04427D;
    --accent-soft: #E6EEF6;      /* tints, selected chips, badge backgrounds */
    --accent-rgb: 5, 83, 156;   /* for rgba(var(--accent-rgb), a) glows/tints */
    /* legacy names (the tea-shop code base uses them everywhere) */
    --accent-gold: var(--accent);
    --accent-gold-hover: var(--accent-hover);
    --accent-green: #1E9E5A;

    --navy: #1B3152;             /* footer, darkest headings, «Топ продажу» badge */
    --navy-rgb: 27, 49, 82;      /* overlays/backdrops: rgba(var(--navy-rgb), .45) */
    --text-main: #0F1E33;
    --text-secondary: #5A6B82;
    --text-muted: #8A99AD;
    --border-light: #E3E9F2;
    --border-strong: #CBD5E3;    /* input borders, dividers that must read on --bg-soft */

    --success: #1E9E5A;
    --danger: #E5484D;
    --warning: #F5A524;

    --shadow-soft: 0 4px 20px rgba(15, 30, 51, 0.06);
    --shadow-hover: 0 10px 30px rgba(15, 30, 51, 0.10);
    --focus-ring: 0 0 0 3px rgba(5, 83, 156, 0.25);
    --overlay-bg: rgba(27, 49, 82, 0.45);

    --font-main: 'Manrope', system-ui, -apple-system, sans-serif;
    --container-width: 1600px;
    --header-height: 80px;

    /* Block headings (.section-title, .section-heading, .block-title,
       Традиції, Новинки/Знижки, product-page rails) all share this one
       scale so every block name looks the same; stepped down below. */
    --block-title-size: 24px;
    --block-title-ls: 1.5px;

    /* Every backdrop blur on the site goes through these two, so its
       strength is tuned in one place — and switched off in one place
       (below) where it costs more than it's worth. */
    --blur-overlay: blur(5px);
    --blur-control: blur(4px);
}

/* backdrop-filter re-blurs everything behind an element on every frame
   it animates, which stutters on low-memory Android phones (html.no-blur,
   set in js/core-bridge.js when navigator.deviceMemory <= 2 — Chromium
   only, so iPhones keep the blur exactly as designed) and is unwanted
   for anyone who asked their OS for less transparency. The dark
   backgrounds already on every overlay carry the effect on their own. */
html.no-blur {
    --blur-overlay: none;
    --blur-control: none;
}
@media (prefers-reduced-transparency: reduce) {
    :root { --blur-overlay: none; --blur-control: none; }
}

/* Respect the OS-level "reduce motion" setting site-wide: transitions and
   animations collapse to (almost) instant, and smooth scrolling becomes a
   jump. Durations are near-zero rather than 0 so transitionend/
   animationend listeners still fire. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }

html {
    overflow-x: hidden;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-main);
    font-weight: 400;
    line-height: 1.6;
}

/* Апдейт 101: header switches from `position: sticky` to `position:
   fixed` while this class is set (see css/header.css's `body.no-scroll
   header` rule and its Апдейт 95 comment) — sticky occupies its own
   height in the normal document flow like a static element, but fixed
   is removed from flow entirely. The instant that switch happens, the
   header's space collapses: everything below it (the ticker bar right
   after </header> on every page, then the rest of the page) shifts up
   by exactly the header's height to fill the vacated gap, and the
   fixed header — still rendered on top at z-index: 1000 — then visually
   covers whatever slid up underneath it. Reported: the ticker
   "disappears" and the page "jumps up" the instant the cart opens.
   Fix: give that collapsed space back explicitly, the same way
   --scrollbar-gap compensates the header for the vanished scrollbar —
   padding the body down by the header's own height (a fixed CSS
   custom property, not a measured one, so plain CSS is enough here,
   no JS needed) keeps the ticker and everything after it exactly where
   they were. var(--header-height) already updates responsively via the
   :root overrides in css/responsive.css, so this tracks the header's
   real height at every breakpoint. */
/* (the header stack is pinned in place by freezeStickyStack() in js/utils/scroll-lock.js, which keeps its
   slot with spacers; the old body padding-top made for a fixed header now pushed the top strip down) */
body.no-scroll { overflow: hidden; }

/* Sticky elements (header, catalog sidebar, product photo column) are no
   longer patched here — js/utils/scroll-lock.js now freezes each of them
   individually (measuring its exact on-screen box and pinning it there
   with an inline style, plus a same-size spacer so nothing reflows into
   the gap) whenever scroll is locked, which handles every one of them
   correctly regardless of which layout mode its container uses (block
   flow, flex, or grid) — a single CSS rule here couldn't. See that
   file's top comment for the full explanation. */

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
button {
    border: none; background: none; font-family: inherit; cursor: pointer; outline: none;
    -webkit-appearance: none; appearance: none;
}

/* Апдейт 106: Апдейт 104/105 only stopped accidental text-selection
   inside the cart panel — reported as happening the same way anywhere
   on the site: a fast double/triple click on ANY control (a nav link,
   an icon button, a filter chip, a custom onclick div) is a
   text-selection gesture to the browser by default, and ends up
   selecting that control's own label or whatever text sits nearby.
   Every button, link and custom-click control site-wide is UI to
   press, not text to read — so this disables selection on all three
   as a blanket rule (button and [onclick] are never anything else;
   `a` here is used exclusively for navigation/structural links, see
   below for the one exception). Real reading content stays selectable:
   #articleBody (the full blog post body, js/pages/blog.js) and
   .legal-section (privacy.html's policy text, which happens to have
   the site's one inline content link — a mailto: — right in the
   middle of a paragraph) are explicitly re-enabled below, together
   with everything inside them, so nothing there loses the ability to
   be selected/copied. */
button, a, [onclick] { user-select: none; -webkit-user-select: none; }
#articleBody, #articleBody *, .legal-section, .legal-section * { user-select: text; -webkit-user-select: text; }

/* Safari/WebKit renders native chrome (rounded, gray/white capsule) on
   text/number inputs unless appearance is explicitly reset — Chrome and
   Opera (both Chromium) don't need this, which is why the bug only shows
   in Safari. */
input[type="text"], input[type="number"], input[type="email"], input[type="tel"] {
    -webkit-appearance: none; appearance: none;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::selection { background: var(--accent-soft); color: var(--navy); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
    ::-webkit-scrollbar-thumb:hover { background: var(--accent-gold); }
}

/* =========================================
   LAYOUT UTILITIES
   ========================================= */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 40px;
}

/* Longhand on purpose: a shorthand `padding: 100px 0` here would silently
   zero out left/right padding on any element, including ones that also
   carry `.container` (which relies on its own 40px left/right padding).
   That exact bug caused .catalog-layout to render 40px wider than the
   header on each side. Longhand only ever touches top/bottom. */
.section-padding { padding-top: 100px; padding-bottom: 100px; }

.section-header { text-align: center; margin-bottom: 60px; }

@media (max-width: 1024px) { :root { --block-title-size: 20px; } }
@media (max-width: 600px) { :root { --block-title-size: 17px; --block-title-ls: 1px; } }
@media (max-width: 400px) { :root { --block-title-size: 15px; --block-title-ls: 0.5px; } }

.section-title {
    font-size: var(--block-title-size);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--block-title-ls);
    margin-bottom: 15px;
    color: var(--navy);
}

.section-subtitle {
    color: var(--accent-gold);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 500;
}

/* TEXT SWITCHER */
.text-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
}
.switcher-item {
    /* Same size/tracking as .section-title — it sits in the same role
       (block heading), see the matching overrides in responsive.css. */
    font-size: var(--block-title-size);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--block-title-ls);
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.3s ease;
    position: relative;
}
.switcher-item.active { color: var(--navy); }
@media (hover: hover) and (pointer: fine) {
    .switcher-item:hover:not(.active) { color: var(--text-secondary); }
}
.switcher-separator { width: 1px; height: 24px; background: var(--border-strong); }

/* Line breaks (impeccable/typeset): paragraphs avoid a lone last word,
   headings break into even lines instead of one long + one short. Browsers
   without support simply wrap as before. */
p, li, dd, blockquote { text-wrap: pretty; }
h1, h2, h3, h4, .section-title, .page-title { text-wrap: balance; }

/* Text rises in line by line as it scrolls into view (js/utils/text-reveal.js).
   The class is only ever added by JS, and never with reduced motion. */
.rv { opacity: 0; transform: translateY(10px); }
.rv.rv-in {
    opacity: 1; transform: none;
    transition: opacity 0.35s ease-out var(--rv-delay, 0ms), transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) var(--rv-delay, 0ms);
}
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; } }

/* while the page loads (<html class="alf-preload">, removed by the inline
   script in each page's <head>): no transitions, so nothing plays from the
   browser's defaults if a browser styled the page before the CSS came */
.alf-preload *, .alf-preload *::before, .alf-preload *::after { transition: none !important; }

/* Cart icon: an outline trolley (same line weight as the heart and the user icons) instead of Font
   Awesome's solid basket. Every <i class="fas fa-basket-shopping"> on the site (header, "До кошика"
   buttons, the product page) picks it up here; it follows the text colour. */
i.fa-basket-shopping {
    display: inline-block; width: 1.12em; height: 1.12em; vertical-align: -0.2em; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='1.9'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='6'%20cy='19'%20r='2'/%3E%3Ccircle%20cx='17'%20cy='19'%20r='2'/%3E%3Cpath%20d='M17%2017h-11v-14h-2'/%3E%3Cpath%20d='M6%205l14%201l-1%207h-13'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='1.9'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='6'%20cy='19'%20r='2'/%3E%3Ccircle%20cx='17'%20cy='19'%20r='2'/%3E%3Cpath%20d='M17%2017h-11v-14h-2'/%3E%3Cpath%20d='M6%205l14%201l-1%207h-13'/%3E%3C/svg%3E") center / contain no-repeat;
}
i.fa-basket-shopping::before { content: none; }
