/* ========================================================
   ZILFRESH — CATALOG STYLES (QUIET LUXURY & CHOCOLATE)
   ======================================================== */

   :root {
    --bg-canvas: #FAF8F5;
    --bg-card: #FFFFFF;
    --bg-subtle: #F4EFEA;
    --bg-subtle-hover: #ECE6DF;

    --text-main: #2C1E18;           /* Тёмный шоколад */
    --text-title: #1C1917;
    --text-muted: #6E665F;
    --text-light: #9EA398;
    --text-country: #8C827A;

    --btn-primary-bg: #2C1E18;
    --btn-primary-hover: #422D24;
    --btn-primary-text: #FAF8F5;
    --accent-nectar: #DE5D26;
    --accent-fresh: #2B7A32;

    --border-subtle: rgba(44, 30, 24, 0.07);
    --border-hover: rgba(44, 30, 24, 0.16);

    --shadow-card: 0 4px 18px rgba(44, 30, 24, 0.03);
    --shadow-float: 0 16px 36px rgba(44, 30, 24, 0.08);

    --radius-pill: 9999px;
    --radius-card: 26px;
    --radius-inner: 14px;
    --radius-sm: 8px;
}

/* 1. БАЗОВАЯ РАЗМЕТКА */
.catalog-page {
    padding-top: 100px;
    padding-bottom: 80px;
    min-height: 100vh;
    background-color: var(--bg-canvas);
}

/* 2. ШАПКА КАТАЛОГА */
.catalog-header-wrap {
    margin-bottom: 36px;
}

.catalog-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.breadcrumbs-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.bc-link { color: var(--text-muted); text-decoration: none; }
.bc-link:hover { color: var(--text-main); }
.bc-sep { color: var(--text-light); font-size: 11px; }
.bc-current { color: var(--text-main); font-weight: 600; }

.live-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    color: var(--text-main);
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-fresh);
    border-radius: 50%;
}

.cat-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.12;
    margin: 0 0 16px 0;
}

.cat-title i {
    font-style: italic;
    font-weight: 600;
    color: var(--accent-nectar);
}

/* ПОИСКОВАЯ СТРОКА */
.catalog-search-container {
    margin: 0 auto 16px;
}

.catalog-search-box-embedded {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 680px;
    background: #FFFFFF;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-pill);
    padding: 6px 6px 6px 18px;
    box-shadow: 0 4px 16px rgba(44, 30, 24, 0.04);
    transition: all 0.25s ease;
}

.catalog-search-box-embedded:focus-within {
    border-color: var(--text-main);
    box-shadow: 0 8px 24px rgba(44, 30, 24, 0.08);
}

.cat-search-lens {
    width: 18px;
    height: 18px;
    color: var(--text-main);
    margin-right: 10px;
    flex-shrink: 0;
}

.cat-search-input-field {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--text-main);
    background: transparent;
}

.cat-search-input-field::placeholder { color: var(--text-light); }

.cat-search-clear-btn {
    background: var(--bg-subtle);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    margin-right: 6px;
}

.cat-search-submit-btn {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    border-radius: var(--radius-pill);
    padding: 10px 20px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.cat-search-submit-btn:hover {
    background: var(--btn-primary-hover);
}

/* БЫСТРЫЕ ТЕГИ */
.catalog-tags-row {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}
.catalog-tags-row::-webkit-scrollbar { display: none; }

.tags-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    margin-right: 2px;
}

.tag-btn-chip {
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    padding: 6px 13px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tag-btn-chip:hover {
    background: var(--btn-primary-bg);
    color: #FFFFFF !important;
    border-color: var(--btn-primary-bg);
}

/* ========================================================
   3. ГРУППЫ СЕКЦИЙ И КАРТОЧКИ КАТЕГОРИЙ (ПАСТЕЛЬ)
   ======================================================== */
.catalog-section-group {
    margin-bottom: 50px;
}

.catalog-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 14px;
}

.section-subtitle {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-nectar);
    letter-spacing: 0.8px;
    display: block;
    margin-bottom: 3px;
}

