/* ============================================================
   Home / Catalog page — BaldaiBóbek
   Figma: node 9:445 (Главная)
   Секции: hero (520h) + toolbar (title+counter+filters+sort+chips)
           + product grid (5 col × N rows, gap 24)
   ============================================================ */

/* Shared page container */
.kt-page {
    max-width: var(--container-max);
    margin: 0 auto;
    width: 100%;
    background: var(--color-bg);
}

.kt-page__inner {
    max-width: var(--container-content);
    margin: 0 auto;
    padding: 0 var(--container-gutter);
}

/* ─────────── HERO SLIDER ─────────── */
/* Figma: node 10:699 — 1440×520, слайды кроссфейдятся, 5 точек снизу.
   Сам hero растягивается на всю ширину viewport'а (выламывается из .kt-page max-w 1440),
   а контент (заголовок/cta/dots) центрируется по container-content и оставляет 40px gutter. */
.kt-hero {
    position: relative;
    height: 520px;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    overflow: hidden;
    background: #f7f1ea;
}

/* Slide stack (absolutely positioned, крест-фейд по opacity) */
.kt-hero__slides {
    position: absolute;
    inset: 0;
}

.kt-hero__slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-8) 0;       /* верт. 40px; горизонтальный gutter — на контенте */
    background: #f7f1ea center center / cover no-repeat;
    opacity: 0;
    transition: opacity var(--duration-slow) var(--ease-standard);
    pointer-events: none;
}

.kt-hero__slide.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.kt-hero__content {
    max-width: var(--container-content);   /* 1360 */
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--container-gutter);    /* 40px */
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    animation: kt-hero-content-in var(--duration-slow) var(--ease-emphasized);
}

.kt-hero__cta {
    align-self: flex-start;
}

@keyframes kt-hero-content-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Dots (кликабельные индикаторы) */
/* Figma: node 10:732 (bottom, y=512), 88×8, x=40 от левого края контейнера контента */
.kt-hero__dots {
    position: absolute;
    /* Совмещаем с горизонтальным gutter контента: на узких viewport'ах = 40px,
       на >1440 — расстояние от viewport-левой грани до начала container-content. */
    left: max(var(--space-8), calc((100vw - var(--container-content)) / 2 + var(--space-8)));
    display: flex;
    gap: var(--space-2);
    align-items: center;
    z-index: 2;
    background: none;
    padding: 0;
    border: none;
}

.kt-hero__dots--top    { display: none; }  /* Верхний ряд убран — одна пагинация снизу */
.kt-hero__dots--bottom { bottom: var(--space-8); }

.kt-hero__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: none;
    border-radius: 50%;
    /* Контрастно на любом фоне: тёмная заливка + белая обводка */
    background: rgba(17, 17, 17, 0.35);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition:
        width var(--duration-base) var(--ease-standard),
        background-color var(--duration-base) var(--ease-standard),
        box-shadow var(--duration-base) var(--ease-standard);
}

.kt-hero__dot:hover { background: rgba(17, 17, 17, 0.6); }

.kt-hero__dot.is-active {
    width: 24px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.kt-hero__dot:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.kt-hero__title {
    font-family: var(--font-sans);
    font-weight: var(--font-weight-extrabold);
    font-size: var(--font-size-5xl);   /* 56 */
    line-height: 1;
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-text);
    margin: 0;
}

.kt-hero__subtitle {
    font-family: var(--font-sans);
    font-size: var(--font-size-lg);    /* 18 */
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-base);
    letter-spacing: var(--letter-spacing-wide);
    color: var(--color-text);
    opacity: 0.5;
    margin: 0;
    max-width: 540px;
}

/* ─────────── CATALOG TOOLBAR ─────────── */
/* Figma home: node 12:1449 — Frame 145 padding-top 80, header 137h, gap до сетки 40.
   Figma catalog page: node 48:1928 — Frame 145 padding-top 40 (без hero). */
.kt-catalog {
    padding: 80px 0;
}

