/* ========================================================
   CATALOG PAGE (EDITORIAL BOUTIQUE STYLE)
   ======================================================== */

   :root {
    --cat-wine: #4A1525;
    --cat-text-dark: #1A1A1A;
    --cat-text-muted: #777777;
    --cat-accent-brown: #8C6D58;
    --cat-border-subtle: rgba(59, 13, 27, 0.08);
}

/* --- 1. СТРАНИЦА И ХЛЕБНЫЕ КРОШКИ --- */
.category-page {
    padding-top: 130px;
    padding-bottom: 100px;
    min-height: 100vh;
}

.breadcrumbs-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.bc-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--cat-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.bc-link:hover {
    color: var(--cat-wine);
}

.bc-sep {
    font-size: 11px;
    color: rgba(59, 13, 27, 0.25);
}

.bc-current {
    font-size: 13px;
    font-weight: 700;
    color: var(--cat-wine);
}

/* --- 2. HERO ШАПКА КАТАЛОГА --- */
.catalog-header-wrap {
    margin-bottom: 48px;
}

.cat-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(34px, 4.5vw, 54px);
    font-weight: 600;
    color: var(--cat-wine);
    line-height: 1.08;
    letter-spacing: -0.5px;
    margin: 0 0 8px 0;
}

.cat-title i {
    font-style: italic;
    font-weight: 400;
}

.cat-subtitle {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: clamp(16px, 2vw, 20px);
    color: var(--cat-accent-brown);
    margin-bottom: 20px;
    display: block;
}

/* Быстрые теги подсказок */
.catalog-tags-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}

.catalog-tags-row::-webkit-scrollbar {
    display: none;
}

.tag-btn-chip {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--cat-border-subtle);
    padding: 7px 16px;
    border-radius: 100px;
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--cat-text-dark);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    white-space: nowrap;
}

.tag-btn-chip:hover,
.tag-btn-chip.active {
    background: var(--cat-wine);
    color: #FFFFFF !important;
    border-color: var(--cat-wine);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 21, 37, 0.15);
}

.tag-btn-chip:active {
    transform: scale(0.96);
}

/* --- 3. СЕКЦИИ КАТАЛОГА (ЕДА / ДЕКОР) --- */
.catalog-section-group {
    margin-bottom: 70px;
}

.catalog-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 32px;
    border-bottom: 1px solid rgba(59, 13, 27, 0.08);
    padding-bottom: 18px;
}

.section-subtitle {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 14px;
    color: var(--cat-accent-brown);
    display: block;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.catalog-group-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(28px, 3.5vw, 42px);
    font-weight: 600;
    color: var(--cat-wine);
    line-height: 1.1;
    letter-spacing: -0.4px;
    margin: 0;
}

.catalog-group-title i {
    font-style: italic;
    font-weight: 400;
}

.section-desc {
    font-size: 14px;
    color: var(--cat-text-muted);
    max-width: 420px;
    line-height: 1.5;
    margin: 0;
    text-align: right;
}

/* --- 4. ПРЕМИУМ-СЕТКА КАТЕГОРИЙ --- */
.catalog-main-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.catalog-category-card {
    border-radius: 40px;
    padding: 36px 30px 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 480px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
                box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: transform;
}

