/* ========================================================
   EDITORIAL BOUTIQUE — CLEAN LUXURY (V4.2 FINAL POLISH)
   ======================================================== */

   :root {
    --wine-primary: #3E101D;
    --wine-hover: #5A162B;
    --text-main: #1C1917;
    --text-muted: #78716C;
    --text-old-price: #A8A29E;
    --gold-accent: #9A7B56;
    --gold-subtle: rgba(154, 123, 86, 0.08);
    --card-border: rgba(62, 16, 29, 0.08);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    --page-bg: #FAF9F6;
}

/* 1. БЕЗУПРЕЧНАЯ ЗАЩИТА ОТ БОКОВОГО СКРОЛЛА */
html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: border-box;
}

.category-page {
    width: 100%;
    min-height: 100vh;
    padding-top: 105px;
    padding-bottom: 90px;
    background-color: var(--page-bg);
}

.category-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 2. НАВИГАЦИОННАЯ СТРОКА */
.cat-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
}

.breadcrumbs-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bc-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.bc-link:hover {
    color: var(--wine-primary);
}

.bc-sep {
    color: rgba(62, 16, 29, 0.2);
    font-size: 11px;
}

.bc-current {
    color: var(--wine-primary);
    font-weight: 700;
}

.cat-back-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--gold-accent);
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 100px;
    background: #FFFFFF;
    border: 1px solid rgba(154, 123, 86, 0.2);
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.cat-back-link:hover {
    background: var(--gold-accent);
    color: #FFFFFF;
}

/* 3. HERO ШАПКА КАТЕГОРИИ */
.category-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 26px;
}

.cat-title-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 4px;
}

.cat-main-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 4vw, 46px);
    font-weight: 600;
    color: var(--wine-primary);
    line-height: 1.1;
    margin: 0;
}

.cat-badge-pill {
    background: var(--wine-primary);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 100px;
    letter-spacing: 0.5px;
}

.cat-sub-title {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: clamp(14px, 1.6vw, 17px);
    color: var(--gold-accent);
    margin: 0 0 8px;
}

.cat-rich-desc {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-muted);
}

/* 4. БЛОК УПРАВЛЕНИЯ (ПОИСК + ПОДКАТЕГОРИИ + ФИЛЬТРЫ) */
.cat-controls-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

/* ЗАМЕТНЫЙ ПОИСК */
.cat-search-bar {
    width: 100%;
    max-width: 660px;
    margin: 0 auto;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    background: #FFFFFF;
    border: 2px solid rgba(62, 16, 29, 0.12);
    border-radius: 100px;
    padding: 10px 18px;
    gap: 12px;
    box-shadow: 0 6px 20px rgba(62, 16, 29, 0.04);
    transition: all 0.3s ease;
}

.search-input-wrap:focus-within {
    border-color: var(--wine-primary);
    box-shadow: 0 8px 24px rgba(62, 16, 29, 0.12);
}

.search-icon-svg {
    width: 18px;
    height: 18px;
    stroke: var(--wine-primary);
    flex-shrink: 0;
}

.search-input-wrap input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-main);
}

.search-input-wrap input::placeholder {
    color: #9E9793;
    font-weight: 500;
}

.search-clear-btn {
    background: rgba(62, 16, 29, 0.06);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-muted);
    cursor: pointer;
}

/* ПОДКАТЕГОРИИ: ОБЛАКО ПИЛЮЛЬ */
.subcategories-grid-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 900px;
    margin: 0 auto;
}

