/* =============== Product card =============== */

/* Tall card */
.tall-card {
    border-color: #e6e6e6 !important;
    display: flex;
    flex-direction: column;
    transition: .25s ease;
}

.tall-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.08);
}

/* IMAGE AREA */
.thumb-tall {
    height: 300px;  /* высокая зона — премиум вид */
    background: #f7f7f7;
    overflow: hidden;
    padding: 20px;
}

.thumb-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* DISCOUNT BADGE */
.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #d93030;
    color: white;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 600;
    z-index: 10;
}

/* TITLE */
.title-tall {
    font-size: 15px;
    line-height: 1.35;
    height: 44px; /* ровно две строки */
    overflow: hidden;
}

/* PRICE AREA */
.price-row {
    margin: 8px 0 12px;
}

.old-price {
    text-decoration: line-through;
    color: #aaa;
    margin-right: 6px;
    font-size: 14px;
}

.sale-price {
    color: #d93030;
    font-weight: 600;
    font-size: 15px;
}

.regular-price {
    color: #111;
    font-weight: 600;
    font-size: 15px;
}

/* STORE INFO */
.store-info {
    font-size: 12px;
    color: #666;
    margin-top: auto;
}


.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.product-link:hover {
    text-decoration: none;
    color: inherit;
}




/* ---------- Product slider container ---------- */
.product-slider-container {
    position: relative;
    overflow: hidden;
}

.product-slider .tall-card:hover {
    transform: none;
    box-shadow: none;
}

/* Слайд */
.product-slider .swiper-slide {
    flex: 0 0 auto;     
    width: calc(50% - 9px); 
    max-width: 260px; 
}

/* Image area */
.product-slider .thumb-tall {
    height: 260px;
    padding: 15px;
}


.product-slider-btn{
    position:absolute;
    top:calc(50% - 24px);
    z-index:10;
}

.product-slider-btn.left-btn{left:0}
.product-slider-btn.right-btn{right:0}

@media (pointer: coarse){
  .product-slider-btn{display:none!important}
}

/* MOBILE */
@media (max-width: 576px) {
    .product-slider .swiper-slide {
        width: auto; /* Swiper управляет шириной */
        max-width: 160px; /* или под размер карточки */
    }

    .product-slider .thumb-tall {
        height: 160px;
        padding: 10px;
    }

    .product-slider-btn {
        display: none;
    }
}

/* ===== shop-topbar ===== */
.shop-topbar {
    padding: 6px 0;
    border-bottom: 1px solid rgba(var(--n5), 0.4);
}

.shop-sort-select {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(var(--n5), 0.6);
    background: #fff;
    cursor: pointer;
}

.shop-sort-select:focus {
    outline: none;
    border-color: #FFCC33;
}

.shop-breadcrumb .breadcrumb-link {
    color: var(--n15-color);
    text-decoration: none;
}

.shop-breadcrumb .breadcrumb-link:hover {
    text-decoration: underline;
}

.shop-title {
    font-size: 28px;
    line-height: 1.2;
}
/* ===== shop-topbar ===== */

