/* =========================================
   КАТАЛОГ СТИЛІ
   ========================================= */
.catalog-main {
    padding-top: 40px;
    z-index: 10;
}

.catalog-glow {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 60vw;
    height: 60vh;
    background: radial-gradient(ellipse at top, rgba(255, 230, 0, 0.05) 0%, transparent 60%);
    filter: blur(150px);
    pointer-events: none;
    z-index: 1;
}

/* Сайдбар */
.sidebar-col {
    position: sticky;
    top: 140px;
}

.filter-sidebar {
    border-radius: 24px;
    background: rgba(20, 36, 23, 0.5);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(253, 251, 237, 0.08);
}

.filter-title {
    font-family: 'Benzin', sans-serif;
    font-size: 1.2rem;
    color: #ffffff;
    text-transform: uppercase;
}

.filter-reset {
    background: none;
    border: none;
    color: rgba(253, 251, 237, 0.5);
    font-family: 'Codec Pro', sans-serif;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 700;
    transition: color 0.3s;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.filter-reset:hover {
    color: var(--z-yellow);
}

.mobile-filter-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.filter-subtitle {
    font-family: 'Codec Pro', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: rgba(253, 251, 237, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.filter-header {
    cursor: pointer;
    user-select: none;
    padding-bottom: 12px!important;
    border-bottom: 1px solid rgba(253, 251, 237, 0.08);
}
.accordion-arrow {
    transition: transform 0.3s ease;
}
.accordion-group.is-open .accordion-arrow {
    transform: rotate(180deg);
}

/* Фільтр ціни */
.price-input {
    background: rgba(20, 36, 23, 0.6) !important;
    border: 1px solid rgba(253, 251, 237, 0.15) !important;
    color: #ffffff !important;
    font-family: monospace;
    font-size: 15px;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
}

.price-input::placeholder {
    color: #ffffff !important;
}

.price-input:focus {
    border-color: var(--z-yellow) !important;
    box-shadow: 0 0 0 3px rgba(255, 230, 0, 0.1) !important;
}

.price-input::-webkit-outer-spin-button,
.price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.price-input {
    -moz-appearance: textfield;
}

.btn-price-ok {
    background: rgba(253, 251, 237, 0.1);
    border: 1px solid rgba(253, 251, 237, 0.2);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    transition: all 0.3s;
}

.btn-price-ok:hover {
    background: var(--z-yellow);
    color: var(--z-dark);
    border-color: var(--z-yellow);
}

.price-slider-visual {
    position: relative;
    height: 4px;
    background: rgba(253, 251, 237, 0.1);
    border-radius: 4px;
    margin-top: 20px;
    margin-bottom: 10px;
}

.price-range {
    position: absolute;
    height: 100%;
    background: var(--z-yellow);
    border-radius: 4px;
}

.price-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #ffffff;
    border: 2px solid var(--z-yellow);
    border-radius: 50%;
    cursor: pointer;
}

/* Чекбокси */
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    position: relative;
    padding-left: 32px;
    cursor: pointer;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: rgba(253, 251, 237, 0.05);
    border: 1px solid rgba(253, 251, 237, 0.2);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.custom-checkbox:hover input ~ .checkmark {
    border-color: rgba(255, 230, 0, 0.5);
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: var(--z-yellow);
    border-color: var(--z-yellow);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid var(--z-dark);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.check-label {
    font-family: 'Codec Pro', sans-serif;
    font-size: 15px;
    color: rgba(253, 251, 237, 0.7);
    transition: color 0.2s;
}

.custom-checkbox input:checked ~ .check-label {
    color: #ffffff;
    font-weight: 700;
}

/* Топ бар */
.search-input {
    background: var(--card-background) !important;
    border: 1px solid rgba(253, 251, 237, 0.1) !important;
    color: #ffffff !important;
    padding: 12px 20px 12px 48px;
    border-radius: 100px;
    font-family: 'Codec Pro', sans-serif;
}

.search-input::placeholder { color: white !important; }
.search-input:focus { border-color: var(--z-yellow) !important; box-shadow: 0 0 0 3px rgba(255, 230, 0, 0.1) !important; }

.search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
}

.search-icon {
    color: rgba(253, 251, 237, 0.5);
}

.mobile-filter-toggle {
    background: rgba(253, 251, 237, 0.03);
    border: 1px solid rgba(253, 251, 237, 0.1);
    color: #ffffff;
    padding: 10px 24px;
    border-radius: 100px;
    font-size: 14px;
    font-family: 'Codec Pro', sans-serif;
    font-weight: 700;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    text-decoration: none;
    display: none;
    align-items: center;
    cursor: pointer;
}

#mobile-filter-close {
    display: none;
}

@media (max-width: 991px) {
    #mobile-filter-close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 15px;
        right: 15px;
        background: transparent;
        border: none;
        color: #fff;
        padding: 5px;
        cursor: pointer;
        z-index: 10;
    }
}

