/* =========================================
   SEARCH BOX (global component)
   ========================================= */
/* Апдейт 119: background darkness/blur intensity matched to
   .cart-overlay too (0.7 / blur(5px), was 0.85 / blur(8px)) — Апдейт 113
   only matched the fade TIMING across every overlay, not how dark/blurred
   the backdrop itself looks, so search and login still visibly stood out
   as a heavier "muting" than the cart's. Same fix applied to
   .sidebar-overlay (css/catalog.css), both .mobile-sort-overlay copies
   (css/catalog.css, css/reviews.css) and .pr-review-sheet-overlay
   (css/product.css) — every overlay on the site now backs its content
   with the exact same rgba(0,0,0,0.7) + blur(5px) the cart uses.
   .gallery-overlay (css/product.css) is deliberately left alone — it's a
   near-opaque full-screen photo viewer, not a "content behind a blurred
   veil" modal, so it was never meant to match this pattern. */
/* Апдейт 113: timing/opacity-only pattern matched to .cart-overlay/
   .cart-container (Апдейт 102-106) per the user's request that every
   modal on the site feel as smooth as the cart — 0.3s -> 0.5s ease, and
   the box itself now has its own explicit opacity transition (was
   previously just riding along with the backdrop's opacity visually,
   which happened to look the same at a glance but wasn't the same
   pattern the cart actually uses). No transform/scale — Апдейт 105
   found scale() itself causes a real, measurable sub-pixel edge drift
   on the text inside, not just a rendering artifact. */
/* Every closed overlay here (and in catalog / product / reviews .css) is
   visibility: hidden as well as opacity: 0: Safari / iOS browsers at times
   painted the transparent layers (the login form, the mobile menu, their blur)
   for a moment while a page loads or reloads. visibility follows the 0.5 s
   fade, so opening and closing look the same as before. */
.search-overlay {
    position: fixed; inset: 0; background: rgba(27, 49, 82, 0.45); -webkit-backdrop-filter: var(--blur-overlay); backdrop-filter: var(--blur-overlay); z-index: 5000;
    display: flex; align-items: flex-start; justify-content: center;
    opacity: 0; visibility: hidden; pointer-events: none; transition: 0.5s ease; padding-top: 120px;
}
.search-overlay.active { opacity: 1; visibility: visible; pointer-events: all; }
.search-box {
    width: 90%; max-width: 880px; background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: 12px; padding: 24px 30px; box-shadow: 0 20px 50px rgba(15, 30, 51, 0.1);
    position: relative; display: flex; flex-direction: column;
    opacity: 0; transition: opacity 0.5s ease;
}
.search-overlay.active .search-box { opacity: 1; }
.search-close-btn { position: absolute; top: 22px; right: 26px; font-size: 20px; color: var(--text-secondary); cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
    .search-close-btn:hover { color: var(--text-main); }
}
.search-input-field {
    width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--border-strong);
    font-size: 20px; color: var(--text-main); padding: 15px 44px 15px 0; outline: none; transition: 0.3s;
}
.search-input-field:focus { border-color: var(--accent-gold); }
.search-results-list {
    display: flex; flex-direction: column; gap: 10px; margin-top: 20px; width: 100%;
    max-height: 50vh; overflow-y: auto;
}
.s-item {
    display: flex; align-items: center; gap: 15px; padding: 10px; border-radius: 4px;
    border: 1px solid transparent; background: var(--bg-card); cursor: pointer; transition: 0.2s;
}
@media (hover: hover) and (pointer: fine) {
    .s-item:hover { border-color: var(--border-light); background: var(--bg-soft); }
}
.s-img { width: 50px; height: 50px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.s-info { flex: 1; }
.s-name { font-size: 14px; font-weight: 500; color: var(--text-main); }
.s-price { font-size: 13px; color: var(--accent-gold); font-weight: 500; margin-top: 2px; }

/* =========================================
   AUTH MODAL (global component)
   ========================================= */
/* Апдейт 113: same cart-matched timing/opacity pattern as .search-overlay
   above — see that comment. */
.login-overlay {
    position: fixed; inset: 0; background: rgba(27, 49, 82, 0.45); -webkit-backdrop-filter: var(--blur-overlay); backdrop-filter: var(--blur-overlay);
    z-index: 6000; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; pointer-events: none; transition: 0.5s ease;
}
.login-overlay.active { opacity: 1; visibility: visible; pointer-events: all; }
.login-box {
    background: var(--bg-card); border: 1px solid var(--border-light); padding: 30px; border-radius: 4px;
    width: 100%; max-width: 400px; position: relative; box-shadow: 0 30px 60px rgba(15, 30, 51, 0.16);
    opacity: 0; transition: opacity 0.5s ease;
}
.login-overlay.active .login-box { opacity: 1; }

.auth-tabs { display: flex; align-items: center; border-bottom: 1px solid var(--border-strong); margin-bottom: 25px; gap: 20px; }
.auth-tab { font-size: 15px; font-weight: 500; color: var(--text-secondary); padding: 10px 0; cursor: pointer; position: relative; transition: 0.3s; }
@media (hover: hover) and (pointer: fine) {
    .auth-tab:hover { color: var(--text-main); }
}
.auth-tab.active { color: var(--accent-gold); }
.auth-tab.active::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 100%; height: 2px; background: var(--accent-gold); }

