/* =====================================================================
   Crown Sound — клиентский магазин. Палитра: белый фон, синий и фиолетовый
   акценты. Все размеры — на CSS-переменных, чтобы адаптив был один в один.
   ===================================================================== */

:root {
    --c-bg: #ffffff;
    --c-surface: #f6f8ff;
    --c-surface-2: #eef1ff;
    --c-border: #e2e7f5;
    --c-border-strong: #c9d0ec;
    --c-text: #0f172a;
    --c-muted: #64748b;
    --c-primary: #2f6fed;
    --c-primary-strong: #1e54c6;
    --c-secondary: #6d4cff;
    --c-secondary-strong: #5532e0;
    --c-accent-soft: #eaf0ff;
    --c-grad: linear-gradient(135deg, #2f6fed 0%, #6d4cff 100%);
    --c-success: #16a34a;
    --c-danger: #dc2626;
    --c-warning: #d97706;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 6px 18px rgba(15, 23, 42, .05);
    --shadow: 0 14px 35px rgba(15, 23, 42, .08);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, .12);

    --container: 1280px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--c-text);
    background: var(--c-bg);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 12px; color: var(--c-text); font-weight: 800; }
h1 { font-size: clamp(24px, 3vw, 36px); }
h2 { font-size: clamp(20px, 2.2vw, 26px); }
h3 { font-size: 18px; }
p { margin: 0 0 12px; }
.muted { color: var(--c-muted); }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
    position: absolute; left: -9999px; top: 0; background: var(--c-primary);
    color: #fff; padding: 8px 12px; border-radius: 0 0 8px 0; z-index: 9999;
}
.skip:focus { left: 0; }

main { flex: 1 0 auto; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 40px 0; }

/* ============ Кнопки ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px;
    font-weight: 700; font-size: 15px; line-height: 1; text-decoration: none;
    transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--c-grad); color: #fff; box-shadow: 0 8px 20px rgba(47,111,237,.28); }
.btn-primary:hover { box-shadow: 0 12px 28px rgba(47,111,237,.36); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: #fff; color: var(--c-text); border-color: var(--c-border-strong); }
.btn-ghost:hover { background: var(--c-surface); }
.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--c-primary); padding: 0; font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ============ Шапка ============ */
/* ============ Шапка сайта ============ */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--c-border);
    position: sticky; top: 0; z-index: 50;
}
.header-top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--c-text); }
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 12px; background: var(--c-grad);
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; letter-spacing: .04em; font-size: 14px;
    flex-shrink: 0;
}
.brand-text { font-weight: 800; font-size: 18px; white-space: nowrap; }

.header-search { position: relative; max-width: 560px; width: 100%; justify-self: center; }
.header-search input {
    width: 100%; height: 44px; padding: 0 48px 0 16px; border-radius: 12px;
    border: 1px solid var(--c-border-strong); background: #fff; color: var(--c-text); font-size: 15px;
}
.header-search input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(47,111,237,.18); }
.header-search button {
    position: absolute; right: 4px; top: 4px; width: 36px; height: 36px;
    border-radius: 10px; border: 0; background: var(--c-grad); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
}
.suggest {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px);
    background: #fff; border: 1px solid var(--c-border); border-radius: 12px;
    box-shadow: var(--shadow); overflow: hidden; z-index: 60;
}
.suggest a {
    display: flex; gap: 10px; padding: 10px 14px; color: var(--c-text); text-decoration: none;
    border-bottom: 1px solid var(--c-border);
}
.suggest a:last-child { border-bottom: 0; }
.suggest a:hover { background: var(--c-surface); }
.suggest .price { margin-left: auto; color: var(--c-primary); font-weight: 700; }