/* Пента-палитра: цвета гармонично не повторяются друг под другом */
.catalog-category-card:nth-child(5n+1) { background: #D8E2D7; } /* 1. Фисташка */
.catalog-category-card:nth-child(5n+2) { background: #EFE7DA; } /* 2. Овсяный миндаль */
.catalog-category-card:nth-child(5n+3) { background: #F5E0DC; } /* 3. Пудровый персик */
.catalog-category-card:nth-child(5n+4) { background: #E2E7EC; } /* 4. Утренний лед */
.catalog-category-card:nth-child(5n+5) { background: #EFE4D8; } /* 5. Теплая карамель */

.catalog-category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 50px rgba(59, 13, 27, 0.1);
}

/* Заголовок карточки */
.cat-card-header {
    text-align: center;
}

.cat-card-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 34px;
    font-weight: 600;
    color: var(--cat-text-dark);
    line-height: 1.1;
    letter-spacing: -0.5px;
    margin: 0 0 6px 0;
}

.cat-card-sub {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 16px;
    color: var(--cat-accent-brown);
    display: block;
}

/* Сцена для сочного 3D-изображения */
.cat-card-img-wrap {
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 16px 0;
    position: relative;
    flex-shrink: 0;
}

.cat-card-img {
    max-height: 100%;
    max-width: 92%;
    width: auto;
    height: auto;
    object-fit: contain;
    /* Объемная студийная тень + мягкая посадочная тень */
    filter: drop-shadow(0 18px 22px rgba(59, 13, 27, 0.15))
            drop-shadow(0 6px 8px rgba(0, 0, 0, 0.06));
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1),
                filter 0.5s ease;
}

.catalog-category-card:hover .cat-card-img {
    transform: scale(1.08) translateY(-6px) rotate(1.5deg);
    filter: drop-shadow(0 26px 32px rgba(59, 13, 27, 0.2))
            drop-shadow(0 8px 12px rgba(0, 0, 0, 0.08));
}

/* Нижняя панель: чипсы подкатегорий */
.cat-card-sublinks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(59, 13, 27, 0.08);
}

.sublink-chip {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    color: #2C2C2C;
    text-decoration: none;
    transition: all 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: inline-block;
}

.sublink-chip:hover {
    background: #FFFFFF;
    color: var(--cat-wine);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* --- 5. БЛОК ЖИВОГО ПОИСКА --- */
.catalog-live-search-results {
    display: none;
    margin-top: 24px;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.search-results-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 28px;
    color: var(--cat-wine);
}

/* ========================================================
   АДАПТИВНОСТЬ (RESPONSIVE)
   ======================================================== */

/* Планшеты (до 1024px) */
@media (max-width: 1024px) {
    .category-page {
        padding-top: 105px;
        padding-bottom: 70px;
    }

    .catalog-main-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .catalog-category-card {
        min-height: 430px;
        padding: 28px 24px 22px;
    }

    .cat-card-img-wrap {
        height: 180px;
    }
}

/* Мобильные устройства (до 768px) */
@media (max-width: 768px) {
    .category-page {
        padding-top: 85px;
        padding-bottom: 50px;
    }

    .catalog-header-wrap {
        margin-bottom: 32px;
    }

    .catalog-section-group {
        margin-bottom: 45px;
    }

    .catalog-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 20px;
    }

    .section-desc {
        text-align: left;
        font-size: 13px;
    }

    .catalog-main-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .catalog-category-card {
        min-height: 360px;
        padding: 24px 20px 20px;
        border-radius: 30px;
    }

    .cat-card-title {
        font-size: 28px;
    }

    .cat-card-img-wrap {
        height: 160px;
        margin: 12px 0;
    }

    .sublink-chip {
        font-size: 11px;
        padding: 5px 12px;
    }
}


/* ========================================================
   ОБНОВЛЕННЫЙ МОБИЛЬНЫЙ СТИЛЬ (ДО 768px)
   ======================================================== */

   @media (max-width: 768px) {
    .category-page {
        padding-top: 90px;
        padding-bottom: 60px;
    }

    /* Шапка компактнее и аккуратнее */
    .cat-title {
        font-size: 30px;
        line-height: 1.15;
    }

    .cat-subtitle {
        font-size: 14px;
        margin-bottom: 16px;
    }

    /* СЕТКА: Переключаем на 2 колонки с Bento-эффектом */
    .catalog-main-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Базовая компактная карточка */
    .catalog-category-card {
        min-height: 230px;
        padding: 18px 14px 14px;
        border-radius: 24px;
    }

    .cat-card-title {
        font-size: 19px;
        letter-spacing: -0.3px;
        margin-bottom: 2px;
    }

    .cat-card-sub {
        font-size: 12px;
        opacity: 0.85;
    }

    .cat-card-img-wrap {
        height: 110px;
        margin: 8px 0;
    }

    /* Чипсы подкатегорий на мобилке делаем горизонтальным микро-скроллом */
    .cat-card-sublinks {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        gap: 6px;
        padding-top: 10px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        margin: 0 -6px;
        padding-left: 6px;
        padding-right: 6px;
    }
    .cat-card-sublinks::-webkit-scrollbar {
        display: none;
    }

    .sublink-chip {
        flex: 0 0 auto;
        font-size: 11px;
        padding: 4px 10px;
        border-radius: 20px;
    }

    /* BENTO-АКЦЕНТ: Каждая 1-я карточка в секции — во всю ширину (Горизонтальный Hero-баннер) */
    .catalog-category-card:first-child {
        grid-column: span 2;
        min-height: 180px;
        padding: 22px 20px;
        display: grid;
        grid-template-columns: 1fr 120px;
        align-items: center;
        text-align: left;
    }

    .catalog-category-card:first-child .cat-card-header {
        text-align: left;
    }

    .catalog-category-card:first-child .cat-card-title {
        font-size: 24px;
    }

    .catalog-category-card:first-child .cat-card-img-wrap {
        height: 120px;
        margin: 0;
        justify-content: flex-end;
    }

    .catalog-category-card:first-child .cat-card-sublinks {
        grid-column: span 2;
        margin-top: 10px;
    }
}


.cat-card-sublinks {
    display: flex;
    flex-wrap: wrap; /* Чипсы переносятся на новую строку без скролла */
    gap: 6px;
    justify-content: center;
    margin-top: auto;
    padding-top: 12px;
}

.sublink-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    text-decoration: none;
    color: var(--cat-text-dark);
}