.auth-input { width: 100%; background: transparent; border: 1px solid var(--border-strong); padding: 16px; color: var(--text-main); border-radius: 4px; margin-bottom: 15px; font-size: 15px; transition: 0.3s; outline: none; }
.auth-input:focus { border-color: var(--accent-gold); }
.auth-error { color: var(--danger); font-size: 13px; margin: -8px 0 15px; min-height: 16px; }
.btn-auth { width: 100%; background: var(--accent-gold); color: #fff; padding: 16px; border-radius: 4px; font-weight: 500; font-size: 16px; border: none; cursor: pointer; transition: 0.3s; margin-bottom: 15px; }
@media (hover: hover) and (pointer: fine) {
    .btn-auth:hover { background: var(--accent-gold-hover); transform: translateY(-2px); }
}
.btn-auth:active { transform: scale(0.97); }
.auth-forgot { display: block; text-align: center; color: var(--accent-gold); font-size: 13px; margin-bottom: 25px; text-decoration: none; transition: 0.3s; }
@media (hover: hover) and (pointer: fine) {
    .auth-forgot:hover { color: var(--text-main); }
}
.btn-social-auth { width: 100%; background: transparent; border: 1px solid var(--border-strong); color: var(--text-main); padding: 15px; border-radius: 4px; font-size: 15px; font-weight: 500; display: flex; align-items: center; justify-content: center; position: relative; margin-bottom: 10px; cursor: pointer; transition: 0.3s; outline: none; }
.btn-social-auth i { position: absolute; left: 20px; font-size: 18px; color: var(--text-main); }
@media (hover: hover) and (pointer: fine) {
    .btn-social-auth:hover { background: var(--bg-soft); border-color: var(--border-strong); }
}
.btn-social-auth:active { transform: scale(0.97); }
.btn-social-auth:disabled { cursor: not-allowed; opacity: 0.4; }
.btn-social-auth:disabled:active { transform: none; }
@media (hover: hover) and (pointer: fine) {
    .btn-social-auth:disabled:hover { background: transparent; border-color: var(--border-strong); }
}
/* Google / Facebook login switched off in the admin (js/utils/login-providers.js) */
html:not([data-login-fb]) [data-login="facebook"],
html[data-login-google-off] [data-login="google"] { display: none !important; }
/* in the sign-up form the Facebook button carries the gap under «Зареєструватись»: Google takes it over */
html:not([data-login-fb]) .btn-auth + [data-login="facebook"] + .btn-social-auth { margin-top: 20px; }
/* the review form's «Вхід з допомогою» with no buttons left */
html:not([data-login-fb])[data-login-google-off] .pr-review-social { display: none !important; }

/* =========================================
   CART (global component)
   ========================================= */
/* Апдейт 93: back to a single backdrop painted directly on
   .cart-overlay (Апдейт 91's split into a separate .page-dim layer,
   sitting below the header so the header stayed sharp/undimmed, was
   a misreading of ByMax's own cart — on ByMax the header blurs and
   dims TOGETHER with the rest of the page as one layer, it doesn't
   stay crisp above it; confirmed against a ByMax screenshot the user
   sent). Opacity dropped from 0.85 to 0.7 (matching ByMax's own
   backdrop value, confirmed earlier by reading their CSS directly) —
   at 0.85 our header (#050505, nearly black already) combined with
   the blur to read as fully erased/black; at 0.7 the blurred header
   text/logo stays visibly present as a soft glow, same as everything
   else the backdrop dims, instead of vanishing — verified visually
   (screenshotted opacities 0.3-0.85 side by side against the real
   header background/text colors) before picking 0.7. */
/* Апдейт 106: every other overlay in this file (.search-overlay,
   .login-overlay, .mobile-menu-overlay) already guards itself with
   `pointer-events: none` by default / `all` on .active — only this one
   relied on `visibility` alone. That's the bug behind "can't click the
   cart icon again right after closing": `visibility` is not an
   animatable property the way opacity is, so browsers hold it at
   `visible` for the overlay's *entire* closing transition (now 0.5s+,
   see Апдейт 103) before finally switching to `hidden` at the very
   end — meaning this fixed, full-viewport, z-index:4000 element sat on
   top of the header (z-index:1000) and silently absorbed clicks aimed
   at the cart icon underneath for that whole ~0.5s window, even though
   it was nearly/fully transparent by then. Confirmed directly
   (Playwright, sampling document.elementFromPoint at the cart icon's
   screen position every ~50ms during close): the overlay, not the
   real button, was the hit target from 0ms through ~550ms. Bringing
   this into line with the other three overlays' pointer-events pattern
   fixes it the same way it's already solved everywhere else on the
   site — clicks pass straight through the instant closing starts,
   regardless of how long the fade still has left to visually finish. */
.cart-overlay {
    position: fixed; inset: 0; background: rgba(27, 49, 82, 0.45); -webkit-backdrop-filter: var(--blur-overlay); backdrop-filter: var(--blur-overlay);
    z-index: 4000; opacity: 0; visibility: hidden; pointer-events: none; transition: 0.5s ease;
    display: flex; justify-content: center; align-items: flex-start;
    overflow-y: auto; padding: 60px 20px;
}
.cart-overlay.active { opacity: 1; visibility: visible; pointer-events: all; }
/* Апдейт 102: was `transform: translateY(20px) -> 0` (slid up from
   20px below while fading in, slid back down on close) — read as a
   jump because the panel's position visibly changed over the
   animation.
   Апдейт 104 replaced that with `transform: scale(0.96 -> 1)`, assuming
   the leftover jump was a text-rasterization artifact at the
   scale-1 hand-off. Measured directly instead of guessing this time
   (getBoundingClientRect() of .cart-title-l sampled every ~25ms through
   the whole open animation): the title's left edge moves smoothly and
   continuously from ~644px to ~641.6px, a real ~2.3px drift, not a
   glitch at any single frame. That's inherent to scale() itself — a
   box growing from 96% to 100% around its own center necessarily
   slides its edges/content outward as it grows, and centered text sits
   close enough to that edge for a couple of px of real, continuous
   motion to be plainly visible. will-change/backface-visibility never
   had anything to fix, because there was no rendering glitch — the
   motion itself was the "jump". Fix: drop the scale entirely. Opacity
   alone changes brightness, not position, so there is no motion left
   to perceive as a jump in either direction — same requirement as
   Апдейт 102 asked for, just actually delivered this time. */
.cart-container {
    width: 100%; max-width: 800px; background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: 4px; box-shadow: 0 30px 60px rgba(15, 30, 51, 0.16); position: relative;
    opacity: 0; transition: opacity 0.5s ease;
    display: flex; flex-direction: column; margin: auto 0;
    /* Апдейт 104 only guarded .cart-header — but rapid repeated clicks
       on the cart toggle also landed on text further down (e.g. "Ваш
       кошик порожній" in .cart-content), which browsers select by
       default on a double/triple click. Апдейт 105: guard the whole
       panel instead of just its header, so no UI-chrome text inside it
       is selectable — .input-capsule text fields in the checkout form
       further down (name/phone/etc.) are form controls, and a form
       control's own value text stays selectable/editable regardless of
       user-select on an ancestor, so this doesn't block typing there. */
    user-select: none; -webkit-user-select: none;
}
.cart-overlay.active .cart-container { opacity: 1; }
.cart-header { padding: 25px 40px; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; }
.cart-title-l { font-size: 32px; font-weight: 400; color: var(--text-main); letter-spacing: 1px; }
.cart-content { padding: 40px; }

.c-row { display: grid; grid-template-columns: 80px 1fr auto auto; grid-template-rows: auto auto; gap: 10px 20px; align-items: center; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border-light); position: relative; user-select: none; -webkit-user-select: none; }
.c-img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; background: var(--bg-soft); grid-column: 1; grid-row: 1 / 3; align-self: center; }
.c-details { display: contents; }
.c-name { grid-column: 2 / 5; grid-row: 1; font-size: 16px; font-weight: 500; color: var(--text-main); line-height: 1.4; padding-right: 30px; align-self: end; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; word-break: break-word; }
.c-weight-row { grid-column: 2; grid-row: 2; display: flex; gap: 5px; align-self: center; }
.c-price { grid-column: 4; grid-row: 2; min-width: 80px; text-align: right; align-self: center; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.c-price-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.c-price-val { font-size: 18px; font-weight: 500; color: var(--text-main); }
.c-tea-tag { font-size: 10px; font-weight: 500; color: var(--accent-gold); text-transform: uppercase; letter-spacing: 0.5px; cursor: default; }
.c-qty-wrapper { grid-column: 3; grid-row: 2; display: flex; align-items: center; gap: 8px; align-self: center; }
.c-qty-box { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 4px; height: 36px; width: 100px; background: var(--bg-soft); overflow: hidden; }
.c-divider { display: none; }
.cw-btn { font-size: 11px; padding: 6px 10px; border-radius: 4px; background: transparent; color: var(--text-secondary); border: 1px solid var(--border-strong); cursor: pointer; transition: 0.2s; font-weight: 500; }
@media (hover: hover) and (pointer: fine) {
    .cw-btn:hover { color: var(--text-main); border-color: var(--border-strong); }
}
.cw-btn:active { border-color: var(--border-strong); }
.cw-btn.active { color: var(--accent-gold); border-color: var(--accent-gold); background: transparent; }
.c-q-btn { width: 30px; height: 100%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-secondary); transition: 0.2s; font-size: 16px; background: transparent; }
@media (hover: hover) and (pointer: fine) {
    .c-q-btn:hover { color: var(--text-main); background: var(--bg-soft); }
}
.c-q-btn:active { background: var(--bg-soft); }
.c-q-val { flex: 1; text-align: center; color: var(--text-main); font-size: 14px; font-weight: 500; height: 100%; display: flex; align-items: center; justify-content: center; }
.c-remove { position: static; flex-shrink: 0; color: var(--text-muted); cursor: pointer; font-size: 16px; width: 24px; height: 24px; display: flex; justify-content: center; align-items: center; transition: 0.2s; }
@media (hover: hover) and (pointer: fine) {
    .c-remove:hover { color: var(--danger); }
}
.c-remove:active { color: var(--danger); }