.header-actions { display: flex; align-items: center; gap: 6px; }
.head-link {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px;
    border-radius: 10px; color: var(--c-text); text-decoration: none; font-weight: 600; font-size: 14px;
}
.head-link:hover { background: var(--c-surface); text-decoration: none; }
.head-phone {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px;
    border-radius: 10px; color: var(--c-text); text-decoration: none;
    font-weight: 700; font-size: 14px; background: var(--c-surface);
}
.head-phone:hover { background: var(--c-grad); color: #fff; text-decoration: none; }
.footer-socials { display: flex; gap: 12px; margin-top: 6px; }
.footer-socials a { color: var(--c-primary); font-weight: 600; }
.contact-block {
    background: var(--c-surface); border-radius: 12px;
    padding: 18px 22px; margin: 16px 0 24px;
}
.map-wrap iframe { display: block; width: 100%; }
.cart-link { position: relative; }
.cart-badge {
    background: var(--c-grad); color: #fff; font-size: 12px; font-weight: 800;
    border-radius: 999px; padding: 2px 8px; min-width: 22px; text-align: center;
}

/* Иконки-кнопки в шапке (burger, mobile search toggle, drawer close).
   Скрыты на desktop, появляются только когда нужны на мобиле. */
.hdr-icon {
    display: none;
    width: 40px; height: 40px;
    align-items: center; justify-content: center;
    border: 0; background: transparent; color: var(--c-text);
    border-radius: 10px; cursor: pointer; padding: 0;
}
.hdr-icon:hover { background: var(--c-surface); }
.hdr-icon:active { background: var(--c-border); }

/* Развёртывающийся мобильный поиск под топ-баром */
.header-search-mobile {
    padding: 10px 16px 12px;
    border-top: 1px solid var(--c-border);
    background: #fff;
}
.header-search-mobile[hidden] { display: none; }

.loc-pick { position: relative; }
.loc-pick > summary {
    list-style: none; display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.loc-pick > summary::-webkit-details-marker { display: none; }
.loc-pick[open] > summary { background: var(--c-surface); }
.loc-pop {
    position: absolute; right: 0; top: calc(100% + 6px); background: #fff;
    border: 1px solid var(--c-border); border-radius: 14px; box-shadow: var(--shadow);
    padding: 14px; min-width: 240px; z-index: 60;
}
.loc-pop p { font-size: 13px; color: var(--c-muted); margin: 0 0 8px; }
.loc-pop ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.loc-pop button {
    width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--c-border);
    border-radius: 10px; background: #fff; color: var(--c-text); font-weight: 600;
}
.loc-pop button:hover { background: var(--c-surface); }
.loc-pop button.active { background: var(--c-accent-soft); border-color: var(--c-primary); color: var(--c-primary); }

.site-nav { background: var(--c-surface); border-bottom: 1px solid var(--c-border); position: relative; }
.nav-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 20px; align-items: center; }
.nav-row a {
    color: var(--c-text); padding: 8px 12px; border-radius: 8px; font-weight: 600;
    text-decoration: none; white-space: nowrap;
}
.nav-row a:hover { background: #fff; }

/* Выпадашка «Каталог» в шапке (только desktop). */
.nav-dropdown { position: relative; }
.nav-dropdown__toggle {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border: 0; border-radius: 8px; cursor: pointer;
    background: var(--c-grad); color: #fff; font-weight: 700; font-size: 14px;
    white-space: nowrap;
    font-family: inherit;
}
.nav-dropdown__toggle:hover { filter: brightness(1.08); }
.nav-dropdown__toggle[aria-expanded="true"] { background: var(--c-primary-strong); }
.nav-dropdown__chev { transition: transform .15s ease; }
.nav-dropdown__toggle[aria-expanded="true"] .nav-dropdown__chev { transform: rotate(180deg); }
.nav-dropdown__panel {
    position: absolute; left: 0; top: calc(100% + 8px);
    background: #fff; border: 1px solid var(--c-border);
    border-radius: 14px; box-shadow: var(--shadow);
    padding: 10px; min-width: 280px; max-width: 360px; z-index: 70;
}
.nav-dropdown__panel[hidden] { display: none; }
.cat-menu { list-style: none; padding: 0; margin: 0; }
.cat-menu li { padding: 0; }
.cat-menu a {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 10px 14px;
    color: var(--c-text); text-decoration: none; font-weight: 600;
    border-radius: 10px;
}
.cat-menu a:hover { background: var(--c-surface); }
.cat-menu__count {
    color: var(--c-muted); font-weight: 500; font-size: 13px;
    background: var(--c-surface); padding: 2px 8px; border-radius: 999px;
}
.cat-menu a:hover .cat-menu__count { background: #fff; }

/* Меню категорий в drawer: с заголовком, без бокового padding в обёртке. */
.cat-menu--drawer {
    border-top: 1px solid var(--c-border);
    padding: 12px 0 8px;
}
.cat-menu--drawer .cat-menu__title {
    text-transform: uppercase; letter-spacing: .08em;
    font-size: 12px; font-weight: 800;
    color: var(--c-muted);
    padding: 4px 20px 8px;
}
.cat-menu--drawer ul { list-style: none; padding: 0; margin: 0; }
.cat-menu--drawer ul a {
    padding: 12px 20px;
    border-radius: 0;
    border-left: 3px solid transparent;
}
.cat-menu--drawer ul a:hover {
    background: var(--c-surface);
    border-left-color: var(--c-primary);
}

/* ===== Off-canvas drawer (мобильное меню) ===== */
.drawer-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 70;
    opacity: 0;
    transition: opacity .2s ease;
}
.drawer-backdrop:not([hidden]) { opacity: 1; }
.drawer-backdrop[hidden] { display: none; }

.mobile-drawer {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(86vw, 340px);
    background: #fff;
    z-index: 71;
    display: flex; flex-direction: column;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 4px 0 24px rgba(15, 23, 42, .18);
    overflow-y: auto;
}
.mobile-drawer[hidden] { display: none; }
.mobile-drawer.is-open { transform: translateX(0); }
.drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--c-border);
}
.drawer-nav {
    display: flex; flex-direction: column;
    padding: 8px 0;
}
.drawer-nav a {
    display: flex; align-items: center;
    padding: 14px 20px;
    color: var(--c-text); text-decoration: none;
    font-weight: 600; font-size: 16px;
    border-left: 3px solid transparent;
}
.drawer-nav a:hover,
.drawer-nav a:focus { background: var(--c-surface); border-left-color: var(--c-primary); }
.drawer-contacts {
    margin-top: auto;
    padding: 16px 20px 24px;
    border-top: 1px solid var(--c-border);
    background: var(--c-surface);
}
.drawer-phone {
    display: inline-flex; align-items: center; gap: 10px;
    font-weight: 800; font-size: 18px;
    color: var(--c-text); text-decoration: none;
    padding: 10px 14px; background: #fff;
    border: 1px solid var(--c-border-strong); border-radius: 12px;
    width: 100%; justify-content: center;
}
.drawer-phone:hover { background: var(--c-grad); color: #fff; border-color: transparent; }
.drawer-hours {
    margin: 12px 0 0; font-size: 13px; line-height: 1.5;
    color: var(--c-muted); text-align: center;
}

/* Блокировка скролла body когда открыт drawer */
body.has-drawer-open { overflow: hidden; }

/* ============ Хлебные крошки ============ */
.breadcrumbs { padding: 14px 0; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--c-muted); }
.breadcrumbs li:not(:last-child)::after { content: '·'; margin-left: 6px; color: var(--c-border-strong); }
.breadcrumbs a { color: var(--c-muted); }
.breadcrumbs a:hover { color: var(--c-primary); }
.breadcrumbs [aria-current="page"] { color: var(--c-text); font-weight: 600; }