.catalog-group-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(24px, 3.2vw, 36px);
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.catalog-group-title i { font-style: italic; color: var(--accent-nectar); }

.section-desc {
    font-size: 13.5px;
    color: var(--text-muted);
    max-width: 380px;
    text-align: right;
}

.catalog-main-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* КАРТОЧКА КАТЕГОРИИ */
.catalog-category-card {
    border-radius: var(--radius-card);
    padding: 24px 20px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 380px;
    position: relative;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Палитра карточек */
.catalog-category-card:nth-child(5n+1) { background: #E1E8DE; } /* Мята/шалфей */
.catalog-category-card:nth-child(5n+2) { background: #EFE9DE; } /* Овсяное молоко */
.catalog-category-card:nth-child(5n+3) { background: #F6E5E1; } /* Нежный персик */
.catalog-category-card:nth-child(5n+4) { background: #E3E9ED; } /* Утренний туман */
.catalog-category-card:nth-child(5n+5) { background: #F2ECE1; } /* Карамель */

.catalog-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(44, 30, 24, 0.08);
}

.cat-card-top-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cat-card-header {
    text-align: center;
}

.cat-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 2px 0;
}

.cat-card-sub {
    font-style: italic;
    font-size: 13.5px;
    color: var(--text-muted);
}

.cat-card-img-wrap {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px 0;
}

.cat-card-img {
    max-height: 100%;
    max-width: 85%;
    object-fit: contain;
    filter: drop-shadow(0 10px 14px rgba(44, 30, 24, 0.12));
    transition: transform 0.4s ease;
}

.catalog-category-card:hover .cat-card-img {
    transform: scale(1.06);
}

/* ЧИПСЫ ПОДКАТЕГОРИЙ: АККУРАТНЫЕ И БЕЗ ДЫР */
.cat-card-sublinks {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    min-height: 40px;
}

.sublink-chip {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: all 0.2s ease;
}

.sublink-chip:hover {
    background: #FFFFFF;
    color: var(--btn-primary-bg);
    transform: translateY(-1px);
}

.sublink-chip.chip-more {
    background: transparent;
    border: 1px dashed rgba(44, 30, 24, 0.2);
    color: var(--text-main);
    font-weight: 700;
}

.sublink-chip.chip-all {
    background: #FFFFFF;
    font-weight: 700;
}

/* ========================================================
   4. СЕТКА ТОВАРОВ В ПОИСКЕ (BOUTIQUE GRID)
   ======================================================== */
.search-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.search-meta-title { font-size: 18px; font-weight: 700; color: var(--text-main); }
.search-reset-link { font-size: 13px; font-weight: 600; color: var(--accent-nectar); text-decoration: none; }

.boutique-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

.product-boutique-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-inner);
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-card);
    position: relative;
    transition: all 0.25s ease;
}

.product-boutique-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(44, 30, 24, 0.06);
}

.card-visual-link { text-decoration: none; color: inherit; }

.product-media-stage {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #F7F5F0;
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
    margin-bottom: 8px;
}

.product-img { width: 100%; height: 100%; object-fit: cover; }
.empty-media-box { font-size: 36px; display: flex; align-items: center; justify-content: center; height: 100%; }

.product-floating-badges {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 3;
}