/* =====================================================
   SIDEBAR BASE (DESKTOP)
===================================================== */
.shop-filter {
    position: fixed;
    top: 0;
    left: 0;
    width: 360px;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform .3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.shop-filter.active {
    transform: translateX(0);
}

/* overlay */
.shop-filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    opacity: 0;
    pointer-events: none;
    z-index: 9998;
    transition: opacity .2s ease;
}
.shop-filter-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* inner scroll */
.filter-inner {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

/* close button */
.close-shop-filter {
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}


.shop-filter h4 {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* =====================================================
   ACTIVE FILTERS
===================================================== */
.active-filters-zone {
    margin-bottom: 16px;
}

.active-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.active-filters-body {
    max-height: 67px;
    overflow: hidden;
    transition: max-height .25s ease;
    margin-bottom: 12px;
}

.active-filters-body.is-open {
    max-height: 1000px;
    margin-bottom: 16px;
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* groups */
.filter-group {
    margin-bottom: 8px;
}
.filter-group-title {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 4px;
}
.filter-group-values {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* chips */
.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #FFD400;
    font-size: 12px;
    cursor: pointer;
}

/* =========================
   MENU BUTTONS
========================= */
.filter-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.filter-menu-item {
    background: #f7f7f7;
    border-radius: 10px;
    padding: 12px 14px;
    border: none;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 500;
    align-items: center;
}

/* =========================
   PANELS
========================= */
.filter-panel {
    position: absolute;
    inset: 0;
    background: #fff;
    transform: translateX(100%);
    transition: transform .3s ease;
    display: flex;
    flex-direction: column;
    z-index: 100;
}
.filter-panel.active {
    transform: translateX(0);
}

/* =========================
   HEADER
========================= */
.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    flex-shrink: 0;
}

/* =========================
   SEARCH INPUT
========================= */
.panel-search {
    margin: 12px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
}

/* =========================
   LIST OF ITEMS
========================= */
.panel-list {
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.panel-apply-footer {
    flex-shrink: 0;
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid #eee;
    margin-top: auto;
}

/* =========================
   ITEMS
========================= */
.panel-item {
    display: flex;
    align-items: center;
    gap: 10px;          /* расстояние между чекбоксом, текстом и стрелкой */
    padding: 12px 14px;
    cursor: pointer;
    background: #f7f7f7;
    border-radius: 10px;
    border: none;
    font-weight: 500;
    justify-content: flex-start; /* Важно: чекбокс, текст и стрелка слева направо */
}


/* Наведение и активное состояние */
.panel-item:hover {
    background: #eaeaea;
}
.panel-item input[type="checkbox"] {
    margin-right: 8px;
}
.child-toggle {
    margin-left: auto;
    cursor: pointer;
}

/* =====================================================
   QUICK FILTER BAR
===================================================== */
.quick-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    padding-bottom: 6px;
}
.quick-filters::-webkit-scrollbar {
    display: none;
}
.quick-filters > button {
    flex-shrink: 0;
}

.quick-filter-btn .count {
    display: none;
}

/* clear all */
#clear-all-filters {
    background: transparent;
    color: #555;
}
#clear-all-filters:hover {
    background: #f7f7f7;
}

/* =====================================================
   QUICK FILTER ORDER
===================================================== */

/* mobile default */
.all-filters-btn {
    order: -1;
}

/* desktop */
@media (min-width: 992px) {
    .quick-filters {
        overflow-x: visible;
    }
    .all-filters-btn {
        order: 999;
        margin-left: auto;
    }
    .clear-all-btn {
        order: 1000;
        margin-left: 8px;
    }
}

/* mobile UX */
@media (max-width: 991px) {
    .all-filters-btn .label {
        display: none;
    }
    .all-filters-btn {
        padding-left: 14px;
        padding-right: 14px;
    }
}

/* =====================================================
   MOBILE: BOTTOM SHEET
===================================================== */
@media (max-width: 991px) {

    .shop-filter {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70vh;
        border-radius: 18px 18px 0 0;
        transform: translateY(100%);
        transition: transform .25s ease;
    }

    .shop-filter.active {
        transform: translateY(0);
    }

    .filter-inner {
        padding-bottom: 120px;
    }


    .close-shop-filter {
        top: 8px;
        right: 10px;
        font-size: 30px;
    }
}





/* =========================
   ITEMS
========================= */

/* Обертка для элемента и кнопки перехода */
.panel-item-wrapper {
    display: flex;
    align-items: center;
    gap: 4px; /* расстояние между элементом и кнопкой стрелки */
    width: 100%;
}

.panel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    background: #f7f7f7;
    border-radius: 10px;
    border: none;
    font-weight: 500;
    flex: 1; /* занимает всё доступное пространство */
    min-width: 0; /* предотвращает переполнение */
}

/* Кнопка стрелки для перехода к дочерним элементам */
.child-toggle-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f7f7;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    color: #555;
}

.child-toggle-btn:hover {
    background: #eaeaea;
    color: #333;
}

/* Наведение на весь блок */
.panel-item-wrapper:hover .panel-item,
.panel-item-wrapper:hover .child-toggle-btn {
    background: #eaeaea;
}

.panel-item input[type="checkbox"] {
    margin-right: 8px;
}


/* Мобильная адаптация */
@media (max-width: 991px) {
    .child-toggle-btn {
        width: 36px;
        height: 36px;
    }
    
    .panel-item {
        padding: 10px 12px;
    }
}