.cart-summary { display: flex; justify-content: flex-end; align-items: center; gap: 30px; margin-bottom: 40px; padding-top: 10px; }
.cs-label { font-size: 14px; text-transform: uppercase; color: var(--text-secondary); letter-spacing: 1px; }
.cs-val { font-size: 26px; font-weight: 500; color: var(--text-main); }
.cart-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 60px; }
.btn-back { display: flex; align-items: center; gap: 10px; color: var(--text-main); font-size: 14px; cursor: pointer; transition: 0.3s; }
@media (hover: hover) and (pointer: fine) {
    .btn-back:hover { color: var(--accent-gold); }
}
.btn-checkout { background: var(--accent-gold); color: #fff; padding: 12px 24px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; font-size: 12px; border-radius: 4px; transition: 0.3s; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) and (pointer: fine) {
    .btn-checkout:hover { background: var(--accent-hover); }
}
.btn-checkout:active { transform: scale(0.97); }
.btn-checkout.disabled { opacity: 0.5; pointer-events: none; cursor: not-allowed; }

.input-capsule { width: 100%; background: transparent; border: 1px solid var(--border-strong); padding: 16px; color: var(--text-main); margin-bottom: 15px; border-radius: 4px; outline: none; font-size: 15px; transition: 0.3s; }
.input-capsule:focus { border-color: var(--accent-gold); }
.input-capsule.field-invalid { border-color: var(--danger); }