.media-badge {
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 700;
}
.media-badge.discount { background: var(--accent-nectar); color: #fff; }
.media-badge.eco { background: var(--accent-fresh); color: #fff; }

.stream-card-origin { font-size: 11px; font-weight: 400; color: var(--text-country); margin-bottom: 3px; }

.product-name {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-title);
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 35px;
}

.cat-pack-selector {
    display: flex;
    width: 100%;
    background: var(--bg-subtle);
    padding: 3px;
    border-radius: var(--radius-sm);
    gap: 2.5px;
    margin: 4px 0 8px 0;
}

.cat-pack-btn {
    flex: 1 1 0;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 5px 2px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    text-align: center;
}

.cat-pack-btn.active {
    background: #FFFFFF;
    color: var(--text-main);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(44, 30, 24, 0.08);
}

.card-bottom-bar {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 6px;
}

.price-main-line { display: flex; align-items: baseline; gap: 4px; }
.price-value { font-size: 15.5px; font-weight: 700; color: var(--text-main); }
.price-old-value { font-size: 10.5px; text-decoration: line-through; color: var(--text-light); }
.unit-detail-inline { font-size: 11px; color: var(--text-country); font-weight: 400; }

.quick-add-btn {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.quick-add-btn:hover { background: var(--btn-primary-hover); }

.card-stepper-box {
    display: inline-flex;
    align-items: center;
    background: var(--btn-primary-bg);
    color: #fff;
    border-radius: var(--radius-pill);
    padding: 2.5px 6px;
    gap: 3px;
}

.stepper-sub-btn {
    background: transparent;
    color: #fff;
    border: none;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stepper-val { font-size: 11.5px; font-weight: 600; min-width: 14px; text-align: center; }

/* ПУСТОЙ ПОИСК */
.empty-search-box {
    text-align: center;
    padding: 50px 20px;
    background: #FFFFFF;
    border-radius: var(--radius-card);
    border: 1px solid var(--border-subtle);
    margin-bottom: 40px;
}

.empty-search-icon { font-size: 44px; margin-bottom: 12px; }
.empty-search-title { font-size: 20px; font-weight: 700; color: var(--text-main); margin-bottom: 6px; }
.empty-search-text { font-size: 13.5px; color: var(--text-muted); margin-bottom: 20px; }

/* ТОСТ */
.cat-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44, 30, 24, 0.95);
    color: #fff;
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 8px 24px rgba(44, 30, 24, 0.25);
}

/* ========================================================
   5. АДАПТИВНОСТЬ (МОБИЛЬНЫЕ — BENTO СЕТКА 2 КОЛОНКИ)
   ======================================================== */
@media (max-width: 1024px) {
    .catalog-main-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .boutique-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .catalog-page {
        padding-top: 75px;
        padding-bottom: 40px;
    }

    .catalog-top-bar {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 6px;
    }

    .cat-title {
        font-size: 28px;
        margin-bottom: 14px;
    }

    .catalog-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin-bottom: 14px;
    }

    .section-desc { text-align: left; }

    /* 2 КОЛОНКИ НА СМАРТФОНЕ */
    .catalog-main-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .catalog-category-card {
        min-height: 240px;
        padding: 16px 12px 14px;
        border-radius: 20px;
    }

    .cat-card-title { font-size: 20px; }
    .cat-card-sub { font-size: 12px; }

    .cat-card-img-wrap {
        height: 105px;
        margin: 6px 0;
    }

    .sublink-chip {
        font-size: 10.5px;
        padding: 4px 8px;
        max-width: 100%;
    }

    /* BENTO: Каждая 1-я карточка группы — во всю ширину как Hero-баннер */
    .catalog-category-card:first-child {
        grid-column: span 2;
        min-height: 160px;
        padding: 18px 16px;
        display: grid;
        grid-template-columns: 1fr 110px;
        align-items: center;
        text-align: left;
    }

    .catalog-category-card:first-child .cat-card-top-link {
        align-items: flex-start;
    }

    .catalog-category-card:first-child .cat-card-header {
        text-align: left;
    }

    .catalog-category-card:first-child .cat-card-title {
        font-size: 22px;
    }

    .catalog-category-card:first-child .cat-card-img-wrap {
        height: 100px;
        margin: 0;
        justify-content: flex-end;
    }

    .catalog-category-card:first-child .cat-card-sublinks {
        grid-column: span 2;
        justify-content: flex-start;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(44, 30, 24, 0.06);
    }

    /* Сетка товаров в поиске */
    .boutique-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .product-boutique-card { padding: 8px; }
    .product-name { font-size: 12.5px; min-height: 32px; }
    .quick-add-btn .btn-label-text { display: none; }
    .quick-add-btn {
        min-width: 34px;
        width: 34px;
        height: 34px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }
}