/* =====================================================
   FILTER FOOTER BUTTONS (FIXED AT BOTTOM)
===================================================== */

/* Контейнер для фиксированных кнопок */
.filter-buttons-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #eee;
    z-index: 10;
    padding: 16px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Внутренний контейнер для кнопок */
.filter-footer-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Основной контент с отступом для кнопок */
.filter-inner {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
    padding-bottom: 140px; /* Отступ для фиксированных кнопок */
}

/* Для мобильной версии (bottom sheet) */
@media (max-width: 991px) {
    .shop-filter {
        display: flex;
        flex-direction: column;
    }
    
    .filter-inner {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 120px; /* Меньший отступ на мобильных */
    }
    
    .filter-buttons-footer {
        padding: 12px 16px;
    }
}

/* Для десктопа */
@media (min-width: 992px) {
    .filter-buttons-footer {
        position: absolute;
        bottom: 0;
    }
}

/* =====================
   PRICE SLIDER STYLES - ТОЛЬКО ОТОБРАЖЕНИЕ
===================== */
.price-slider-container {
    padding: 20px 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.price-display {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.field span {
    font-weight: 500;
    color: #600;
    font-size: 20px;
    letter-spacing: 0.5px;
}


.price-value-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 90px;
    width: 90px;
    padding: 12px 16px;
    font-size: 20px;
    font-weight: 600;
    color: #000;
    user-select: none;
    box-sizing: border-box;
}


.slider {
    height: 15px;
    border-radius: 6px;
    background: #E0E0E0;
    position: relative;
}

.progress {
    height: 100%;
    left: 0%;
    right: 0%;
    position: absolute;
    border-radius: 6px;
    background: #FFCC33;
}

.range-input {
    position: relative;
}

.range-input input[type="range"] {
    position: absolute;
    width: 100%;
    height: 15px;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* Большие черные круги-ползунки НАД полосой */
.range-input input[type="range"]::-webkit-slider-thumb {
    height: 28px;
    width: 28px;
    border-radius: 50%;
    background: #000000;
    pointer-events: auto;
    -webkit-appearance: none;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    position: relative;
    transition: all 0.2s ease;
}

/* Стрелки на кругах */
.range-input input[type="range"]::-webkit-slider-thumb::before {
    content: "↔";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

/* При наведении и перетаскивании - белый фон */
.range-input input[type="range"]::-webkit-slider-thumb:hover,
.range-input input[type="range"]::-webkit-slider-thumb:active {
    background: #fff;
    border-color: #000;
}

.range-input input[type="range"]::-webkit-slider-thumb:hover::before,
.range-input input[type="range"]::-webkit-slider-thumb:active::before {
    color: #000;
}

/* Для Firefox */
.range-input input[type="range"]::-moz-range-thumb {
    height: 28px;
    width: 28px;
    border-radius: 50%;
    background: #000000;
    pointer-events: auto;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    position: relative;
    transition: all 0.2s ease;
    top: -11px;
}

.range-input input[type="range"]::-moz-range-thumb:hover,
.range-input input[type="range"]::-moz-range-thumb:active {
    background: #fff;
    border-color: #000;
}

/* Метки под слайдером */
.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-size: 12px;
    color: #666;
    padding: 0 5px;
}

/* Скрытые поля для отправки на сервер */
.hidden-price-inputs {
    display: none;
}

/* Добавляем скрытые поля для формы */
.price-slider-container::after {
    content: '';
    display: block;
}




.panel-apply-footer {
    padding: 20px 16px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    position: sticky;
    bottom: 0;
}

.apply-panel-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.apply-panel-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.size-category-required {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 20px;
    width: 100%;
}


/* В вашем CSS файле */
.panel-item-wrapper.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.panel-item.disabled {
    cursor: not-allowed;
    color: #999;
}

.panel-item.disabled input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.panel-item.disabled span {
    color: #999;
}

/* =====================================================
   SIZE GRID LAYOUT - Красивая сетка размеров (ACTIVE!)
===================================================== */

/* Контейнер для размеров */
#size-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    padding: 12px;
}

/* Обертка размера */
#size-list .panel-item-wrapper {
    display: block;
    width: 100%;
}