/* Phone: country-code select + digits-only input, side by side. The
   select carries data-digits on each <option> — cart-ui.js reads the
   selected option's data-digits to know exactly how many digits that
   country's number should have (varies per country, so this can't be a
   single fixed maxlength). */
.phone-input-row { display: flex; gap: 8px; margin-bottom: 15px; }
.phone-input-row .input-capsule { margin-bottom: 0; }
.phone-code-select {
    flex: 0 0 100px;
    width: auto;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23999' stroke-width='1.5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px 7px;
    padding-right: 26px;
}
.phone-code-select option { background: var(--bg-soft); color: var(--text-main); }
.phone-number-input { flex: 1; min-width: 0; }

/* Telegram: "@" rendered as a static, unremovable prefix (rather than
   trying to intercept backspace inside the value itself, which is fragile
   on mobile/paste) — the input only ever holds the bare username. The "@"
   and the input text are true flex siblings centered together by
   align-items: center, rather than an absolutely-positioned "@" centered
   independently against the input's own centered text — two independently
   centered boxes can drift apart because the "@" glyph's cap-height differs
   from the surrounding lowercase text, which read as "crooked". The row
   itself now carries the visual capsule (border/background/radius); the
   input sits flush inside it, borderless. */
.tg-input-row {
    display: flex;
    align-items: center;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    padding: 0 16px;
    margin-bottom: 15px;
    transition: 0.3s;
}
.tg-input-row:focus-within { border-color: var(--accent-gold); }
.tg-input-row:has(.tg-input.field-invalid) { border-color: var(--danger); }
.tg-prefix { color: var(--text-secondary); font-size: 15px; flex-shrink: 0; pointer-events: none; }
.tg-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 15px;
    padding: 16px 0 16px 2px;
    margin-bottom: 0;
}

