/* =========================================================
   site.css — SkyRazor, новий світлий дизайн (весь сайт).
   Підключається лише в новому дизайні (partials/v2/head.php) замість
   styles/redesign.css + css/style.css. Тут: кольори/шрифти, база, кнопки,
   бейджі, картки, форми, кошик і оформлення замовлення, шапка, мега-меню,
   чипси, підвал, нижня панель. Стилі сторінок — у styles/v2/*.css.
   Контракт для сторінок: scratchpad v2/CONTRACT.md.
   Брейкпойнти: 900px (планшет/телефон), 600px (телефон).
   ========================================================= */

/* ---------- 1. Змінні ---------- */
:root {
  --bg: #F6F7F9;            /* фон сторінки */
  --bg-2: #ECEEF2;          /* трохи темніший фон (смуги, підкладки) */
  --surface: #FFFFFF;       /* картки */
  --surface-2: #F2F4F7;     /* сірі плашки */
  --line: #E2E6EC;          /* тонкі рамки */
  --line-2: #D5DAE2;        /* рамки кнопок і полів */
  --text: #0E1116;          /* основний текст */
  --text-2: #4A5466;        /* другорядний текст */
  --muted: #5F6A7D;         /* підписи */
  --accent: #00A68E;        /* бірюзовий: головні кнопки */
  --accent-hover: #0FB59C;
  --accent-ink: #04140F;    /* текст на бірюзовій кнопці */
  --accent-text: #007A68;   /* бірюзовий для дрібного тексту і посилань */
  --accent-soft: #E6F6F3;   /* світло-бірюзовий фон */
  --accent-soft-ink: #00594C;
  --accent-2: #C97A00;      /* бурштиновий акцент («Під замовлення», знижки) */
  --amber-soft: #FFF1DB;    /* бейджі */
  --amber-ink: #8A5300;
  --ok: #0B7A3E;            /* «В наявності» */
  --danger: #D1382B;
  --img: #EEF0F4;           /* підкладка під фото */
  --img-stripe: #E2E6EC;
  --shadow: 0 20px 50px -24px rgba(16, 24, 40, .28);
  --shadow-lg: 0 24px 48px -16px rgba(16, 24, 40, .22);
  --photo-shadow: 0 16px 34px -14px rgba(16, 24, 40, .22);
  --radius: 20px;           /* картки */
  --radius-sm: 12px;        /* кнопки, поля */
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Unbounded', 'Manrope', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --container: 1240px;      /* ширина контенту разом з відступами */
  --gutter: 32px;           /* бічний відступ контейнера */
  --header-h: 76px;         /* висота липкої шапки зверху (оновлює js/chrome.js) */
  --header-row-h: 76px;     /* висота лише .header (оновлює js/chrome.js) */
}