.sublink-chip.chip-more {
    background: transparent;
    border: 1px dashed var(--cat-accent-brown);
    color: var(--cat-wine);
    font-weight: 700;
}


.live-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--cat-border-subtle);
    padding: 6px 14px;
    border-radius: 100px;
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--cat-text-dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #2E7D32;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(46, 125, 50, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}


/* --- HERO ШАПКА КАТАЛОГА --- */
.catalog-header-wrap {
    margin-bottom: 40px;
}

/* Верхняя строчка: крошки слева, статус справа */
.catalog-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.breadcrumbs-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

/* Живой статус */
.live-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--cat-border-subtle);
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 12px;
    color: var(--cat-text-dark);
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #2E7D32;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.25);
}

/* Заголовок: строгий, без визуального мусора */
.cat-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(32px, 4vw, 46px);
    font-weight: 600;
    color: var(--cat-wine);
    line-height: 1.1;
    letter-spacing: -0.5px;
    margin: 0 0 20px 0;
}

.cat-title i {
    font-style: italic;
    font-weight: 400;
}

/* Блок поиска */
.catalog-search-container {
    margin-bottom: 14px;
}

/* Быстрые теги */
.catalog-tags-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.tags-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--cat-text-muted);
    white-space: nowrap;
}

.tag-btn-chip {
    flex: 0 0 auto;
    background: #FFFFFF;
    border: 1px solid var(--cat-border-subtle);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: var(--cat-text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-btn-chip:hover {
    background: var(--cat-wine);
    color: #FFFFFF !important;
    border-color: var(--cat-wine);
}

.chip-rescued {
    background: #FFF8E7;
    border-color: #F1DEB4;
    color: #8C6D58;
    text-decoration: none;
}

/* Мобильная адаптация шапки */
@media (max-width: 768px) {
    .catalog-top-bar {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 8px;
    }
    .cat-title {
        font-size: 28px;
        margin-bottom: 16px;
    }
}