/* NOVA POSHTA DELIVERY + PAYMENT (np-checkout.js) */
.np-block { margin: 10px 0 20px; }
.np-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 12px; }
.np-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 15px; }
.np-tab {
    background: transparent; border: 1px solid var(--border-strong); color: var(--text-secondary); border-radius: 4px;
    padding: 12px 6px; font-size: 13px; font-family: inherit; cursor: pointer; transition: 0.2s;
}
@media (hover: hover) and (pointer: fine) {
    .np-tab:hover { color: var(--text-main); border-color: var(--border-strong); }
}
.np-tab.is-active { color: var(--accent-gold); border-color: var(--accent-gold); background: rgba(5, 83, 156, 0.06); }
.np-tab:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }
.np-field { position: relative; }
.np-field .input-capsule:disabled { opacity: 0.45; cursor: not-allowed; }
/* In the flow (not absolutely positioned): the list pushes the fields
   below it down instead of floating over them. */
.np-suggest {
    margin: -10px 0 15px; max-height: 240px; overflow-y: auto; overscroll-behavior: contain;
    border: 1px solid var(--border-light); border-radius: 4px; background: var(--bg-card);
}
.np-option { padding: 11px 14px; font-size: 14px; color: var(--text-main); cursor: pointer; line-height: 1.35; border-bottom: 1px solid var(--border-light); }
.np-option:last-child { border-bottom: none; }
.np-option.is-active { background: rgba(5, 83, 156, 0.12); color: var(--text-main); }
@media (hover: hover) and (pointer: fine) {
    .np-option:hover { background: rgba(5, 83, 156, 0.12); color: var(--text-main); }
}
.np-empty { padding: 12px 14px; font-size: 13px; color: var(--text-secondary); }
.np-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.np-note { font-size: 13px; color: var(--accent); margin: -5px 0 15px; line-height: 1.4; }
.np-pay {
    display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
    border: 1px solid var(--border-strong); border-radius: 4px; padding: 14px 16px; margin-bottom: 8px; transition: 0.2s;
}
.np-pay:has(input:checked) { border-color: var(--accent-gold); background: rgba(5, 83, 156, 0.06); }
.np-pay input { margin-top: 3px; accent-color: var(--accent-gold); flex-shrink: 0; }
.np-pay span { display: flex; flex-direction: column; gap: 3px; font-size: 14px; color: var(--text-main); }
.np-pay b { font-weight: 500; color: var(--text-main); }
.np-pay small { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.input-capsule.field-invalid + .np-suggest { border-color: var(--danger); }

/* CART RECOMMENDATIONS */
.cart-recommendations { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-light); }
.cart-recommendations h3 { color: var(--text-main); font-size: 16px; margin-bottom: 15px; font-weight: 500; }
.reco-scroll-wrap { position: relative; display: flex; align-items: center; }
/* Апдейт 95: touch-action changed pan-x -> "pan-x pan-y" — with
   .cart-content now the page's vertical scroll container (Апдейт 94),
   a touch drag that STARTS on .reco-track (this horizontal card
   strip) inherited its pan-x-only touch-action, which told the
   browser this touch gesture is horizontal-only from the first frame
   — so a vertical drag begun over a recommendation card couldn't
   scroll the cart at all, only true horizontal ones could move
   anything. Explicitly allowing both lets the browser's native
   gesture disambiguation decide per-drag, same as ByMax's own card
   strip (checked: no restrictive touch-action there either). */
.reco-track { display: flex; align-items: stretch; gap: 15px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; padding-bottom: 15px; padding-top: 10px; touch-action: pan-x pan-y; }
.reco-track::-webkit-scrollbar { display: none; }

.reco-track .app-card { flex: 0 0 200px; height: auto; align-self: stretch; cursor: pointer; border-radius: 4px; }
@media (hover: hover) and (pointer: fine) {
    .reco-track .app-card:hover { border-radius: 4px; border-color: var(--accent-gold); box-shadow: 0 5px 15px rgba(15, 30, 51, 0.1); z-index: 1; }
}
.reco-track .hover-dropdown { display: none !important; }
.reco-track .mobile-cart-btn { display: flex !important; }
.reco-track .card-wishlist-btn, .reco-track .card-compare-btn { display: none !important; }