/* Страница каталога (без hero) — меньше отступ сверху */
.kt-catalog--flush {
    padding-top: 40px;
}

.kt-catalog__toolbar {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);     /* 24 — между header-row и чипами */
    margin-bottom: var(--space-8);  /* 40 — до сетки */
}

.kt-catalog__head {
    display: flex;
    align-items: flex-end;   /* Title-блок 73h и actions 46h выровнены по нижнему краю (Figma) */
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.kt-catalog__title {
    font-family: var(--font-sans);
    font-weight: var(--font-weight-extrabold);
    font-size: var(--font-size-4xl);    /* 40 */
    line-height: 1;
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-text);
    margin: 0 0 var(--space-2);
}

.kt-catalog__counter {
    font-family: var(--font-sans);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--letter-spacing-wide);
    color: var(--color-text);
    opacity: 0.5;
    margin: 0;
}

.kt-catalog__actions {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    flex-wrap: wrap;
}

.kt-catalog__chips {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* ─────────── PRODUCT GRID ─────────── */
/* Figma: 1360/5 = 272 cell, col-gap 24, row-gap 40, card 252.8×426.6.
   minmax(0, 1fr) нужен чтобы nowrap-контент в кнопках не распирал колонку
   (иначе при узком контейнере 5-я карточка уходит за границу). */
.kt-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: var(--space-6);
    row-gap: var(--space-8);
    margin-bottom: var(--space-9);
    align-items: stretch;   /* все карточки одинаковой высоты */
}
.kt-grid > * { min-width: 0; }

@media (max-width: 1200px) {
    .kt-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .kt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .kt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
}

/* Loading indicator (node 12:1442) */
.kt-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
    padding: var(--space-8) 0;
    color: var(--color-primary);
    font-family: var(--font-sans);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-wide);
}

.kt-loading__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(224, 69, 90, 0.15);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: kt-spin 0.8s linear infinite;
}

@keyframes kt-spin {
    to { transform: rotate(360deg); }
}

/* ─────────── Mobile search (появляется в тулбаре на mobile) ─────────── */
/* Figma: node 30:1123 — 343×48, bg #efefef, icon left + placeholder */
.kt-catalog__mobile-search { display: none; }

@media (max-width: 768px) {
    /* ── HERO ── */
    /* Figma: 375×402, уменьшенные паддинги */
    .kt-hero {
        height: 402px;
    }
    .kt-hero__slide {
        padding: var(--space-5) 0;
        background-position: center bottom;
    }
    .kt-hero__title { font-size: 28px; line-height: 1.1; }
    .kt-hero__subtitle { font-size: var(--font-size-sm); max-width: 100%; }
    /* На мобиле контент и каталог выравниваются по ЛЕВОМУ краю хедера (16px). */
    .kt-hero__content {
        gap: var(--space-4);
        padding: 0 var(--space-4);
    }
    .kt-hero__dots--top { display: none; }
    .kt-hero__dots--bottom {
        left: var(--space-4);
        bottom: var(--space-4);
        transform: none;
    }

    /* ── CATALOG toolbar ── */
    .kt-page__inner { padding: 0 var(--space-4); }
    .kt-catalog { padding: var(--space-5) 0; }
    .kt-catalog__toolbar { gap: var(--space-4); margin-bottom: var(--space-5); }

    .kt-catalog__head {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }
    .kt-catalog__title { font-size: 24px; }
    .kt-catalog__counter { font-size: var(--font-size-sm); }

    /* Search bar встроенный в тулбар — только на мобиле */
    .kt-catalog__mobile-search {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        width: 100%;
        height: 48px;
        padding: 0 var(--space-5);
        background: var(--color-neutral-100);
        border-radius: var(--radius-md);
    }
    .kt-catalog__mobile-search svg {
        width: 22px;
        height: 22px;
        opacity: 0.5;
        flex-shrink: 0;
    }
    .kt-catalog__mobile-search input {
        flex: 1;
        border: none;
        outline: none;
        background: transparent;
        font: var(--font-weight-semibold) var(--font-size-sm)/1 var(--font-sans);
        letter-spacing: var(--letter-spacing-wide);
        color: var(--color-text);
    }
    .kt-catalog__mobile-search input::placeholder { color: var(--color-text); opacity: 0.5; }

    /* Горизонтальный скролл фильтров и чипов */
    .kt-catalog__actions,
    .kt-catalog__chips {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    .kt-catalog__actions::-webkit-scrollbar,
    .kt-catalog__chips::-webkit-scrollbar { display: none; }
    .kt-catalog__actions .btn,
    .kt-catalog__chips .btn { flex-shrink: 0; }

    /* На мобиле скрываем "Сбросить фильтр" — по макету его нет */
    .kt-catalog__actions #catalogReset { display: none; }

    /* ── GRID: 3 колонки (по макету) — на планшете/большом телефоне ── */
    .kt-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--space-4);
        margin-bottom: var(--space-6);
    }
}

