/* public/css/site.css: шрифт, база, кнопки, hero, хедер, панели, футер */
@font-face {
    font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url("/fonts/montserrat-cyrillic-wght-normal.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url("/fonts/montserrat-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.is-locked { overflow: hidden; }
body {
    margin: 0; background: var(--c-bg, #fff); color: var(--c-text, #111);
    font-family: Montserrat, Arial, sans-serif;
    line-height: 1.5; -webkit-font-smoothing: antialiased;
    --h-bg: var(--c-bg, #fff);      /* фон мобильного хедера, поиска и бургер-меню */
    --h-text: var(--c-text, #111);  /* текст на мобиле и в этих панелях */
    --h-desk: #fff;                 /* текст прозрачного десктопного хедера */
    --accent: #94a0bb;
}
body.tone-dark { --h-bg: #fff; --h-text: #111; --h-desk: #111; }
button, input, textarea, select { font-family: inherit; }
a { color: inherit; }
img, video, iframe { max-width: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- Кнопка-капсула ---- */
.btn-capsule {
    display: inline-block; padding: 14px 32px; border-radius: 999px;
    border: 1px solid var(--c-text); background: var(--c-text); color: var(--c-bg);
    font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; transition: opacity .2s, background .2s;
}
.btn-capsule:hover { opacity: .85; }
.btn-capsule:disabled { opacity: .5; cursor: default; }

/* ---- Hero ---- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 520px; overflow: hidden; color: #fff; background: #14161a; }
.hero-media, .hero-overlay { position: absolute; inset: 0; }
.hero-media img, .hero-media video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* поверх медиа: overlay, а поверх него градиент цвета gradient сверху вниз (от 40% до 0%) */
.hero-overlay { background: var(--c-overlay, rgba(0, 0, 0, .4)); }
.hero-overlay::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to bottom, rgba(var(--c-gradient-rgb, 0, 0, 0), .4), rgba(var(--c-gradient-rgb, 0, 0, 0), 0));
}

.hero-circle {
    position: absolute; left: 50%; top: 50%; z-index: 2; aspect-ratio: 1; border-radius: 50%;
    border: .5px solid rgba(190, 190, 190, .4); background: rgba(255, 255, 255, .04);
    -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
    transform: translate(-50%, -50%) scale(var(--s, 1)); will-change: transform; pointer-events: none;
}
.hero-circle--outer { width: calc(min(84vmin, 860px) - 14px); }
.hero-circle--inner { width: calc(min(62vmin, 640px) - 14px); }

.hero-content { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; }
.hero-text { display: flex; flex-direction: column; align-items: center; gap: 30px; width: min(45vmin, 450px); text-align: center; color: #fff; }
.hero-company { margin: 0; font-size: 12px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; }
.hero-title { margin: 0; font-size: 28px; font-weight: 300; line-height: 1.15; letter-spacing: .03em; text-transform: uppercase; }
.hero-intro { margin: 0; font-size: 14px; font-weight: 400; line-height: 1.2; }

/* кнопка: только рамка, по ховеру белая с текстом цвета background */
.hero .btn-capsule {
    margin-top: 6px; padding: 12px 28px; font-size: 12px; font-weight: 500; text-transform: uppercase;
    color: #fff; background: transparent; border: 1px solid #fff;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    transition: background .2s, color .2s, border-color .2s;
}
.hero .btn-capsule:hover { background: #fff; color: var(--c-bg); border-color: #fff; opacity: 1; }

@media (max-width: 720px) {
    .hero-circle--outer { width: calc(min(96vw, 520px) - 14px); }
    .hero-circle--inner { width: calc(min(78vw, 420px) - 14px); }
    .hero-text { gap: 30px; width: min(52vw, 300px); }
    /* на мобильном кнопка выносится из круга в нижнюю часть hero */
    .hero-cta {
        position: absolute; left: 50%; bottom: max(28px, env(safe-area-inset-bottom));
        transform: translateX(-50%); margin-top: 0; white-space: nowrap;
    }
}
@media (max-width: 360px) {
    .hero-title { font-size: 24px; }
}

/* ---- Хедер ---- */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 50; color: var(--h-desk); }
.site-header-bar { display: flex; align-items: center; gap: 24px; height: 78px; padding: 0 clamp(16px, 2.5vw, 40px); }
.site-logo { font-size: 18px; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.site-nav { display: flex; flex-wrap: nowrap; gap: 0 25px; margin: 0 auto; }
.site-nav a { font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; white-space: nowrap; opacity: .92; }
.site-nav a:hover { opacity: 1; }
.site-nav a.active { opacity: 1; text-decoration: underline; text-underline-offset: 6px; }
.site-phone { font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.site-actions { display: flex; align-items: center; }

.hbtn {
    position: relative; display: grid; place-items: center; width: 30px; height: 36px; padding: 0;
    border: 0; background: none; color: inherit; cursor: pointer;
}
.hbtn svg { width: 22px; height: 22px; }
.badge {
    position: absolute; right: -3px; bottom: 3px; min-width: 15px; height: 15px; padding: 0 3px;
    border-radius: 999px; background: var(--accent); color: #0a1020;
    font-size: 9px; font-weight: 600; line-height: 15px; text-align: center;
}
.badge[hidden] { display: none; }
.site-burger { display: none; }
.site-burger svg { width: 26px; height: 26px; stroke-width: 2; }

@media (max-width: 1024px) {
    .site-header { color: var(--h-text); background: var(--h-bg); }
    .site-header-bar { height: 60px; gap: 6px; padding: 0 12px; }
    .site-burger { display: grid; width: 36px; margin-right: auto; }
    .site-nav, .site-phone { display: none; }
    .site-logo { font-size: 24px; margin-right: 4px; }
}
@media (max-width: 360px) {
    .site-logo { font-size: 20px; }
}

/* ---- Затемнение и панели ---- */
.site-overlay {
    position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .6);
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s;
}
.site-overlay.is-open { opacity: 1; visibility: visible; transition: opacity .3s; }

.panel-box {
    position: fixed; z-index: 80; background: var(--h-bg); color: var(--h-text);
    visibility: hidden; transition: transform .32s ease, opacity .32s ease, visibility 0s .32s;
}
.panel-box.is-open { visibility: visible; transition: transform .32s ease, opacity .32s ease; }

/* логин, избранное и корзина: белый фон на всех страницах */
#panel-login, #panel-favorites, #panel-cart { background: #fff; color: #111; }
/* на белых панелях приглушённые цвета и линии тёмные независимо от фона сайта */
#panel-login, #panel-favorites, #panel-cart, body.tone-dark .panel-box {
    --c-muted: rgba(17, 17, 17, .62); --c-line: rgba(17, 17, 17, .18);
}

.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 14px 24px; }
.panel-title { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.panel-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.panel-close svg { width: 26px; height: 26px; }
.panel-empty { margin: 0; padding: 8px 24px 32px; font-size: 14px; color: var(--c-muted); }

/* поиск: узкая панель сверху (белая только на /catalog/all, иначе фон сайта) */
.panel-search { top: 0; left: 0; right: 0; transform: translateY(-100%); }
.panel-search.is-open { transform: none; }
.search-form { display: flex; align-items: center; gap: 8px; max-width: 900px; margin: 0 auto; padding: 18px clamp(16px, 3vw, 40px); }
.search-form input {
    flex: 1; min-width: 0; padding: 10px 0; font: inherit; font-size: 16px; color: inherit;
    background: transparent; border: 0; border-bottom: 1px solid var(--c-line, rgba(0, 0, 0, .2)); outline: none;
}
.search-form input:focus { border-bottom-color: currentColor; }
.search-form input::placeholder { color: var(--c-muted); }
.search-form .hbtn { width: 44px; height: 44px; }

/* боковые панели: меню слева, избранное справа */
.panel-drawer { top: 0; bottom: 0; display: flex; flex-direction: column; overflow-y: auto; }
.panel-drawer--left { left: 0; width: min(83vw, 420px); transform: translateX(-100%); }
.panel-drawer--right { right: 0; width: min(92vw, 440px); transform: translateX(100%); }
.panel-drawer.is-open { transform: none; }
.panel-drawer--left .panel-head { justify-content: flex-end; }

.menu-nav { display: flex; flex-direction: column; gap: 36px; padding: 24px 24px 8px; }
.menu-nav a { font-size: 20px; line-height: 1.2; text-decoration: none; }
.menu-nav a.active { font-weight: 600; }
.menu-bottom { margin-top: auto; padding: 32px 24px 36px; }
.menu-phone { display: block; margin-bottom: 20px; font-size: 16px; font-weight: 500; color: var(--accent); text-decoration: none; }
.menu-social { display: flex; gap: 14px; }
.round { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; }
.round svg { width: 20px; height: 20px; }

/* попапы: логин и корзина */
.panel-modal {
    top: 50%; left: 50%; width: min(92vw, 440px); max-height: 90vh; overflow-y: auto;
    border-radius: 16px; opacity: 0; transform: translate(-50%, -46%);
}
.panel-modal.is-open { opacity: 1; transform: translate(-50%, -50%); }

/* ---- Футер ---- */
.site-footer {
    --pad: clamp(16px, 2vw, 32px);
    --f-head-h: 18px;     /* высота строки заголовка колонки и названия компании */
    --f-head-gap: 14px;   /* отступ от заголовка до первой строки */
    background: var(--c-bg); border-top: 1px solid var(--c-line);
    color: var(--c-additional, var(--c-muted)); font-size: 12px; line-height: 1.5;
}
.site-footer a { color: inherit; text-decoration: none; transition: color .2s; }
.site-footer a:hover { color: var(--c-text); }
.site-footer-main { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; padding: 72px var(--pad) 56px; }

/* название компании и заголовки колонок: цвет основного текста, остальное цвет additional */
.site-footer .footer-logo {
    display: block; width: fit-content; margin: 0 0 var(--f-head-gap);
    font-size: 17px; line-height: var(--f-head-h); font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
    color: var(--c-text);
}
.footer-col h4 {
    margin: 0 0 var(--f-head-gap); font-size: 12px; line-height: var(--f-head-h);
    font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--c-text);
}
.footer-brand p { max-width: 300px; margin: 0; }
.footer-list { margin: 0; padding: 0; list-style: none; }
.footer-list li { margin: 0 0 4px; }
.footer-company { margin: 20px 0 0; }
.footer-rich p { margin: 0; }

.site-footer-bottom {
    display: grid; grid-template-columns: 1fr auto; grid-template-areas: "legal social";
    gap: 12px 24px; padding: 26px var(--pad) 40px; border-top: 1px solid var(--c-line);
}
.footer-legal { grid-area: legal; display: flex; flex-direction: column; gap: 4px; }
.footer-social { grid-area: social; display: flex; justify-content: flex-end; gap: 32px; text-transform: uppercase; }
.footer-dev { text-transform: none; }
.footer-dev a { text-decoration: underline !important; }

@media (max-width: 720px) {
    .site-footer-main { grid-template-columns: 1fr 1fr; padding-top: 48px; }
    .footer-brand, .footer-col--contacts { grid-column: 1 / -1; }
    .site-footer-bottom { grid-template-columns: 1fr; grid-template-areas: "social" "legal"; }
    .footer-social { justify-content: flex-start; flex-wrap: wrap; gap: 12px 24px; }
    .footer-dev { flex-basis: 100%; }
}

/* ---- Избранное: список в панели ---- */
.fav-list { margin: 0; padding: 0 24px 32px; list-style: none; }
.fav-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto 26px; gap: 8px 16px; align-items: start; padding: 22px 0; }
.fav-item + .fav-item { border-top: 1px solid var(--c-line, rgba(17, 17, 17, .18)); }
.fav-thumb { display: block; width: 72px; height: 72px; overflow: hidden; border: 1px solid #e5e5e5; border-radius: 8px; background: #f3f3f3; }
.fav-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fav-name { font-size: 16px; font-weight: 600; line-height: 1.3; color: inherit; text-decoration: none; }
.fav-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.fav-meta { margin: 6px 0 0; font-size: 12px; line-height: 1.3; color: var(--c-muted); }
.fav-price { margin: 0; padding-top: 2px; font-size: 15px; font-weight: 300; white-space: nowrap; }
.fav-remove { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; background: none; color: #8d8d8d; cursor: pointer; transition: color .2s; }
.fav-remove svg { width: 26px; height: 26px; }
.fav-remove:hover { color: #111; }
.fav-remove:disabled { opacity: .4; cursor: default; }

/* ---- Плашка-уведомление (товар добавлен в корзину / избранное) ---- */
.site-toast {
    position: fixed; z-index: 95; top: 92px; right: max(16px, env(safe-area-inset-right));
    width: min(360px, calc(100vw - 32px)); padding: 24px 56px 24px 28px; border-radius: 14px;
    background: #111; color: #fff; font: 400 16px/1.3 Arial, Helvetica, sans-serif;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .25);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .25s, transform .25s, visibility 0s .25s;
}
.site-toast.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .25s; }
.site-toast-text { margin: 0; }
.site-toast-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; background: none; color: #fff; opacity: .85; cursor: pointer; }
.site-toast-close:hover { opacity: 1; }
.site-toast-close svg { width: 14px; height: 14px; }
.site-toast-qty { display: inline-flex; align-items: center; margin-top: 16px; border: 1px solid rgba(255, 255, 255, .4); border-radius: 999px; }
.site-toast-qty button { width: 38px; height: 36px; padding: 0; border: 0; background: none; color: #fff; font: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.site-toast-qty button:disabled { opacity: .35; cursor: default; }
.site-toast-qty span { min-width: 34px; text-align: center; font-size: 16px; }
@media (max-width: 1024px) { .site-toast { top: 72px; } }
@media (prefers-reduced-motion: reduce) { .site-toast { transition: none; } }


/* ---- Плавный переход между страницами: белая пелена (page-fade.js добавляет html.is-leaving) ---- */
html::after {
    content: ""; position: fixed; inset: 0; z-index: 99999; background: #fff; pointer-events: none;
    opacity: 0; animation: page-in .5s ease-out both;
}
html.is-leaving::after { pointer-events: auto; animation: page-out .3s ease-in both; }   /* .3s = OUT_MS в page-fade.js */
@keyframes page-in  { from { opacity: 1; } to { opacity: 0; } }
@keyframes page-out { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    html::after, html.is-leaving::after { animation: none; }
}

.lang-switch { display: inline-flex; align-items: top; gap: .45em; }
.lang-switch i { font-style: normal; opacity: .5; }
.lang-switch a { opacity: .65; }
.lang-switch a.active, .lang-switch a:hover { opacity: 1; }
.menu-nav .lang-switch { display: flex; margin-top: 24px; }


/* ---- Подменю хедера ---- */
.site-nav-item { position: relative; display: flex; align-items: top; }
.site-sub-toggle { display: none; place-items: center; width: 18px; height: 18px; margin-left: 4px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.site-sub-toggle svg { width: 14px; height: 14px; transition: transform .2s; }
.site-sub { position: absolute; top: 100%; left: 50%; min-width: 220px; padding-top: 22px; transform: translateX(-50%); opacity: 0; visibility: hidden; transition: opacity .18s, visibility .18s; }
.site-sub-box { display: flex; flex-direction: column; padding: 10px 0; background: var(--h-bg); color: var(--h-text); box-shadow: 0 12px 32px rgba(0, 0, 0, .14); }
.site-sub-box a { padding: 10px 22px; }
.site-nav .site-sub-box a:hover { background: rgba(0, 0, 0, .05); }
.site-nav-item.is-open .site-sub { opacity: 1; visibility: visible; }
.site-nav-item.is-open .site-sub-toggle svg { transform: rotate(180deg); }
@media (hover: hover) {
    .site-nav-item:hover .site-sub, .site-nav-item:focus-within .site-sub { opacity: 1; visibility: visible; }
}
@media (hover: none) {
    .site-sub-toggle { display: grid; }   /* планшеты и тач-экраны шире 1024px: раскрытие по тапу на стрелку */
}

.menu-item-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.menu-sub-toggle { display: grid; place-items: center; width: 36px; height: 36px; margin: -8px -8px -8px 0; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.menu-sub-toggle svg { width: 20px; height: 20px; transition: transform .2s; }
.menu-sub { display: none; flex-direction: column; gap: 18px; padding: 20px 0 4px 16px; }
.menu-nav .menu-sub a { font-size: 16px; opacity: .8; }
.menu-nav .menu-sub a.active { opacity: 1; }
.menu-item.is-open > .menu-sub { display: flex; }
.menu-item.is-open .menu-sub-toggle svg { transform: rotate(180deg); }