.reco-scroll-btn { position: absolute; z-index: 10; width: 32px; height: 32px; background: rgba(255,255,255,0.92); color: var(--text-secondary); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.25s; border: 1px solid var(--border-light); -webkit-backdrop-filter: var(--blur-control); backdrop-filter: var(--blur-control); }
@media (hover: hover) and (pointer: fine) {
    .reco-scroll-btn:hover { background: var(--accent-soft); color: var(--accent-gold); border-color: var(--accent-gold); }
}
.reco-scroll-btn:active { transform: scale(0.9); }

/* Mobile-only "this scrolls" hint is driven from JS (see startSwipeHint()
   in js/components/cart-ui.js) rather than a CSS transform: .reco-track is
   itself the overflow-x:auto scroll container, so transform-animating it
   just slides the already-visible cards sideways as one rigid block —
   the clipping edge moves with them, so the next card never actually
   comes into view. Real scrollBy() on the element's genuine scroll
   position is what's needed to reveal it, hence JS-driven native smooth
   scrolling instead of a keyframe animation here. */
.reco-left { left: -15px; }
.reco-right { right: -15px; }

/* =========================================
   MULTI-LEVEL MOBILE MENU OVERLAY (global component)
   ========================================= */
/* Апдейт 113: backdrop fade timing matched to the cart's (0.3s -> 0.5s
   ease) per the user's "smooth like cart everywhere" request. The
   drawer's own slide-in (.mobile-menu-drawer below) keeps its 0.3s
   cubic-bezier — a slide is a different, intentional motion from a
   fade and doesn't need to match the cart's pacing. */
.mobile-menu-overlay {
    position: fixed; inset: 0; background: rgba(27, 49, 82, 0.45); -webkit-backdrop-filter: var(--blur-overlay); backdrop-filter: var(--blur-overlay);
    z-index: 8000; opacity: 0; visibility: hidden; pointer-events: none; transition: 0.5s ease;
    /* Contains the drawer below so a 100vh/100dvh mismatch (see the
       comment on .mobile-menu-drawer) can never leak into an accidental
       outer scroll on this backdrop — only .mm-list should ever scroll.
       touch-action: none + overscroll-behavior: none alongside it: same
       reasoning as the identical pair on .cart-overlay in
       responsive.css - overflow: hidden alone doesn't stop an iOS
       touch-drag from still rubber-banding this backdrop a little,
       these two block that at the backdrop itself. */
    overflow: hidden; touch-action: none; overscroll-behavior: none;
}
.mobile-menu-overlay.active { opacity: 1; visibility: visible; pointer-events: all; }
/* height: 100dvh (with 100vh kept right before it as the fallback for
   browsers that do not support dvh) — plain 100vh is the LARGEST
   possible viewport on iOS Safari (as if the address bar were fully
   collapsed), so whenever the address bar is actually showing, a
   100vh drawer is taller than the real visible screen. Since the
   drawer is `position: absolute` inside a `position: fixed` overlay
   that is sized to the REAL visible viewport, that mismatch used to
   push the bottom of the menu below the fold with nothing able to
   scroll it into view (the overlay had no scroll of its own, by
   design — only .mm-list should scroll). 100dvh always tracks the
   actual visible viewport, so the drawer is never taller than the
   screen actually showing it. */
.mobile-menu-drawer { position: absolute; top: 0; left: 0; width: 360px; max-width: 85vw; height: 100vh; height: 100dvh; background: var(--bg-card); border-right: 1px solid var(--border-light); transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; overflow: hidden; }
.mobile-menu-overlay.active .mobile-menu-drawer { transform: translateX(0); }
.mm-panel { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-card); display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); visibility: hidden; overflow: hidden; }
.mm-panel.active { transform: translateX(0); visibility: visible; }
.mm-panel.prev { transform: translateX(-30%); visibility: hidden; opacity: 0; }
.mm-header { display: flex; align-items: center; justify-content: center; position: relative; padding: 0 24px; border-bottom: 1px solid var(--border-light); font-size: 16px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase; color: var(--text-main); min-height: 70px; flex-shrink: 0; }
.mm-back { position: absolute; left: 24px; font-size: 20px; color: var(--text-secondary); cursor: pointer; padding: 10px; margin-left: -10px;}
.mm-list { padding: 0; flex-grow: 1; overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.mm-item { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; color: var(--text-main); font-size: 17px; border-bottom: 1px solid var(--border-light); cursor: pointer; text-decoration: none; }
.mm-item:active { background: var(--bg-soft); }
/* the «Каталог» grid icon is a white SVG (icon/square-grid 2x2.svg): tint it navy on the white drawer */
.mm-item img[src*="square-grid"] { filter: brightness(0) saturate(100%) invert(10%) sepia(40%) saturate(2400%) hue-rotate(200deg) brightness(92%); }
.mm-item i.fa-chevron-right { font-size: 15px; color: var(--text-secondary); }
.mm-social-link { color: var(--navy); font-size: 28px; transition: color 0.3s; }
/* ByMax wordmark in the menu header + the socials block under the links */
.mm-brand { font-size: 20px; font-weight: 800; letter-spacing: 2px; color: var(--navy); display: flex; align-items: center; }
.mm-brand .logo-img { height: 26px; }
.mm-brand .logo-accent { color: var(--accent); }
.mm-social-title {
    padding: 30px 24px 15px; font-size: 12px; font-weight: 800; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--text-muted);
}
.mm-social-row { display: flex; gap: 25px; padding: 10px 24px 40px; }
@media (hover: hover) and (pointer: fine) {
    .mm-social-link:hover { color: var(--accent-gold); }
}
.mm-social-link:active { color: var(--accent-gold); }