/* На мобиле 3 колонки (по дизайну) — текст в карточке уменьшен в product-card.css */

/* ─── Секции главной (закреплённые + по категориям) ─── */
.kt-cat-section {
    margin-top: var(--space-8);
}
.kt-cat-section:first-child {
    margin-top: var(--space-6);
}
.kt-cat-section__title {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    margin: 0 0 var(--space-5);
    font-family: var(--font-display, var(--font-sans));
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
}
.kt-cat-section__title a {
    color: inherit;
    text-decoration: none;
    transition: color .15s;
}
.kt-cat-section__title a:hover {
    color: var(--color-primary);
}
.kt-cat-section__count {
    font-size: 14px;
    font-weight: 500;
    color: var(--grey-400, #9ca3af);
}
.kt-grid--pinned {
    margin-bottom: var(--space-6);
}
@media (max-width: 768px) {
    .kt-cat-section { margin-top: var(--space-6); }
    .kt-cat-section__title { font-size: 18px; margin-bottom: var(--space-4); }
}

@media (max-width: 380px) {
    .kt-grid { gap: var(--space-3); }
}

/* ============================================================
   BaldaiBóbek — РОЗНИЧНАЯ главная по макету (BaldaiBobek.html).
   Переопределяет hero (контейнерная карточка) и добавляет ленты:
   преимущества · категории · промо · доверие.
   Бренд-цвета — через токены; локальные поверхности макета — ниже.
   ============================================================ */
:root {
    --home-hero-bg:   #fce9e6;
    --home-gray-bg:   #f5f5f7;
    --home-cream:     #faece1;
    --home-pink:      #f9d9d4;
    --home-card-bd:   #ececef;
    --home-radius:    14px;
    --home-radius-lg: 22px;
}

/* ─── HERO: контейнерная скруглённая карточка вместо full-bleed ─── */
.kt-hero {
    width: min(var(--container-content), calc(100% - 2 * var(--container-gutter)));
    max-width: none;
    margin: var(--space-6) auto 0;
    margin-left: auto;
    height: auto;
    min-height: 420px;
    border-radius: var(--home-radius-lg);
    background: var(--home-hero-bg);
}
.kt-hero__slide { padding: 56px 0; }
.kt-hero__content {
    max-width: 640px;
    margin: 0 auto 0 0;
    padding: 0 56px;
    align-items: flex-start;
    text-align: left;
}
.kt-hero__title {
    font-family: var(--font-display);
    font-size: clamp(30px, 3.6vw, 46px);
    line-height: 1.07;
}
.kt-hero__subtitle { opacity: 0.72; max-width: 460px; }
.kt-hero__dots--bottom { left: 50%; transform: translateX(-50%); }

/* ─── Section head (заголовок + «Смотреть все») ─── */
.kt-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 22px;
}
.kt-section-head__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(22px, 2.4vw, 28px);
    letter-spacing: -0.01em;
    color: var(--color-text);
    margin: 0;
}
.kt-section-head__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 14px;
    transition: gap var(--duration-base) var(--ease-standard);
}
.kt-section-head__more:hover { gap: 10px; }
.kt-section-head__more svg { stroke: currentColor; fill: none; }