.subcat-chip {
    background: #FFFFFF;
    border: 1px solid var(--card-border);
    border-radius: 100px;
    padding: 7px 16px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.subcat-chip:hover {
    border-color: var(--wine-primary);
    color: var(--wine-primary);
}

.subcat-chip.active {
    background: var(--wine-primary);
    color: #FFFFFF;
    border-color: var(--wine-primary);
    box-shadow: 0 4px 14px rgba(62, 16, 29, 0.2);
}

/* БЫСТРЫЕ ФИЛЬТРЫ */
.cat-quick-filters {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.filter-chip {
    background: #FFFFFF;
    border: 1px solid var(--card-border);
    border-radius: 100px;
    padding: 6px 14px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-chip .chip-count {
    opacity: 0.6;
}

.filter-chip:hover {
    border-color: var(--wine-primary);
}

.filter-chip.active {
    background: var(--wine-primary);
    color: #FFFFFF;
    border-color: var(--wine-primary);
}

/* ========================================================
   5. ПРЕМИАЛЬНАЯ СЕТКА КАРТОЧЕК ТОВАРОВ
   ======================================================== */
.boutique-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.product-boutique-card {
    background: #FFFFFF;
    border: 1px solid var(--card-border);
    border-radius: 22px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-boutique-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 32px rgba(62, 16, 29, 0.08);
}

.card-visual-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ФОТО-СЦЕНА 3:4 */
.product-media-stage {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: radial-gradient(circle at 50% 50%, #FAF8F5 0%, #EFEBE5 100%);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.product-img {
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease;
}

.product-img.contain-img {
    max-width: 88%;
    max-height: 88%;
    object-fit: contain;
    filter: drop-shadow(0 10px 16px rgba(62, 16, 29, 0.12));
}

.product-img.cover-img {
    object-fit: cover;
}

.product-boutique-card:hover .product-img {
    transform: scale(1.04);
}

.empty-media-box {
    font-size: 44px;
}

/* ВИДЕО */
.product-video-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s ease;
    border-radius: 16px;
}

.product-media-stage.video-playing .product-video-overlay {
    opacity: 1;
}

.video-play-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(28, 25, 23, 0.75);
    backdrop-filter: blur(6px);
    color: #FFFFFF;
    font-size: 9.5px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    z-index: 4;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.video-play-badge .play-icon {
    font-size: 8px;
    color: #4ADE80;
}

.product-media-stage.video-playing .video-play-badge {
    background: var(--wine-primary);
    border-color: rgba(255, 255, 255, 0.5);
}

/* БЕЙДЖИ СКИДОК */
.product-floating-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 3;
}

.media-badge {
    padding: 3px 8px;
    border-radius: 100px;
    font-size: 9.5px;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.media-badge.discount {
    background: #D93838;
    color: #FFFFFF;
}

.media-badge.eco {
    background: #2E7D32;
    color: #FFFFFF;
}

.media-badge.low-stock {
    background: #E67E22;
    color: #FFFFFF;
}

/* ИНФО О ТОВАРЕ */
.product-body {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    min-width: 0;
}

.product-name {
    font-family: 'Playfair Display', serif;
    font-size: 15.5px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.25;
    margin: 0 0 3px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
}

/* ДЕЛИКАТНАЯ СТРОКА СТРАНЫ ПОД НАЗВАНИЕМ */
.product-origin-row {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 5px;
}

.origin-pin {
    font-size: 10px;
    opacity: 0.8;
}

.origin-text {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: -0.1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ЦИТАТА СБОРЩИКА */
.picker-editorial-note {
    font-size: 11px;
    line-height: 1.35;
    color: #6E6763;
    font-style: italic;
    padding-left: 7px;
    border-left: 2px solid rgba(62, 16, 29, 0.25);
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ВЫБОР СПЕЛОСТИ */
.ripeness-selector {
    display: flex;
    gap: 3px;
    background: var(--page-bg);
    padding: 3px;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid rgba(62, 16, 29, 0.05);
    min-width: 0;
}

.ripe-option-btn {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 5px 2px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ripe-option-btn.active {
    background: #FFFFFF;
    color: var(--wine-primary);
    box-shadow: 0 2px 6px rgba(62, 16, 29, 0.08);
}

.ripe-badge {
    background: var(--wine-primary);
    color: #FFFFFF;
    font-size: 9px;
    font-weight: 800;
    border-radius: 10px;
    padding: 1px 4px;
    min-width: 10px;
}

/* ПОДВАЛ КАРТОЧКИ */
.card-bottom-bar {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 6px;
    border-top: 1px solid rgba(62, 16, 29, 0.04);
}

.price-stack {
    display: flex;
    flex-direction: column;
}

.price-main-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.price-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

.price-old-value {
    font-size: 12px;
    text-decoration: line-through;
    color: var(--text-old-price);
    font-weight: 500;
}

.unit-detail {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

/* КНОПКА КОРЗИНЫ */
.quick-add-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--wine-primary);
    color: #FFFFFF;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(62, 16, 29, 0.22);
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.quick-add-btn svg {
    width: 17px;
    height: 17px;
}

.quick-add-btn:hover {
    background: var(--wine-hover);
    transform: scale(1.06);
}

.quick-add-btn:active {
    transform: scale(0.94);
}

.quick-add-btn.disabled {
    background: #D6D3D1;
    box-shadow: none;
    cursor: not-allowed;
}

/* СТЕППЕР */
.card-stepper-box {
    display: flex;
    align-items: center;
    background: var(--wine-primary);
    border-radius: 100px;
    padding: 3px;
    color: #FFFFFF;
    gap: 3px;
    box-shadow: 0 4px 12px rgba(62, 16, 29, 0.22);
    flex-shrink: 0;
}

.stepper-sub-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stepper-val {
    font-size: 11px;
    font-weight: 800;
    padding: 0 6px;
    white-space: nowrap;
}

/* 6. ЭКСПЕРТНЫЙ ГИД */
.expert-guide-card {
    margin-top: 50px;
    background: #FFFFFF;
    border-radius: 20px;
    padding: 28px;
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
}

.guide-tag {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--gold-accent);
    letter-spacing: 1px;
    display: block;
    margin-bottom: 4px;
}

.guide-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: var(--wine-primary);
    margin: 0 0 8px;
}

.guide-text {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ПУСТОЕ СОСТОЯНИЕ */
.empty-state-card {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 16px;
    background: #FFFFFF;
    border-radius: 20px;
    border: 1px solid var(--card-border);
}

.empty-state-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.empty-state-title {
    font-family: 'Playfair Display', serif;
    font-size: 19px;
    color: var(--wine-primary);
    margin-bottom: 4px;
}

.empty-state-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ========================================================
   АДАПТИВНОСТЬ (МОБИЛЬНЫЕ — СТРОГО 2 В РЯД, БЕЗ СДВИГОВ)
   ======================================================== */

@media (max-width: 1024px) {
    .boutique-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
}

@media (max-width: 768px) {
    .category-page {
        padding-top: 70px;
        padding-bottom: 35px;
    }

    .category-container {
        padding: 0 8px; /* 👈 ультра-компактно под экран */
    }

    .cat-nav-bar {
        margin-bottom: 10px;
        gap: 8px;
    }

    .breadcrumbs-nav {
        font-size: 11.5px;
        gap: 4px;
    }

    .cat-back-link {
        font-size: 11px;
        padding: 4px 9px;
    }

    .category-header {
        margin-bottom: 14px;
    }

    .cat-main-title {
        font-size: clamp(22px, 5.5vw, 30px); /* 👈 заголовок ровно в 1 строку */
    }

    .cat-sub-title {
        font-size: 12.5px;
        margin-bottom: 6px;
    }

    .search-input-wrap {
        padding: 7px 12px;
    }

    .search-input-wrap input {
        font-size: 13px;
    }

    .subcategories-grid-cloud {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .subcategories-grid-cloud::-webkit-scrollbar { display: none; }

    .subcat-chip {
        flex-shrink: 0;
        font-size: 11.5px;
        padding: 5px 12px;
    }

    .cat-quick-filters {
        overflow-x: auto;
        justify-content: flex-start;
        scrollbar-width: none;
    }
    .cat-quick-filters::-webkit-scrollbar { display: none; }

    .filter-chip {
        flex-shrink: 0;
        padding: 5px 11px;
        font-size: 11px;
    }

    /* СТРОГО 2 В РЯД */
    .boutique-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .product-boutique-card {
        padding: 7px;
        border-radius: 14px;
    }

    .product-media-stage {
        border-radius: 10px;
        margin-bottom: 6px;
    }

    .product-video-overlay {
        border-radius: 10px;
    }

    .video-play-badge {
        bottom: 5px;
        right: 5px;
        font-size: 8.5px;
        padding: 2px 6px;
    }

    .product-name {
        font-size: 12.5px;
        line-height: 1.2;
    }

    .product-origin-row {
        margin-bottom: 3px;
    }

    .origin-pin {
        font-size: 8.5px;
    }

    .origin-text {
        font-size: 9.5px;
    }

    .picker-editorial-note {
        font-size: 9.5px;
        padding-left: 4px;
        border-left-width: 1.5px;
    }

    .ripeness-selector {
        padding: 2px;
        border-radius: 6px;
        margin-bottom: 6px;
        gap: 2px;
    }

    .ripe-option-btn {
        font-size: 8.5px;
        padding: 3px 1px;
        border-radius: 4px;
    }

    .ripe-badge {
        font-size: 7.5px;
        padding: 0 2px;
        min-width: 7px;
    }

    .price-value {
        font-size: 14.5px;
    }

    .price-old-value {
        font-size: 10px;
    }

    .price-main-line {
        gap: 3px;
    }

    .unit-detail {
        font-size: 8.5px;
    }

    .quick-add-btn {
        width: 30px;
        height: 30px;
    }

    .quick-add-btn svg {
        width: 13px;
        height: 13px;
    }

    .stepper-sub-btn {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }

    .stepper-val {
        font-size: 9px;
        padding: 0 3px;
    }
}