.custom-select-clean {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    background: var(--card-background);
    border: 1px solid rgba(253, 251, 237, 0.1);
    color: #ffffff;
    padding: 12px 48px 12px 20px;
    border-radius: 100px;
    font-family: 'Codec Pro', sans-serif;
    font-size: 15px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.custom-select-clean:focus,
.custom-select-clean:hover { border-color: var(--z-yellow); }
.custom-select-clean:focus { box-shadow: 0 0 0 3px rgba(255, 230, 0, 0.1); }

.custom-select-clean option {
    background: var(--z-green-dark);
    color: #ffffff;
}

.select-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Картки товарів */
.product-card {
    border-radius: 24px;
    overflow: hidden;
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    background: rgba(20, 36, 23, 0.4);
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 230, 0, 0.3);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 0 20px rgba(255,230,0,0.1);
    background: rgba(20, 36, 23, 0.8);
}

.card-visual {
    overflow: hidden;
    border-bottom: 1px solid rgba(253, 251, 237, 0.05);
    padding: 12px;
}

.card-image-overlay {
    padding-top: 100%;
    width: 100%;
    height: 0;
    position: relative;
}

.card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .card-img { transform: scale(1.08); }

.card-title { margin-bottom: 12px; }
.card-title a {
    font-family: 'Codec Pro', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
    height: calc(25.2px * 3);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s;
}

.card-title a:hover { color: var(--z-yellow); }

.card-rating { display: flex; align-items: center; gap: 10px; }
.stars { display: flex; gap: 3px; }
.stars svg { width: 16px; height: 16px; color: var(--z-yellow); }

.rating-val {
    font-size: 14px;
    font-weight: 700;
    color: rgba(253, 251, 237, 0.7);
    font-family: monospace;
}

/* =========================================================================
   БАНЕР-ОВЕРЛЕЙ ДЛЯ НОВИНОК (Floating New Badge)
   ========================================================================= */
.card-labels-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 3;
    pointer-events: none;
}

.badge-overlay.new {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 8px;
    background: rgb(255 230 0 / 20%);
    color: var(--z-yellow);
    border: 1px solid rgb(255 230 0 / 25%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Фиксируем высоту строки рейтинга, чтобы выравнивать теги */
.card-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 20px;
    margin-bottom: 12px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 4px;
}

.tag {
    padding: 4px 18px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.tag-hit { background: var(--z-yellow); color: var(--z-dark); }
.tag-tech { background: rgba(0, 191, 165, 0.15); color: #00BFA5; border: 1px solid rgba(0, 191, 165, 0.3); }
.tag-outline { background: transparent; color: rgba(253, 251, 237, 0.9); border: 1px solid rgba(253, 251, 237, 0.3); }

.card-tags .tag-state-new {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    backdrop-filter: blur(4px);
}

.card-tags .tag-state-new::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #10B981;
    margin-right: 5px;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
}

.card-tags .tag-used {
    background: rgba(245, 158, 11, 0.15);
    color: #FBBF24;
    border: 1px solid rgba(245, 158, 11, 0.3);
    backdrop-filter: blur(4px);
}

.card-tags .tag-used::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.8);
    background-color: #FBBF24;
    margin-right: 4px;
}

.product-card:hover .tag-state-new {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.5);
}

.product-card:hover .tag-used {
    background: rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.5);
}

.card-footer {
    border-top: 1px solid rgba(253, 251, 237, 0.08);
    padding-top: 24px;
}

/* =========================================================================
   БЛОК ЦІНИ ТА ЗНИЖОК (Price & Discount Styles)
   ========================================================================= */