/* 🔥 БАЗОВЫЙ СТИЛЬ (все размеры) */
#size-list .panel-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: #f7f7f7;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 48px;
    font-weight: 500;
    font-size: 14px;
}

/* Скрываем чекбокс */
#size-list .panel-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

/* Текст размера */
#size-list .panel-item span {
    text-align: center;
    line-height: 1.2;
}

/* =====================================================
   🔥 АКТИВНЫЕ РАЗМЕРЫ (НЕ disabled)
===================================================== */

/* АКТИВНЫЕ - яркий фон */
#size-list .panel-item-wrapper:not(.disabled) .panel-item {
    background: linear-gradient(135deg, #fffbf0 0%, #fef4e0 100%);
    border-color: #FFCC33;
    box-shadow: 0 2px 8px rgba(255, 204, 51, 0.2);
}

/* 🔥 HOVER для АКТИВНЫХ */
#size-list .panel-item-wrapper:not(.disabled) .panel-item:hover {
    background: linear-gradient(135deg, #FFCC33 0%, #FFB347 100%) !important;
    border-color: #E6B800 !important;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 204, 51, 0.4);
}

/* 🔥 ВЫБРАННЫЙ АКТИВНЫЙ */
#size-list .panel-item-wrapper:not(.disabled) .panel-item:has(input[type="checkbox"]:checked) {
    background: linear-gradient(135deg, #FF9900 0%, #FFCC33 100%) !important;
    border: 3px solid #E67E22 !important;
    color: #000 !important;
    box-shadow: 0 6px 16px rgba(255, 153, 0, 0.5);
    transform: scale(1.05);
}

#size-list .panel-item-wrapper:not(.disabled) .panel-item:has(input[type="checkbox"]:checked) span {
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* =====================================================
   ❌ НЕАКТИВНЫЕ РАЗМЕРЫ (disabled)
===================================================== */

#size-list .panel-item-wrapper.disabled {
    opacity: 0.4;
}

#size-list .panel-item-wrapper.disabled .panel-item {
    cursor: not-allowed !important;
    background: #fafafa !important;
    border-color: #e0e0e0 !important;
    color: #999;
}

#size-list .panel-item-wrapper.disabled .panel-item:hover {
    transform: none !important;
    box-shadow: none !important;
    background: #fafafa !important;
    border-color: #e0e0e0 !important;
}

/* =====================================================
   АДАПТИВ
===================================================== */

@media (max-width: 576px) {
    #size-list {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 6px;
    }
    
    #size-list .panel-item {
        padding: 10px 6px;
        min-height: 42px;
        font-size: 13px;
    }
}

@media (min-width: 577px) and (max-width: 991px) {
    #size-list {
        grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    }
}

@media (max-width: 360px) {
    #size-list {
        grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
        gap: 5px;
    }
    
    #size-list .panel-item {
        padding: 8px 4px;
        min-height: 38px;
        font-size: 12px;
    }
}


.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.subcat-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.card-thumb {
    width: 100%;
    height: 110px; /* КОНТРОЛИРУЕТ размер изображений */
    border-radius: 10px;
    overflow: hidden;
    background: #f2f2f2;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;   /* 🔥 обрезает красиво, НЕ растягивает */
    display: block;
}

.card-title {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}
.subcat-card .card-title {
    color: #000 !important;
}

/* 🟨 3. При наведении — жёлтый */
.subcat-card:hover .card-title,
.mega-section-title:hover {
    color: #ffcc00 !important;
}


/* ✅ Активная кнопка Sale */
.quick-filter-btn[data-panel="sale"].active-filter-btn {
    background-color: #FFCC33 !important;
    border-color: #FFCC33 !important;
    color: #000000 !important;
}

@media (max-width: 991px) {
  .quick-filter-btn[data-panel="sale"]:not(.active-filter-btn) {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #000000 !important;
    background-image: none !important;
    --x: -999px !important;
    --y: -999px !important;
  }
  
  .mouse-follower {
    display: none !important;
  }
}


@media (max-width: 991px) {
  /* Принудительный сброс для All Filters на мобилках */
  .quick-filter-btn.all-filters-btn {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #000000 !important;
    background-image: none !important;
  }
  
  .mouse-follower {
    display: none !important;
  }
}

.search-hint {
    font-weight: bold;
    text-transform: capitalize;
}