/* ---------- 2. База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body { color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--accent-soft-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(0, 166, 142, .45); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; letter-spacing: -.01em; line-height: 1.2; }
s { color: #6B7486; font-weight: 500; font-size: .7em; margin-left: 6px; }
.sr { background: var(--bg); color: var(--text); font-family: var(--font); min-height: 100vh; }
.sr [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Контейнери: .container — для шапки/підвалу/секцій, .sr-main — <main> сторінки */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.sr-main { display: block; width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.show-sm { display: none !important; }

/* Іконки Lucide (partials/icons.php → sr_icon()): колір — currentColor, розмір — атрибути width/height */
.sr-i { display: inline-block; flex: none; vertical-align: middle; }

/* ---------- 3. Заголовки, бейджі, картки ---------- */
.h2 { font-size: 34px; line-height: 1.15; margin: 8px 0 24px; }
.eyebrow { font: 500 12px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); }
.accent { color: #00927D; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tag { display: inline-block; padding: 5px 9px; border-radius: 8px; font: 500 12px/1.2 var(--font-mono); letter-spacing: .06em; }
.tag--amber { background: var(--amber-soft); color: var(--amber-ink); }
.tag--teal { background: var(--accent-soft); color: var(--accent-soft-ink); }
/* Товарний ярлик («НОВИНКА», «ХІТ · −15%» …) — «планка»: бірюзова смуга 3px ліворуч, тонка рамка, світлий фон.
   Лише для ярликів товарів (головна, мега-меню, каталог, сторінка товару). Ставиться поверх фото. */
.sr-label { display: inline-flex; align-items: center; max-width: calc(100% - 16px); padding: 2px 6px 2px 5px;
  border: 1px solid var(--accent); border-left-width: 3px; border-radius: 2px; background: var(--accent-soft); color: var(--accent-soft-ink);
  font: 600 10px/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.sr-label[hidden] { display: none; }

/* ---------- 4. Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 48px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--surface-2); color: var(--text); font-family: var(--font); font-weight: 700; font-size: 15px; line-height: 1.2; white-space: nowrap; text-align: center; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn--lg { height: 56px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn--sm { height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn--block { display: flex; width: 100%; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn--outline, .btn--ghost { background: var(--surface); border-color: var(--line-2); color: var(--text); }
.btn--outline:hover, .btn--ghost:hover { border-color: #AEB6C3; color: var(--text); }
.btn--soft { background: var(--accent-soft); color: var(--accent-soft-ink); }
.btn--soft:hover { background: #D3EFE9; color: var(--accent-soft-ink); }
.btn--grey { background: var(--surface-2); color: var(--text); }
.btn--grey:hover { background: #E7EAEF; color: var(--text); }
.btn--dark { background: var(--text); color: #fff; }
.btn--dark:hover { background: #262C36; color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.icon-btn { width: 48px; height: 48px; flex: none; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.icon-btn:hover { border-color: #AEB6C3; color: var(--text); }

/* ---------- 5. Форми ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-group.full-width { grid-column: 1 / -1; }
.form-label { font-size: 14px; font-weight: 600; color: var(--text); }
.form-input, .form-textarea, .form-select { width: 100%; min-width: 0; min-height: 50px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; outline: none; transition: border-color .15s, background .15s; }
textarea.form-input, .form-textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.form-input::placeholder, .form-textarea::placeholder { color: #8A93A3; }
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--accent); background: var(--surface); }
.form-input.is-invalid, .form-textarea.is-invalid { border-color: var(--danger); }
.submit-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 56px; padding: 0 26px; border: 0; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-family: var(--font); font-weight: 700; font-size: 16px; cursor: pointer; transition: background .15s; }
.submit-btn:hover { background: var(--accent-hover); }
.submit-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- 6. Кошик (класи генерує js/UniversalCart.js) ---------- */
.cart-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(14, 17, 22, .55); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.cart-overlay.show { opacity: 1; pointer-events: auto; }
.cart-container { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 94vw); background: var(--surface); border-left: 1px solid var(--line); z-index: 71; display: flex; flex-direction: column; box-shadow: var(--shadow); transform: translateX(103%); transition: transform .38s cubic-bezier(.4, 0, .2, 1); }
.cart-overlay.show .cart-container { transform: translateX(0); }
.cart-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.cart-header h2 { font-family: var(--font-head); font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.cart-counter { font-family: var(--font-mono); font-size: 12px; padding: 3px 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-weight: 500; }
.cart-close { width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.cart-close:hover { border-color: #AEB6C3; }
.cart-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.cart-items { display: flex; flex-direction: column; gap: 12px; }
.empty-cart { margin: auto; text-align: center; padding: 40px 20px; display: flex; flex-direction: column; gap: 10px; align-items: center; color: var(--muted); }
.empty-cart-icon { font-size: 32px; display: flex; color: var(--muted); }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); align-items: start; }
.cart-item-image { width: 64px; height: 64px; border-radius: 10px; object-fit: contain; padding: 6px; background: #fff; border: 1px solid var(--line); }
.cart-item-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cart-item-info h4 { font-size: 14px; font-weight: 700; line-height: 1.35; margin: 0; }
.cart-item-price, .cart-item-original-price { font-weight: 700; font-size: 16px; }
.cart-item-old-price { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.cart-item-controls { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); padding: 2px; grid-column: 1 / 3; width: max-content; margin-top: 4px; }
.qty-btn { width: 32px; height: 32px; border: none; background: transparent; color: var(--text); border-radius: 8px; cursor: pointer; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.qty-btn:hover { background: var(--surface-2); color: var(--accent-text); }
.qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.quantity { min-width: 24px; text-align: center; font-family: var(--font-mono); font-size: 14px; display: inline-block; }
.remove-btn { grid-row: 1; grid-column: 3; justify-self: end; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.remove-btn:hover { border-color: var(--danger); color: var(--danger); }
.cart-footer { padding: 20px 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; background: var(--surface); }
.cart-total-section { display: flex; align-items: baseline; justify-content: space-between; }
.cart-total-section span:first-child { font: 500 12px var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.cart-total { font: 700 24px/1.1 var(--font-head); }
.cart-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-continue, .btn-checkout { width: 100%; height: 52px; padding: 0 18px; border: 1px solid transparent; border-radius: 14px; font-family: var(--font); font-weight: 700; font-size: 15px; cursor: pointer; transition: background .15s, border-color .15s; }
.btn-continue { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.btn-continue:hover { border-color: #AEB6C3; }
.btn-checkout { background: var(--accent); color: var(--accent-ink); }
.btn-checkout:hover { background: var(--accent-hover); }
.btn-checkout:disabled { opacity: .4; cursor: not-allowed; background: var(--accent); }

/* повідомлення «Товар додано до кошика» (додається у <body>) */
.cart-notification { position: fixed; top: 20px; right: -400px; z-index: 200; background: var(--text); color: #fff; padding: 14px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; max-width: 320px; box-shadow: var(--shadow); transition: right .3s ease; }
.cart-notification.show { right: 20px; }

/* ---------- 7. Оформлення замовлення ---------- */
.checkout-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(14, 17, 22, .6); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s ease; padding: 20px; }
.checkout-overlay.show { opacity: 1; pointer-events: auto; }
.checkout-form { width: min(500px, 100%); max-height: 90vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.checkout-header { padding: 22px 26px; border-bottom: 1px solid var(--line); }
.checkout-header h3 { font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.checkout-body { padding: 22px 26px 26px; display: flex; flex-direction: column; gap: 16px; }
.order-summary { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--bg); }
.order-summary h4 { font-size: 14px; margin: 0 0 10px; }
.order-item { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 6px 0; color: var(--text-2); }
.order-item span:last-child { white-space: nowrap; font-weight: 600; color: var(--text); }
.order-item:last-child { color: var(--text); border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }
.checkout-form .form-group + .form-group { margin-top: 12px; }
.checkout-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn-cancel { flex: 1; height: 52px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); color: var(--text); font-family: var(--font); font-weight: 700; cursor: pointer; }
.btn-cancel:hover { border-color: #AEB6C3; }
.btn-submit { flex: 2; height: 52px; border: none; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-family: var(--font); font-weight: 700; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-submit:hover { background: var(--accent-hover); }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; }
.loading-spinner { display: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(4, 20, 15, .25); border-top-color: currentColor; animation: srSpin .7s linear infinite; }
@keyframes srSpin { to { transform: rotate(360deg); } }
.checkout-form .success-message { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid #BFE6DE; color: var(--accent-soft-ink); font-size: 14px; line-height: 1.5; }
.checkout-form .error-message { padding: 14px 16px; border-radius: var(--radius-sm); background: #FDECEA; border: 1px solid #F3B8B2; color: #B42318; font-size: 14px; line-height: 1.5; }

/* ---------- 8. Верхня смуга ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.topbar__in { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; padding-top: 8px; padding-bottom: 8px; }
.topbar__info, .topbar__contacts { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; }
.topbar__contacts a { color: var(--text-2); }
.topbar__contacts a:hover { color: var(--accent-text); }
.topbar .topbar__phone { font-weight: 700; color: var(--text); }

/* ---------- 9. Шапка ---------- */
.header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); }
.header__row { position: relative; display: flex; align-items: center; gap: 12px 20px; padding-top: 14px; padding-bottom: 14px; }
.logo { flex: none; display: block; }
.logo img { height: 44px; width: auto; }
.hdr-catalog { flex: none; }
.hdr-catalog__chev { transition: transform .15s; }
.hdr-catalog.is-open .hdr-catalog__chev { transform: rotate(180deg); }
.search { position: relative; flex: 1 1 280px; min-width: 0; height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg); color: var(--muted); }
.search > svg { flex: none; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; padding: 0; background: transparent; outline: none; font-size: 15px; color: var(--text); -webkit-appearance: none; appearance: none; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search:focus-within { border-color: var(--accent); background: var(--surface); }
.cart-btn { flex: none; }
.cart-btn__count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }

/* живий пошук у шапці (розмітку генерує js/theme.js) */
.sr-search__dropdown { position: absolute; top: calc(100% + 8px); left: -1px; right: -1px; z-index: 55; max-height: min(70vh, 560px); overflow-y: auto; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); color: var(--text); }
.sr-search__result { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; color: var(--text); line-height: 1.3; }
.sr-search__result:hover, .sr-search__result:focus-visible { background: var(--surface-2); color: var(--text); }
.sr-search__result img { width: 48px; height: 48px; flex: none; object-fit: contain; padding: 4px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.sr-search__result-title { font-size: 14px; font-weight: 600; }
.sr-search__result-price { display: inline-block; margin-top: 2px; font: 500 13px var(--font-mono); color: var(--accent-text); }
.sr-search__hint { padding: 16px; text-align: center; font-size: 14px; color: var(--muted); }
.sr-search__all { display: block; margin-top: 4px; padding: 12px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; text-align: center; font-size: 14px; font-weight: 700; color: var(--accent-text); }
.sr-search__all:hover { background: var(--surface-2); color: var(--accent-soft-ink); }

/* чипси категорій під шапкою: на компʼютері липкі разом із шапкою */
.chips-bar { position: sticky; top: var(--header-row-h); z-index: 49; background: var(--surface); border-bottom: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 12px; }
.chips a { padding: 8px 14px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; }
.chips a:hover { background: var(--accent-soft); color: var(--accent-soft-ink); }
.chips em { font-style: normal; font-weight: 500; color: var(--muted); }

/* ---------- 10. Мега-меню каталогу ---------- */
.mega { position: absolute; left: var(--gutter); right: var(--gutter); top: calc(100% - 6px); z-index: 60; display: flex; max-height: calc(100vh - var(--header-row-h) - 16px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); }
.mega__cats { flex: 0 0 300px; background: var(--bg); border-right: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.mega__cats > a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--text); font-weight: 600; font-size: 15px; }
.mega__cats > a span { flex: 1; }
.mega__cats > a em { font-style: normal; font-weight: 500; font-size: 13px; color: var(--muted); }
.mega__chev { color: #A0A8B6; }
.mega__cats > a.is-active { background: var(--surface); color: var(--accent-text); }
.mega__cats > a.is-active .mega__chev { color: var(--accent-text); }
.mega__extra { margin-top: 10px; padding: 12px 12px 4px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.mega__extra a { color: var(--text-2); }
.mega__extra a:hover { color: var(--accent-text); }
.mega__extra .mega__phone { margin-top: 6px; font: 700 16px/1.2 var(--font-head); color: var(--text); }
.mega__hours { font-size: 13px; color: var(--muted); }
.mega__panes { position: relative; flex: 1; min-width: 0; padding: 24px 28px; }
.mega__close { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.mega__close:hover { background: var(--surface-2); }
.mega__pane { display: none; gap: 28px; flex-wrap: wrap; }
.mega__pane.is-active { display: flex; }
.mega__main { flex: 1 1 320px; min-width: 0; }
.mega__main h3 { font-size: 20px; line-height: 1.2; padding-right: 48px; }
.mega__main > p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.mega__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin-top: 16px; }
.mega__links a { padding: 10px 0; font-size: 15px; color: var(--text); border-bottom: 1px solid #EEF0F4; }
.mega__links a:hover { color: var(--accent-text); }
.mega__all { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-weight: 700; font-size: 15px; }
.mega__feat { flex: 0 0 220px; align-self: flex-start; margin-top: 40px; background: var(--bg); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.mega__feat:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.mega__feat img { height: 130px; width: 100%; object-fit: contain; background: #fff; border-radius: var(--radius-sm); padding: 6px; }
.mega__feat b { font-size: 15px; line-height: 1.3; }
.mega__feat { position: relative; }
.mega__feat > .sr-label { align-self: flex-start; }
.mega__feat:has(> img) > .sr-label { position: absolute; left: 18px; top: 18px; }
.mega__feat:has(> img):has(> .sr-label) img { padding-top: 28px; }
.mega__stock { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ok); }
.mega__stock::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #16A34A; }
.mega__stock--order { color: var(--amber-ink); }
.mega__stock--order::before { background: #D98E04; }
.mega__stock--out { color: var(--muted); }
.mega__stock--out::before { background: #A0A8B6; }
.mega__price { font-weight: 700; font-size: 17px; }

/* ---------- 11. Підвал ---------- */
.footer { margin-top: 72px; background: var(--surface); border-top: 1px solid var(--line); font-size: 15px; }
.footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 28px; padding-top: 48px; padding-bottom: 24px; }
.footer__grid > div { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.footer__grid b { font-family: var(--font-head); font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.footer__grid a { color: var(--text-2); overflow-wrap: anywhere; }
.footer__grid a:hover { color: var(--accent-text); }
.footer__grid p, .footer__grid span { margin: 0; color: var(--muted); line-height: 1.55; }
.footer__logo { height: 38px; width: auto; }
.footer__grid .footer__phone { font-weight: 700; color: var(--text); }
.footer__bottom { border-top: 1px solid var(--line); padding-top: 18px; padding-bottom: 28px; font-size: 13px; color: var(--muted); }

/* ---------- 12. Нижня панель (лише телефон) ---------- */
.tabbar { display: none; }

/* =========================================================
   Планшет і телефон (≤ 900px)
   ========================================================= */
@media (max-width: 900px) {
  :root { --gutter: 20px; }
  .hide-sm { display: none !important; }
  .show-sm { display: inline-flex !important; }
  .h2 { font-size: 24px; }

  /* компактна шапка: [каталог] [лого] [дзвінок] [кошик] / [пошук] */
  .header__row { flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .logo { order: 1; flex: 1; min-width: 0; }
  .logo img { height: 30px; }
  .hdr-catalog { order: 0; }
  .hdr-catalog__btn { width: 44px; height: 44px; padding: 0; }
  .hdr-catalog__btn span, .hdr-catalog__chev { display: none; }
  .header__row .icon-btn { order: 2; width: 44px; height: 44px; }
  .cart-btn { order: 3; height: 44px; padding: 0 12px; }
  .search { order: 4; flex-basis: 100%; height: 42px; }
  .search input { font-size: 16px; } /* 16px — щоб iOS не збільшував сторінку */

  /* чипси на телефоні не липкі: прокручуються разом зі сторінкою */
  .chips-bar { position: static; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-top: 8px; padding-bottom: 10px; }
  .chips::-webkit-scrollbar { display: none; }
  .chips a { padding: 7px 12px; font-size: 13px; }

  /* каталог на телефоні — на весь екран, лише список категорій */
  .mega { position: fixed; inset: 0; max-height: none; border: 0; border-radius: 0; flex-direction: column; overflow-y: auto; z-index: 80; }
  .mega__cats { flex: 1 0 auto; border-right: 0; padding: 64px 16px 24px; }
  .mega__panes { position: static; padding: 0; }
  .mega__pane { display: none !important; }
  .mega__close { position: fixed; right: 12px; top: 10px; background: var(--surface); border: 1px solid var(--line); }
  html.mega-open, html.mega-open body { overflow: hidden; }

  .footer { margin-top: 48px; padding-bottom: 72px; }
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 20px; padding-top: 32px; }
  .footer__grid > div:first-child { grid-column: 1 / -1; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: 64px; padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--text-2); }
  .tabbar a:hover { color: var(--accent-text); }

  .cart-notification { top: auto; bottom: 76px; }
  .cart-notification.show { right: 12px; }
}

/* =========================================================
   Телефон (≤ 600px)
   ========================================================= */
@media (max-width: 600px) {
  .sr-label { padding: 1px 5px 1px 4px; font-size: 9.5px; letter-spacing: .04em; }
  :root { --gutter: 16px; }
  .topbar { font-size: 12px; }
  .topbar__in { padding-top: 6px; padding-bottom: 6px; }
  .form-grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .cart-header, .cart-footer { padding: 16px 18px; }
  .checkout-overlay { padding: 10px; align-items: flex-end; }
  .checkout-form { max-height: 94vh; border-radius: 20px; }
  .checkout-header { padding: 18px 20px; }
  .checkout-body { padding: 18px 20px 22px; }
  .checkout-actions { flex-direction: column-reverse; }
  .btn-cancel, .btn-submit { flex: none; width: 100%; }
}

/* Мега-меню: товари з фото для невеликих категорій без «витрини» (partials/v2/header.php, $cat['products']) */
.mega__prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 18px; max-width: 900px; }
.mega__prods .mega__prod { margin-top: 0; flex: none; align-self: stretch; }
.mega__prod b { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mega__prod .mega__price { margin-top: auto; }

/* Мега-меню: калькулятори (жирні, під категоріями) і їхні блоки праворуч з описом */
.mega__calcs { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.mega__calc { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 6px 12px; border-radius: var(--radius-sm); color: var(--text); font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.mega__calc svg { flex: none; color: var(--accent-text); }
.mega__calc .mega__chev { color: #A0A8B6; }
.mega__calc span { flex: 1; }
.mega__calc:hover, .mega__calc.is-active { background: var(--surface); color: var(--accent-text); }
.mega__calc.is-active .mega__chev { color: var(--accent-text); }
.mega__calcs + .mega__extra { margin-top: 10px; }
.mega__kicker { display: inline-block; margin-bottom: 8px; font: 500 12px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); }
.mega__pane--calc .mega__main > p { max-width: 56ch; margin-top: 10px; font-size: 15px; line-height: 1.55; color: var(--text-2); }
.mega__points { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mega__points li { position: relative; padding-left: 28px; font-size: 15px; line-height: 1.45; color: var(--text); }
.mega__pt-ic { position: absolute; left: 0; top: 2px; width: 18px; height: 18px; padding: 3px; box-sizing: border-box; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); }
.mega__open { margin-top: 22px; }
.mega__calc-img { flex: 0 0 260px; align-self: flex-start; margin-top: 40px; padding: 14px; background: var(--bg); border-radius: 16px; }
.mega__calc-img img { display: block; width: 100%; height: 200px; object-fit: contain; }
@media (max-width: 900px) {
  .mega__calcs { padding: 10px 0 0; }
  .mega__calc { min-height: 48px; font-size: 15px; }
}
/* Відгуки / Контакти — окрема група під калькуляторами */
.mega__calcs--pages { margin-top: 10px; }
.mega__extra:empty, .mega__extra > .mega__phone:first-child { margin-top: 10px; }

/* Мега-меню «Контакти»: кнопки телефон / месенджери / пошта (partials/v2/header.php, 'contacts' => true).
   Кольори кружків — фірмові кольори месенджерів, щоб їх впізнавали з першого погляду. */
.mega__contacts { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; max-width: 660px; }
.mega__ct { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px 8px 8px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s; }
.mega__ct:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.mega__ct:active { background: #D3EFEA; }
.mega__ct-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; background: var(--accent-text); }
.mega__ct--tg .mega__ct-ic { background: #229ED9; }
.mega__ct--viber .mega__ct-ic { background: #7360F2; }
.mega__ct--wa .mega__ct-ic { background: #1DAA61; }
.mega__ct--mail .mega__ct-ic { background: #5B6475; }
.mega__ct-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.mega__ct-tx b { font-size: 15px; }
.mega__ct-tx small { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mega__contacts + .mega__open { margin-top: 18px; }
@media (max-width: 600px) { .mega__contacts { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .mega__ct { transition: none; } }