/* ─── FEATURE STRIP ─── */
.kt-feats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 28px 0 40px;
}
.kt-feat {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--home-gray-bg);
    border-radius: var(--home-radius);
    padding: 18px 20px;
    transition: background var(--duration-base) var(--ease-standard);
}
.kt-feat:hover { background: #efeff2; }
.kt-feat__ic {
    flex-shrink: 0;
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border: 1.5px solid var(--color-primary);
    border-radius: 50%;
    color: var(--color-primary);
}
.kt-feat__ic svg { stroke: currentColor; fill: none; }
.kt-feat__txt { font-size: 13px; font-weight: 500; line-height: 1.3; color: var(--color-text); }

/* ─── POPULAR CATEGORIES ─── */
.kt-cats { margin: 6px 0 40px; }
.kt-cats__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 14px;
}
.kt-cat { display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.kt-cat__photo {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--home-radius);
    background: var(--home-gray-bg);
    overflow: hidden;
    transition: transform var(--duration-base) var(--ease-standard),
                box-shadow var(--duration-base) var(--ease-standard);
}
.kt-cat:hover .kt-cat__photo {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(60, 30, 40, 0.10);
}
.kt-cat__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kt-cat__name { font-size: 13.5px; font-weight: 500; text-align: center; color: var(--color-text); }

/* ─── PROMO BANNERS ─── */
.kt-promos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 0 0 40px;
}
.kt-promo {
    display: flex;
    align-items: center;
    min-height: 200px;
    padding: 30px 34px;
    border-radius: var(--home-radius-lg);
    overflow: hidden;
    transition: transform var(--duration-base) var(--ease-standard);
}
.kt-promo:hover { transform: translateY(-2px); }
.kt-promo--pink  { background: var(--home-pink); }
.kt-promo--cream { background: var(--home-cream); }
.kt-promo__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(22px, 2.4vw, 28px);
    line-height: 1.1;
    color: var(--color-primary);
    margin: 0 0 12px;
}
.kt-promo__text { font-size: 14px; color: rgba(17,17,17,0.62); margin: 0 0 18px; line-height: 1.45; }
.kt-promo__btn { pointer-events: none; }

/* ─── NEW ARRIVALS ─── */
.kt-new { margin: 0 0 36px; }

/* ─── TRUST STRIP ─── */
.kt-trust {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    background: var(--home-gray-bg);
    border-radius: var(--home-radius);
    padding: 18px 12px;
    margin: 8px 0 48px;
}
.kt-trust__item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    color: var(--color-text);
    padding: 0 12px;
    border-right: 1px solid #e4e4e8;
}
.kt-trust__item:last-child { border-right: 0; }
.kt-trust__ic { flex-shrink: 0; color: var(--color-primary); }
.kt-trust__ic svg { stroke: currentColor; fill: none; }

/* ─── RESPONSIVE (макет: 1080 / 640) ─── */
@media (max-width: 1080px) {
    .kt-hero__content { padding: 0 32px; }
    .kt-feats   { grid-template-columns: repeat(2, 1fr); }
    .kt-cats__grid { grid-template-columns: repeat(4, 1fr); }
    .kt-promos  { grid-template-columns: 1fr; }
    .kt-trust   { grid-template-columns: repeat(2, 1fr); }
    .kt-trust__item { border-right: 0; }
}
@media (max-width: 640px) {
    .kt-cats__grid { grid-template-columns: repeat(3, 1fr); }
    .kt-feats   { grid-template-columns: 1fr; }
    .kt-trust   { grid-template-columns: 1fr; }
}

/* index.html не подключает style.css, где определён .main-page — задаём базу здесь. */
.main-page { width: 100%; overflow-x: hidden; }