/* =========================================
   CART ADDITIONS (js/components/cart-extras.js): promo code, checkout
   options, quick order link; popular-city chips (np-checkout.js)
   ========================================= */
.cart-promo { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin: 4px 0 18px; }
.cart-promo[hidden] { display: none; }
.cart-promo-toggle {
    background: none; border: 0; padding: 4px 0; cursor: pointer; font: inherit; font-size: 13px;
    color: var(--accent-gold); text-decoration: underline; text-underline-offset: 3px;
}
.cart-promo-toggle[hidden] { display: none; }
.cart-promo-form { display: flex; gap: 8px; width: min(300px, 100%); }
.cart-promo-form[hidden] { display: none; }
.cart-promo-form .input-capsule { margin: 0; height: 38px; padding: 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }
.cart-promo-apply {
    flex-shrink: 0; height: 38px; padding: 0 12px; border: 1px solid var(--accent-gold); border-radius: 4px; background: none;
    color: var(--accent-gold); font: inherit; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; cursor: pointer;
}
.cart-promo-apply:disabled { opacity: 0.5; cursor: wait; }
@media (hover: hover) and (pointer: fine) { .cart-promo-apply:not(:disabled):hover { background: var(--accent-gold); color: #fff; } }
.cart-promo-applied { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-main); }
.cart-promo-applied[hidden] { display: none; }
.cart-promo-applied b { color: var(--accent-gold); letter-spacing: 1px; }
.cart-promo-remove { width: 28px; height: 28px; border: 1px solid var(--border-strong); border-radius: 4px; background: none; color: var(--text-secondary); cursor: pointer; font-size: 16px; line-height: 1; }
.cart-promo-remove:hover { color: var(--text-main); border-color: var(--border-strong); }
.cart-promo-msg { margin: 0; font-size: 12px; max-width: 360px; text-align: right; }
.cart-promo-msg[hidden] { display: none; }
.cart-promo-msg--error { color: var(--danger); }
.cart-promo-msg--info { color: var(--text-secondary); }

.checkout-options { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; }
.checkout-options:empty { display: none; }
.checkout-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-secondary); cursor: pointer; line-height: 1.45; }
.checkout-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent-gold); flex-shrink: 0; }
.checkout-check a, .checkout-terms-note a { color: var(--accent-gold); text-decoration: underline; text-underline-offset: 2px; }
.checkout-check input.field-invalid { outline: 2px solid var(--danger); outline-offset: 2px; }
.checkout-terms-note { font-size: 12px; color: var(--text-secondary); margin: 0; line-height: 1.5; }

.cart-quick { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 12px; margin: -44px 0 50px; font-size: 12px; color: var(--text-secondary); }
.cart-quick[hidden] { display: none; }
.cart-quick-btn {
    background: none; border: 0; padding: 4px 0; cursor: pointer; font: inherit; font-size: 13px; color: var(--text-main);
    text-decoration: underline; text-underline-offset: 3px;
}
.cart-quick-btn:hover { color: var(--accent-gold); }
@media (max-width: 768px) {
    .cart-promo-form { width: 100%; }
    .cart-promo-form .input-capsule { font-size: 16px; } /* 16px: iOS doesn't zoom in on focus */
}

.np-cities { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 14px; }
.np-cities[hidden], .np-cities:empty { display: none; }
.np-city-chip {
    padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 4px; background: none; color: var(--text-secondary);
    font: inherit; font-size: 12px; cursor: pointer; transition: 0.2s;
}
.np-city-chip:hover { color: var(--text-main); border-color: var(--accent-gold); }
.np-city-chip:disabled { opacity: 0.5; cursor: wait; }