.price-block {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 48px;
}

/* Общие стили для актуальной цены (как со скидкой, так и без) */
.price-block .current-price {
    font-family: 'Benzin', sans-serif;
    font-size: 24px;
    font-weight: 900;
    color: var(--z-yellow);
    letter-spacing: -0.02em;
    line-height: 1;
}

/* Стили для старой зачеркнутой цены, когда активирована скидка */
.price-block.has-discount {
    min-height: 48px;  /* Высота остается неизменной, сетка не едет */
}

.price-block .old-price {
    font-family: 'Benzin', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: rgba(253, 251, 237, 0.4); /* Приглушенный белый */
    text-decoration: line-through;
    text-decoration-color: rgba(255, 230, 0, 0.6); /* Аккуратная желтая линия зачеркивания */
    line-height: 1;
    margin-bottom: 2px;
}

.btn-cart {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(253, 251, 237, 0.2);
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-card:hover .btn-cart {
    background: var(--z-yellow);
    border-color: var(--z-yellow);
    color: var(--z-dark);
}

/* Пагінація */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.pagination-custom {
    display: flex;
    gap: 8px;
}

.pagination-custom li {
    list-style: none;
}

.pagination-custom li::marker {
    content: none;
}

.page-btn, .pagination-custom li.disabled {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--card-background);
    border: 1px solid rgba(253, 251, 237, 0.15);
    color: #ffffff;
    font-family: 'Benzin', sans-serif;
    font-size: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.pagination-custom li.disabled {
    color: #fdfbedb1;
}

.page-btn:hover {
    border-color: var(--z-yellow);
    color: var(--z-yellow);
    background: rgba(255, 230, 0, 0.05);
}

.pagination-custom li.active .page-btn {
    background: var(--z-yellow);
    border-color: var(--z-yellow);
    color: var(--z-dark);
    pointer-events: none;
}

.page-dots {
    color: rgba(253, 251, 237, 0.5);
    font-weight: 800;
    padding: 0 8px;
    font-size: 19px;
}

/* Адаптив */
@media (max-width: 991.98px) {
    .sidebar-col {
        padding: 0;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 99999;
        width: 100%;
        height: 100%;
        transform: translateX(-100%);
        transition: 0.5s;
        overflow-y: auto;
    }

    .sidebar-col.opened {
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .product-card {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        border-bottom: 1px solid rgba(253, 251, 237, 0.1) !important;
        border-radius: 0 !important;
    }

    .filter-sidebar {
        border-radius: 0;
        border: none;
    }

    .card-body { padding: 16px 0; }

    .sort-box span {
        display: none;
    }
}

/* =========================================================================
   ПОВНИЙ НАБІР АДАПТИВНИХ СТИЛІВ ДЛЯ КАТАЛОГУ
   ========================================================================= */

/* Адаптив для планшетів та мобільних пристроїв (до 991.98px) */
@media (max-width: 991.98px) {
    .catalog-main {
        padding-top: 20px;
    }

    /* Перетворення сайдбару на повноекранне мобільне меню */
    .sidebar-col {
        background: var(--card-background) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        padding: 20px !important;
        box-sizing: border-box;
        height: 100%;
        overflow-y: auto;
    }

    .filter-sidebar {
        background: transparent !important;
        border: none !important;
        backdrop-filter: none !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    /* Кнопка закриття мобільного сайдбару */
    #mobile-filter-close {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 20px;
        right: 20px;
        width: 36px;
        height: 36px;
        background: rgba(253, 251, 237, 0.05);
        border: 1px solid rgba(253, 251, 237, 0.1);
        border-radius: 50%;
        color: #ffffff;
        cursor: pointer;
        z-index: 999;
        transition: background 0.3s;
    }

    #mobile-filter-close:active {
        background: rgba(255, 230, 0, 0.2);
    }

    .filter-title {
        font-size: 1rem;
        margin-bottom: 20px;
        padding-right: 40px;
    }
}

/* Адаптив для смартфонів (до 768px) */
@media (max-width: 768px) {
    /* Топ бар каталогу (пошук, сортування, кнопка фільтрів) */
    .catalog-top-bar {
        gap: 12px !important;
    }

    .search-input {
        font-size: 14px !important;
        padding: 10px 16px 10px 42px !important;
    }

    .search-submit {
        left: 14px !important;
    }

    .select-wrapper {
        width: 100%;
    }

    .custom-select-clean {
        font-size: 14px !important;
        padding: 10px 36px 10px 16px !important;
    }

    .select-arrow {
        right: 14px !important;
        width: 10px;
    }

    .mobile-filter-toggle {
        display: flex;
        padding: 10px 20px !important;
        font-size: 13px !important;
    }

    /* Ефект світіння (Glow) */
    .catalog-glow {
        width: 90vw !important;
        height: 40vh !important;
        filter: blur(80px) !important;
    }

    /* =========================================================================
       КАРТКА ТОВАРУ (Оптимізація під дві колонки на мобільних)
       ========================================================================= */
    .product-card {
        padding: 12px !important;
        border-radius: 16px !important;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        border: 1px solid rgba(253, 251, 237, 0.1)!important;
    }

    .card-visual {
        padding: 8px !important;
    }

    .card-body {
        padding: 8px 0 0 0 !important;
        display: flex;
        flex-direction: column;
        flex-grow: 1;
    }

    /* Назва товару */
    .card-title {
        margin-bottom: 6px !important;
    }

    .card-title a {
        font-size: 10px !important;
        line-height: 1.25 !important;
        height: calc(10px * 3 * 1.25) !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 3 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-transform: uppercase;
        font-weight: 800;
        letter-spacing: -0.01em;
    }

    /* Бейдж "Новинка" поверх фото */
    .badge-overlay.new {
        font-size: 9px !important;
        padding: 4px 8px !important;
        top: 10px !important;
        left: 10px !important;
    }

    /* Рейтинг зірочками */
    .card-rating {
        height: 16px !important;
        margin-bottom: 8px !important;
        gap: 6px !important;
    }

    .stars svg {
        width: 12px !important;
        height: 12px !important;
    }

    .rating-val {
        font-size: 12px !important;
    }

    /* Блок тегів (Хіт продажу, Топ для вулиці і т.д.) */
    .card-tags {
        display: flex;
        flex-direction: column; /* Теги вертикально один під одним */
        gap: 8px !important;
        margin-bottom: 12px !important;
        margin-top: auto; /* Притискає теги до нижньої частини перед ціною */
    }

    .card-labels-overlay {
        top: 0;
        left: 0;
    }

    .tag {
        display: inline-block;
        align-self: flex-start; /* Ширина строго по тексту */
        padding: 3px 8px !important;
        font-size: 8px !important;
        font-weight: 800;
        letter-spacing: 0.03em;
        line-height: 1.1;
        border-radius: 4px !important;
        white-space: nowrap;
    }

    /* Секція ціни та кнопки дії */
    .card-footer {
        border-top: 1px solid rgba(253, 251, 237, 0.05) !important;
        padding-top: 10px !important;
        margin-top: 0 !important;
        display: flex !important;
        flex-direction: row !important; /* Ціна і кнопка в один рядок */
        justify-content: space-between !important;
        align-items: center !important;
        gap: 4px !important;
    }

    /* Блок ціни */
    .price-block {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: auto !important;
        flex-grow: 1;
    }

    .price-block .current-price {
        font-size: 16px !important; /* Оптимальний розмір, щоб ціна не розривалася */
        font-weight: 900;
        line-height: 1.1 !important;
        white-space: nowrap;
    }

    .price-block .old-price {
        font-size: 11px !important;
        line-height: 1.1 !important;
        margin-bottom: 1px !important;
        white-space: nowrap;
    }

    /* Кнопка додавання до кошика */
    .btn-cart {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .btn-cart svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* Селектор кількості (коли товар вже в кошику) */
    .qty-selector.in-card {
        height: 36px !important;
        border-radius: 100px !important;
        padding: 2px 6px !important;
        gap: 4px !important;
    }

    .qty-btn {
        width: 24px !important;
        height: 24px !important;
        font-size: 12px !important;
    }

    .qty-val {
        font-size: 12px !important;
    }

    /* Пагінація */
    .pagination-wrapper {
        margin-top: 30px !important;
        padding-top: 10px !important;
    }

    .page-btn {
        width: 38px !important;
        height: 38px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
    }
}