/* ============ Hero ============ */
.hero { background: var(--c-grad); color: #fff; padding: 64px 0; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 800; opacity: .85; }
.hero h1 { color: #fff; font-size: clamp(32px, 5vw, 52px); margin: 12px 0 16px; }
.hero .lead { font-size: clamp(15px, 1.6vw, 18px); max-width: 540px; opacity: .94; }
.hero-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.hero .btn-primary { background: #fff; color: var(--c-primary-strong); box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.hero .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.1); }
.hero-side { position: relative; height: 320px; }
.hero-card {
    position: absolute; border-radius: 20px; background: rgba(255,255,255,.16);
    backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.25);
}
.hero-card-1 { left: 10%; top: 0; width: 50%; height: 60%; }
.hero-card-2 { right: 0; top: 20%; width: 55%; height: 65%; background: rgba(255,255,255,.22); }
.hero-card-3 { left: 0; bottom: 0; width: 70%; height: 35%; background: rgba(255,255,255,.12); }

/* ============ Сетка карточек ============ */
.section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; gap: 12px;
}
.section-link { font-weight: 700; }

.grid-cards {
    display: grid; gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.card {
    background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
    transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--c-border-strong); }
.card-media {
    position: relative; aspect-ratio: 1 / 1; background: var(--c-surface);
    display: block; overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.card-badge {
    position: absolute; top: 10px; left: 10px; background: var(--c-grad); color: #fff;
    padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .04em;
    text-transform: uppercase;
}
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-title {
    font-size: 14px; font-weight: 700; line-height: 1.35; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; min-height: 2.7em;
}
.card-title a { color: var(--c-text); text-decoration: none; }
.card-title a:hover { color: var(--c-primary); }
.card-meta { display: flex; align-items: center; justify-content: space-between; }
.card-price { font-size: 18px; font-weight: 800; color: var(--c-primary-strong); }
.card-btn { width: 100%; }

/* ============ Преимущества ============ */
.advantages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.adv {
    background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow-sm);
}
.adv h3 { color: var(--c-primary-strong); }

/* ============ Каталог ============ */
.catalog-wrap { padding: 24px 0 48px; }
.catalog-head { margin-bottom: 16px; }
.catalog-note { color: var(--c-muted); }
.catalog-filters {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 12px;
    background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
    padding: 16px; margin-bottom: 20px; align-items: end; box-shadow: var(--shadow-sm);
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span {
    font-size: 12px; color: var(--c-muted); font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
}
.field input, .field select, .field textarea {
    height: 44px; padding: 0 14px; border: 1px solid var(--c-border-strong);
    border-radius: 10px; background: #fff; color: var(--c-text); font-size: 15px;
}
.field textarea { height: auto; padding: 12px 14px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(47,111,237,.16);
}
.field-actions { flex-direction: row; gap: 8px; align-items: stretch; }
.field .err { color: var(--c-danger); font-size: 12px; margin-top: 4px; font-weight: 700; }

/* ============ Пагинация ============ */
.pager {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    margin: 28px 0 8px;
}
.pager-info { color: var(--c-muted); font-weight: 600; }
.pager-btn {
    display: inline-flex; height: 40px; padding: 0 16px; align-items: center;
    border: 1px solid var(--c-border-strong); border-radius: 10px; background: #fff;
    color: var(--c-text); text-decoration: none; font-weight: 700;
}
.pager-btn:hover { background: var(--c-surface); text-decoration: none; }

/* ============ Карточка товара ============ */
.product-wrap { padding: 12px 0 40px; }
.product-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; }
.product-gallery {
    margin: 0; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow-sm);
}
.product-gallery img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; }
.product-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 12px; }
.product-thumbs img {
    aspect-ratio: 1 / 1; border: 1px solid var(--c-border); border-radius: 10px;
    object-fit: contain; padding: 6px; background: var(--c-surface);
}
.product-info { display: flex; flex-direction: column; gap: 18px; }
.product-price { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.price-now { font-size: clamp(26px, 3vw, 34px); font-weight: 900; color: var(--c-primary-strong); }
.stock-pill {
    display: inline-flex; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px;
}
.stock-pill.in { background: #dcfce7; color: #166534; }
.stock-pill.out { background: #fee2e2; color: #991b1b; }
.product-desc { color: var(--c-text); font-size: 15px; line-height: 1.65; }
.product-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.product-bullets { padding-left: 20px; color: var(--c-muted); margin: 0; }
.product-bullets li { margin-bottom: 6px; }

/* ============ Корзина ============ */
.cart-wrap { padding: 12px 0 48px; }
.cart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.cart-list { display: grid; gap: 12px; }
.cart-row {
    display: grid;
    grid-template-columns: 96px 1fr auto auto auto;
    gap: 16px; align-items: center;
    background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
    padding: 14px;
}
.cart-img img { width: 96px; height: 96px; object-fit: contain; background: var(--c-surface); border-radius: 12px; }
.cart-main { min-width: 0; }
.cart-name { font-weight: 700; color: var(--c-text); text-decoration: none; display: block; overflow-wrap: anywhere; }
.cart-name:hover { color: var(--c-primary); }
.cart-meta { font-size: 13px; color: var(--c-muted); margin-top: 4px; }
.cart-warn { font-size: 12px; color: var(--c-warning); margin-top: 4px; font-weight: 700; }
.cart-qty { display: inline-flex; align-items: center; border: 1px solid var(--c-border-strong); border-radius: 10px; overflow: hidden; }
.cart-qty input {
    width: 48px; height: 36px; border: 0; text-align: center; font-weight: 700; font-size: 15px;
    background: #fff; color: var(--c-text);
}
.cart-qty input:focus { outline: none; }
.qty-btn { width: 36px; height: 36px; border: 0; background: #fff; color: var(--c-text); font-size: 18px; font-weight: 700; }
.qty-btn:hover { background: var(--c-surface); }
.cart-sum { font-weight: 800; font-size: 16px; color: var(--c-primary-strong); white-space: nowrap; }
.cart-remove {
    width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--c-surface);
    color: var(--c-muted); font-size: 18px; line-height: 1;
}
.cart-remove:hover { background: #fee2e2; color: var(--c-danger); }

.cart-side { position: sticky; top: 90px; align-self: start; display: grid; gap: 12px; }
.cart-total {
    background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow-sm);
}
.cart-total .row { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--c-muted); }
.cart-total .row.big { color: var(--c-text); font-size: 18px; }
.cart-total .row.big strong { font-size: 22px; color: var(--c-primary-strong); }
.cart-total hr { border: 0; border-top: 1px solid var(--c-border); margin: 12px 0; }

/* ============ Checkout ============ */
.checkout-wrap { padding: 12px 0 48px; }
.checkout-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.checkout-main { display: grid; gap: 16px; }
.card-block {
    background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 18px;
    display: grid; gap: 12px;
}
.card-block legend { font-weight: 800; padding: 0 6px; color: var(--c-text); }
.radio { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.radio input { width: 18px; height: 18px; }
.checkout-side { position: sticky; top: 90px; align-self: start; display: grid; gap: 12px; }
.legal { font-size: 12px; color: var(--c-muted); text-align: center; }

.success-wrap { padding: 60px 0; }
.success-card {
    max-width: 560px; margin: 0 auto; text-align: center;
    background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
    padding: 40px 28px; box-shadow: var(--shadow);
}
.success-icon {
    width: 80px; height: 80px; margin: 0 auto 16px; border-radius: 50%;
    background: var(--c-grad); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
}
.success-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ============ Аккаунт ============ */
.account-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 24px 0 48px; }
.account-nav { display: grid; gap: 6px; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 14px; align-content: start; }
.account-nav a, .account-nav .link-btn {
    padding: 10px 12px; border-radius: 10px; color: var(--c-text); text-decoration: none; font-weight: 600;
}
.account-nav a:hover { background: var(--c-surface); text-decoration: none; }
.account-nav a.active { background: var(--c-accent-soft); color: var(--c-primary-strong); }
.account-main { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 24px; }
.profile-list { display: grid; grid-template-columns: 200px 1fr; gap: 8px 24px; margin: 0; }
.profile-list dt { color: var(--c-muted); font-weight: 600; }
.profile-list dd { margin: 0; font-weight: 700; }

.orders-table { width: 100%; border-collapse: collapse; }
.orders-table th, .orders-table td { padding: 12px; border-bottom: 1px solid var(--c-border); text-align: left; }
.orders-table th { color: var(--c-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.status-pill { display: inline-flex; padding: 4px 10px; background: var(--c-accent-soft); color: var(--c-primary-strong); border-radius: 999px; font-size: 12px; font-weight: 700; }

.order-items { display: grid; gap: 8px; margin: 12px 0; }
.order-row {
    display: grid; grid-template-columns: 64px 1fr auto auto; gap: 12px; align-items: center;
    padding: 10px; border: 1px solid var(--c-border); border-radius: 12px;
}
.order-row img { width: 64px; height: 64px; object-fit: contain; background: var(--c-surface); border-radius: 10px; }
.order-total { margin-top: 16px; font-size: 18px; text-align: right; }

/* ============ Авторизация ============ */
.narrow { max-width: 480px; margin: 32px auto; }
.auth-wrap h1 { text-align: center; }
.form-card { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 24px; display: grid; gap: 14px; box-shadow: var(--shadow-sm); }

/* ============ Алерты ============ */
.alert { padding: 12px 16px; border-radius: 12px; border: 1px solid transparent; margin-bottom: 16px; font-weight: 600; }
.alert-error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert-info { background: var(--c-accent-soft); color: var(--c-primary-strong); border-color: #c7d4f5; }

.empty {
    padding: 32px; text-align: center; color: var(--c-muted);
    border: 1px dashed var(--c-border-strong); border-radius: var(--radius); background: #fff;
}
.error-wrap { padding: 80px 0; text-align: center; }
.error-actions { display: flex; gap: 12px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* ---- Страницы 404 / 500 -------------------------------------- */
.error-page { padding: 48px 0 64px; }
.error-hero { max-width: 720px; margin: 0 auto; text-align: center; }
.error-code {
    font-size: clamp(96px, 18vw, 184px);
    font-weight: 800;
    line-height: 1;
    margin: 0;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--c-accent, #2f6fed) 0%, #6c4cff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    user-select: none;
}
.error-code--warn {
    background: linear-gradient(135deg, #ef5350 0%, #ff9800 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.error-title {
    font-size: clamp(22px, 3vw, 32px);
    margin: 8px 0 12px;
    font-weight: 700;
    color: var(--c-text);
}
.error-lead {
    color: var(--c-muted);
    line-height: 1.6;
    max-width: 560px;
    margin: 0 auto 24px;
    font-size: 16px;
}
.error-search {
    display: flex;
    gap: 8px;
    max-width: 480px;
    margin: 0 auto 20px;
}
.error-search input[type="search"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius);
    background: #fff;
    color: var(--c-text);
    font-size: 16px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.error-search input[type="search"]:focus {
    border-color: var(--c-accent, #2f6fed);
    box-shadow: 0 0 0 3px rgba(47, 111, 237, .15);
}
.error-search .btn { white-space: nowrap; }
.error-phone-hint {
    margin-top: 20px;
    color: var(--c-muted);
    font-size: 14px;
}
.error-phone-hint a {
    color: var(--c-text);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dotted var(--c-border-strong);
}
.error-block {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--c-border);
}
.error-block-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--c-text);
    text-align: center;
}
@media (max-width: 480px) {
    .error-search { flex-direction: column; }
    .error-search .btn { width: 100%; }
}

.static-page { padding: 24px 0 48px; max-width: 800px; }
.static-page p, .static-page li { color: var(--c-text); line-height: 1.7; }

/* ============ Подвал ============ */
.site-footer { background: var(--c-surface); border-top: 1px solid var(--c-border); margin-top: 60px; padding: 36px 0 16px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 24px; }
.footer-grid h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); margin-bottom: 12px; }
.footer-grid nav a { display: block; padding: 4px 0; color: var(--c-text); text-decoration: none; }
.footer-grid nav a:hover { color: var(--c-primary); }
.footer-note { color: var(--c-muted); font-size: 14px; max-width: 320px; }
.footer-bottom {
    display: flex; justify-content: space-between; gap: 12px; padding-top: 16px; margin-top: 24px;
    border-top: 1px solid var(--c-border); color: var(--c-muted); font-size: 13px; flex-wrap: wrap;
}

/* ===========================================================
   АДАПТИВ
   =========================================================== */

@media (max-width: 1199px) {
    .grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 991px) {
    /* Шапка: бургер + лого + actions. Десктоп-поиск и горизонтальное меню скрыты. */
    .header-top {
        grid-template-columns: auto 1fr auto;
        gap: 10px;
        padding: 10px 16px;
    }
    .hdr-burger { display: inline-flex; }
    .hdr-search-toggle { display: inline-flex; }
    .header-search--desktop { display: none; }
    .site-nav--desktop { display: none; }
    .header-actions { gap: 2px; }
    .head-link span,
    .head-phone span { display: none; }
    .head-phone { padding: 8px; }
    /* «Войти»/«Кабинет» и корзина превращаются в квадратные иконки */
    .header-actions .head-link {
        width: 40px; height: 40px;
        padding: 0;
        justify-content: center;
    }
    .cart-badge {
        position: absolute; top: 2px; right: 2px;
        padding: 1px 5px; min-width: 18px;
        font-size: 10px;
    }
    .hero { padding: 40px 0; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-side { display: none; }
    /* Воздух между hero и первой секцией, чтобы заголовок не «лип» к синему фону. */
    .section { padding: 32px 0 28px; }
    .product-grid { grid-template-columns: 1fr; }
    .cart-grid { grid-template-columns: 1fr; }
    .checkout-grid { grid-template-columns: 1fr; }
    .cart-side, .checkout-side { position: static; }
    .account-wrap { grid-template-columns: 1fr; }
    .catalog-filters { grid-template-columns: 1fr 1fr; }
    .catalog-filters .field-actions { grid-column: 1 / -1; }
    .advantages { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .card-body { padding: 12px; }
    .card-title { font-size: 13px; min-height: 0; }
    .card-price { font-size: 16px; }
    .brand-text { font-size: 15px; }
    .brand-mark { width: 36px; height: 36px; font-size: 12px; }
    .cart-row {
        grid-template-columns: 72px 1fr auto;
        grid-template-areas:
            "img main main"
            "img qty sum"
            "img remove remove";
        gap: 8px;
    }
    .cart-img { grid-area: img; }
    .cart-img img { width: 72px; height: 72px; }
    .cart-main { grid-area: main; }
    .cart-qty { grid-area: qty; }
    .cart-sum { grid-area: sum; text-align: right; }
    .cart-remove { grid-area: remove; justify-self: end; }
    .product-actions .btn { flex: 1 1 100%; }
    .container { padding: 0 16px; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    .orders-table thead { display: none; }
    .orders-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px; border: 1px solid var(--c-border); border-radius: 12px; margin-bottom: 8px; }
    .orders-table td { border: 0; padding: 0; }
    .orders-table td:nth-child(5) { grid-column: 1 / -1; }
}

@media (max-width: 479px) {
    h1 { font-size: 22px; }
    .hero h1 { font-size: 28px; }
    .grid-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .catalog-filters { grid-template-columns: 1fr; }
    .product-gallery { padding: 12px; }
    .product-thumbs { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
    /* На очень узких экранах прячем «Войти» из шапки — дублируется в drawer. */
    .header-actions .head-link:not(.cart-link) { display: none; }
    .brand-text { font-size: 14px; }
    .header-top { padding: 8px 12px; gap: 6px; }
}