/* =========================================
   MINI DIALOG (js/components/mini-modal.js): quick order, stock request
   ========================================= */
.mm2-overlay {
    position: fixed; inset: 0; z-index: 7000; /* above the cart (4000) and search (6000) */ display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(27, 49, 82, 0.45); opacity: 0; transition: opacity 0.2s ease;
    touch-action: none; overscroll-behavior: none;
}
.mm2-overlay.is-open { opacity: 1; }
.mm2 {
    position: relative; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
    background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 4px; padding: 28px 24px 24px;
    transform: translateY(8px); transition: transform 0.2s ease; touch-action: pan-y;
}
.mm2-overlay.is-open .mm2 { transform: none; }
@media (prefers-reduced-motion: reduce) { .mm2-overlay, .mm2 { transition: none; } }
.mm2-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; background: none; color: var(--text-secondary); font-size: 24px; cursor: pointer; }
.mm2-close:hover { color: var(--text-main); }
.mm2-title { margin: 0 30px 14px 0; font-size: 17px; font-weight: 600; color: var(--text-main); text-transform: uppercase; letter-spacing: 1px; }
.mm2-lead { margin-bottom: 16px; }
.mm2-items { list-style: none; margin: 0 0 8px; padding: 0; border-top: 1px solid var(--border-light); }
.mm2-items li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; color: var(--text-secondary); }
.mm2-items b { font-weight: 500; color: var(--text-main); white-space: nowrap; }
.mm2-total { margin: 8px 0; text-align: right; font-size: 14px; color: var(--text-secondary); }
.mm2-total b { color: var(--text-main); font-size: 16px; }
.mm2-hint { margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.mm2-hint b { color: var(--text-main); font-weight: 500; }
.mm2-label { display: block; margin: 12px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); }
.mm2-label small { text-transform: none; letter-spacing: 0; color: var(--text-secondary); }
.mm2 .input-capsule { margin-bottom: 0; padding: 13px 14px; }
.mm2-phone { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 4px; transition: 0.3s; }
.mm2-phone:focus-within { border-color: var(--accent-gold); }
.mm2-phone span { padding: 0 4px 0 14px; color: var(--text-secondary); font-size: 15px; }
.mm2-phone input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text-main); font-size: 15px; padding: 13px 14px 13px 4px; }
.mm2-error { margin: 12px 0 0; font-size: 13px; color: var(--danger); }
.mm2-error[hidden] { display: none; }
.mm2-submit { display: block; width: 100%; margin-top: 18px; text-align: center; border: 0; font-family: inherit; }
.mm2-submit:disabled { opacity: 0.6; cursor: wait; }
/* quick order: «Передзвоніть мені» under «Оплатити зараз» */
.mm2-submit.mm2-alt { margin-top: 10px; padding: 12px 24px; background: none; color: var(--text-secondary); border: 1px solid var(--border-strong); border-radius: 4px; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; transition: 0.3s; }
@media (hover: hover) and (pointer: fine) {
    .mm2-submit.mm2-alt:hover { color: var(--text-main); border-color: var(--accent-gold); }
}


/* «Порівняння»: the pill at the bottom left once a product is picked (js/components/compare-bar.js) */
.compare-bar {
    position: fixed; left: 16px; bottom: 16px; z-index: 900;
    display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px;
    background: var(--navy); color: #fff; border-radius: 999px; box-shadow: 0 8px 24px rgba(15, 30, 51, 0.28);
    font-size: 13px; line-height: 1;
}
.compare-bar[hidden] { display: none; }
.compare-bar-icon { display: inline-flex; opacity: 0.85; }
.compare-bar-clear { width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 12px; cursor: pointer; flex-shrink: 0; }
@media (hover: hover) and (pointer: fine) { .compare-bar-clear:hover { background: rgba(255, 255, 255, 0.28); } }
.compare-bar-icon svg { width: 18px; height: 18px; }
.compare-bar-go {
    padding: 9px 14px; border-radius: 999px; background: #fff; color: var(--navy); font-weight: 600; font-size: 13px; text-decoration: none;
}
@media (hover: hover) and (pointer: fine) { .compare-bar-go:hover { background: var(--accent-soft); } }
@media (max-width: 600px) { .compare-bar { left: 12px; bottom: 12px; max-width: calc(100vw - 150px); } .compare-bar-text { display: none; } }

/* «Порівняння» in the mobile menu: the number of picked products */
.mm-compare-count {
    min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: #fff;
    font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
}
.mm-compare-count[hidden] { display: none; }
