/* ========================================= */
/* 0. ЗМІННІ ТА БАЗА                         */
/* ========================================= */
@import url('../shared/theme.css');

:root {
    --bg: var(--color-bg-dark);
    --card: var(--color-bg-card-alt);
    --border: var(--color-border);
    --accent: var(--color-primary-soft);
    --accent-glow: var(--color-primary-glow);
    --gold: var(--color-warning);
    
    /* Змінні для нового дизайну */
    --sidebar-bg: var(--color-bg-panel);
    --input-bg: var(--color-bg-input);
    
    /* 🔥 Fix for iOS dark mode elements */
    color-scheme: dark;
    --sidebar-gradient: linear-gradient(145deg, var(--color-bg-panel), var(--color-bg-panel-alt));
    --sidebar-border: var(--color-border);
    --surface-hover: var(--color-bg-chip-soft);
    --muted-strong: var(--color-text-strong-muted);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg);
    color: white;
    font-family: 'Inter', 'Montserrat', sans-serif;
    overflow-x: hidden;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.main-content { padding-top: 24px; }
.shop-container { max-width: 1920px; margin: 0 auto; padding: 16px 30px 20px; }
.shop-layout { display: flex; gap: 40px; }

/* ========================================= */
/* 1. НОВИЙ ДИЗАЙН САЙДБАРУ (DESKTOP)        */
/* ========================================= */
.filters-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 20px;
    color: var(--color-text-strong-muted);
    
    position: sticky;
    top: 110px;
    height: fit-content;
    max-height: calc(100vh - 130px);
    overflow-y: hidden;
    transition: all 0.3s ease;
}

/* Приховуємо скролбар контейнера */
.filters-sidebar::-webkit-scrollbar { width: 0px; }

.filter-group { 
    margin-bottom: 20px; 
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.filter-group:last-child { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }

.filter-group h3 { 
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    text-shadow: 0 0 8px var(--color-primary-glow);
}

/* Інпути та селекти */
.filter-input, .filter-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: white;
    padding: 0 12px;
    height: 42px;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}

.filter-input:hover, .filter-select:hover { background: rgba(255, 255, 255, 0.08); }
.filter-input:focus, .filter-select:focus {
    border-color: rgba(139, 92, 246, 0.65);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.filter-select { 
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a2be2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 35px;
}
.filter-select option { background-color: var(--color-bg-input); color: white; padding: 10px; }

.price-filter-row { 
    display: grid; 
    grid-template-columns: 1fr auto 1fr; 
    gap: 10px; 
    align-items: center; 
}
.price-input { text-align: center; }
.price-separator { color: rgba(255, 255, 255, 0.5); font-weight: bold; }

/* ========================================= */
/* СПИСОК КАТЕГОРІЙ (DESKTOP)                */
/* ========================================= */
@media (min-width: 901px) {
    #categorySelect { display: none; }
    .custom-category-container { display: block; }
    .mobile-category-popup { display: none !important; } /* Ховаємо попап на ПК */
}

@media (max-width: 900px) {
    .custom-category-container { display: none !important; }
    #categorySelect { display: block; }
}

.custom-category-container {
    display: flex;
    flex-direction: column;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 10px;
}

.custom-category-container::-webkit-scrollbar { width: 6px; }
.custom-category-container::-webkit-scrollbar-track { background: var(--color-overlay-white-05); border-radius: 3px; }
.custom-category-container::-webkit-scrollbar-thumb { background: var(--color-bg-chip-hover); border-radius: 3px; border: 1px solid var(--sidebar-border); }
.custom-category-container::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.custom-cat-group {
    color: var(--color-text-dim);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.2px;
    margin: 20px 0 10px 15px;
    text-transform: uppercase;
    opacity: 0.8;
    pointer-events: none;
}
.custom-cat-group:first-child { margin-top: 0; }

.custom-cat-item {
    display: flex !important;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 9px 12px;
    border-radius: 12px;
    color: rgba(245, 247, 255, 0.74);
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 4px;
}

.custom-cat-item:hover {
    background: rgba(139, 92, 246, 0.10);
    color: rgba(255, 255, 255, 0.92);
}

.custom-cat-item.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(6, 182, 212, 0.08));
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: #ffffff;
    font-weight: 650;
}

/* ========================================= */
/* 2. КОНТЕНТ ТА ГРІДИ                       */
/* ========================================= */
.shop-content { flex: 1; min-width: 0; }
.products-section { margin-bottom: 50px; }
.section-title { font-size: 1.5rem; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; text-transform: uppercase; font-weight: 800; }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}

.products-grid.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 15px;
}
.products-grid.horizontal-scroll .product-card { min-width: 260px; max-width: 260px; flex-shrink: 0; }
.products-grid.horizontal-scroll::-webkit-scrollbar { height: 6px; }
.products-grid.horizontal-scroll::-webkit-scrollbar-track { background: var(--color-border-faint); border-radius: 10px; }
.products-grid.horizontal-scroll::-webkit-scrollbar-thumb { background: var(--color-bg-chip-hover); border-radius: 10px; }
.products-grid.horizontal-scroll::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ========================================= */
/* 3. КАРТКА ТОВАРУ                          */
/* ========================================= */
.product-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    transition: 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
}

.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px var(--color-overlay-black-50); border-color: var(--accent); }

.image-box {
    width: 100%; aspect-ratio: 16/10; background: var(--color-bg-input-deep); position: relative; overflow: hidden; border-bottom: 1px solid var(--color-border-faint);
}
.image-box img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.product-card:hover .image-box img { transform: scale(1.1); }

.product-info { padding: 15px; flex-grow: 1; display: flex; flex-direction: column; }
.product-info h3 { font-size: 0.95rem; margin-bottom: 6px; font-weight: 700; line-height: 1.4; color: white; }

.seller-name { font-size: 0.75rem; color: var(--color-text-light); margin-bottom: 8px; display: flex; align-items: center; gap: 5px; opacity: 0.7; }
.seller-name i { color: var(--accent); font-size: 0.8rem; }
.description { font-size: 0.75rem; color: var(--color-text-soft); margin-bottom: 15px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.price-row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--color-border-faint); }
.price { font-size: 1.1rem; font-weight: 800; }
.buy-btn {
    padding: 8px 20px; background: var(--accent); color: white; border: none; border-radius: 8px; cursor: pointer;
    font-size: 0.8rem; font-weight: 800; transition: 0.3s; text-transform: uppercase;
}
.buy-btn:hover { background: var(--color-primary); box-shadow: 0 0 15px var(--color-primary-border); transform: translateY(-2px); }

.product-card.premium { border-color: var(--gold); background: radial-gradient(circle at top right, var(--color-warning-haze), transparent 70%), var(--card); }
.product-card.premium .buy-btn { background: var(--gold); color: black; }
.product-card.premium .buy-btn:hover { background: var(--color-warning-soft); box-shadow: 0 0 15px var(--color-warning-glow); }

/* ========================================= */
/* 4. АДАПТИВНІСТЬ (MOBILE) + POPUP ПОВЕРНУВСЯ! */
/* ========================================= */
@media (max-width: 900px) {
    body { padding-top: 70px !important; }
    .main-content { padding-top: 16px !important; }
    .shop-layout { flex-direction: column; gap: 20px; }
    .shop-container { padding: 15px; }

    /* Ховаємо ПК список категорій */
    .custom-category-container { display: none !important; }
    /* Ховаємо старий селект, якщо він є */
    #categorySelect { display: none !important; }

    /* === 🔥 ПОВЕРНЕННЯ МОДАЛЬНОГО ВІКНА (POPUP) 🔥 === */
    /* Оновлений дизайн вікна */
    .mobile-category-popup {
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100%;
        background: var(--color-bg-dark-overlay); /* Напівпрозорий темний фон */
        backdrop-filter: blur(15px); /* Ефект розмиття */
        z-index: 10000;
        display: none; /* JS перемкне на flex */
        flex-direction: column;
        animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .mobile-category-popup.active { display: flex; }
    
    @keyframes slideUp { 
        from { transform: translateY(100%); opacity: 0; } 
        to { transform: translateY(0); opacity: 1; } 
    }

    /* Шапка модального вікна */
    .mobile-popup-header {
        padding: 20px;
        background: var(--color-bg-card-overlay);
        border-bottom: 1px solid var(--color-border-soft);
        display: flex; justify-content: space-between; align-items: center;
        position: sticky; top: 0; z-index: 10;
    }

    .mobile-popup-header h3 { 
        font-size: 1.1rem; color: white; margin: 0; 
        font-family: 'Inter', sans-serif; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
    }

    /* Кнопка закриття */
    .mobile-popup-close {
        background: var(--color-overlay-white-08);
        border: 1px solid var(--color-border-soft);
        color: white;
        width: 36px; height: 36px;
        border-radius: 10px;
        display: flex; align-items: center; justify-content: center;
        cursor: pointer;
        font-size: 1.2rem;
        transition: 0.2s;
    }
    .mobile-popup-close:active { transform: scale(0.9); background: var(--accent); }

    /* Контент вікна */
    .mobile-popup-content { padding: 20px; overflow-y: auto; flex: 1; }

    /* Заголовки груп всередині вікна */
    .mobile-cat-group-title {
        color: var(--accent);
        font-size: 0.75rem; font-weight: 800;
        margin: 20px 0 10px 5px; text-transform: uppercase;
    }
    .mobile-cat-group:first-child .mobile-cat-group-title { margin-top: 0; }

    /* Кнопки категорій всередині вікна */
    .mobile-cat-item {
        display: block; width: 100%; padding: 15px; margin-bottom: 10px;
        background: var(--color-bg-card-deep); 
        border: 1px solid var(--color-overlay-white-08);
        border-radius: 12px; 
        color: white; font-size: 1rem; text-align: left;
        font-family: 'Inter', sans-serif;
    }
    
    .mobile-cat-item:active { background: var(--color-primary-surface); border-color: var(--accent); transform: scale(0.98); }
    .mobile-cat-item.active { background: var(--color-primary-surface); border-color: var(--accent); color: var(--accent); font-weight: 700; }

    /* === РЕШТА ЕЛЕМЕНТІВ САЙДБАРУ (ІНПУТИ) === */
    /* Робимо сайдбар на мобільному прозорим, щоб видно було тільки фільтри (ціна, сорт) */
    .filters-sidebar { 
        width: 100% !important; 
        position: relative !important; top: auto !important;
        padding: 0 !important; margin-bottom: 20px !important; 
        background: transparent !important; border: none !important; 
        box-shadow: none !important; max-height: none !important; overflow: visible !important;
    }
    
    /* Секція КАТЕГОРІЇ - робимо КНОПКОЮ для відкриття POPUP (target by id, not :first-child) */
    #categoryFilterGroup h3 {
        padding: 16px 20px !important; margin: 0 !important;
        background: linear-gradient(90deg, var(--color-primary-surface), var(--color-primary-faint)) !important;
        border: 1px solid var(--color-primary-border-soft) !important;
        border-radius: 12px !important;
        color: var(--accent) !important;
        font-size: 0.95rem !important;
        cursor: pointer;
        display: flex; justify-content: space-between; align-items: center;
        transition: 0.2s;
    }

    #categoryFilterGroup h3:active { transform: scale(0.98); background: var(--accent) !important; color: white !important; }

    /* Додаємо іконку стрілки для кнопки відкриття */
    #categoryFilterGroup h3::after {
        content: '\f054'; /* fa-chevron-right */
        font-family: 'Font Awesome 6 Free'; font-weight: 900;
        font-size: 0.9rem;
    }

    /* Ховаємо стандартний список під заголовком, бо буде відкриватися Popup */
    #categoryFilterGroup > *:not(h3) { display: none !important; }

    /* Пошук + Ціна + Сорт - картки. Пошук завжди відкритий; Ціна/Сорт - акордеони. */
    #shopSearchGroup, #priceFilterGroup, #sortFilterGroup {
        background: var(--color-bg-control-alt) !important;
        border: 1px solid var(--color-overlay-white-08) !important;
        border-radius: 12px; margin-bottom: 12px; overflow: hidden;
    }

    #shopSearchGroup h3, #priceFilterGroup h3, #sortFilterGroup h3 {
        padding: 15px !important; margin: 0 !important;
        background: transparent !important; border-bottom: 1px solid var(--color-border-faint);
        color: white !important; font-size: 0.9rem !important;
    }

    /* Пошук на мобільному лишається видимим (не ховається, не акордеон). */
    #shopSearchGroup .filter-input { margin: 12px 15px 0; width: calc(100% - 30px); }

    .filter-input, .filter-select { background: var(--color-bg-input-deep) !important; border-color: var(--color-overlay-white-15) !important; }
    
    /* СІТКИ ТОВАРІВ */
    #productsGrid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
    #productsGrid .product-card { width: 100% !important; margin: 0 !important; }
    #productsGrid .image-box { aspect-ratio: 1/1 !important; }
    #productsGrid .product-info { padding: 10px !important; }
    #productsGrid h3 { font-size: 0.85rem !important; height: 2.4em; overflow: hidden; }
    #productsGrid .description, #productsGrid .seller-name { display: none !important; }
    #productsGrid .price-row { flex-direction: column !important; align-items: flex-start !important; gap: 5px !important; }
    #productsGrid .buy-btn { width: 100% !important; padding: 8px 0 !important; font-size: 0.75rem !important; }
    
    #donationGrid, #popularGrid, #recommendedGrid {
        display: flex !important; overflow-x: scroll !important; gap: 12px !important; padding-right: 20px;
    }
    #donationGrid .product-card { min-width: 200px !important; }
}

/* ========================================= */
/* 768px: одна колонка, відступи, типографіка */
/* ========================================= */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        width: 100%;
    }

    .main-content {
        width: 100%;
        overflow-x: hidden;
    }

    .shop-container {
        width: 100%;
        max-width: 100%;
        padding: 14px 16px 24px;
        box-sizing: border-box;
    }

    .shop-layout {
        flex-direction: column;
        gap: 18px;
    }

    .filters-sidebar,
    .shop-content,
    .products-section,
    .product-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .shop-container img {
        max-width: 100%;
        height: auto;
    }

    .products-grid,
    #productsGrid,
    .products-grid.horizontal-scroll,
    #donationGrid,
    #popularGrid,
    #recommendedGrid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        overflow-x: visible !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
    }

    .products-grid .product-card,
    #productsGrid .product-card,
    .products-grid.horizontal-scroll .product-card,
    #donationGrid .product-card,
    #popularGrid .product-card,
    #recommendedGrid .product-card {
        width: 100% !important;
        max-width: 100%;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    .products-grid .image-box,
    #productsGrid .image-box,
    .products-grid.horizontal-scroll .image-box {
        aspect-ratio: 16 / 10 !important;
    }

    #productsGrid .product-info {
        padding: 14px !important;
    }

    #productsGrid h3 {
        height: auto;
        overflow: visible;
        font-size: 0.95rem !important;
    }

    .image-box .category-pill {
        max-width: calc(100% - 20px);
        display: inline-block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .product-info {
        padding: 14px !important;
    }

    .product-info h3 {
        font-size: 0.95rem !important;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .section-title {
        font-size: 1.1rem !important;
        line-height: 1.25;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 8px;
        overflow-wrap: anywhere;
    }

    .filter-group {
        margin-bottom: 16px;
        padding-bottom: 14px;
    }

    .price-filter-row {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        gap: 10px;
    }

    .price-separator {
        display: block;
    }

    .price-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    #productsGrid .price-row {
        align-items: stretch !important;
        gap: 10px !important;
    }

    .price {
        font-size: 1rem;
    }

    .buy-btn,
    #loadMoreContainer .load-more-btn,
    .mobile-cat-item,
    #categoryFilterGroup h3,
    #shopSearchGroup h3,
    #priceFilterGroup h3,
    #sortFilterGroup h3 {
        min-height: 44px;
    }

    .buy-btn {
        width: 100% !important;
        padding: 12px 16px !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.85rem !important;
    }

    #productsGrid .buy-btn {
        padding: 12px 16px !important;
        font-size: 0.85rem !important;
    }

    .filter-input,
    .filter-select {
        width: 100%;
        box-sizing: border-box;
        min-height: 44px;
        padding-left: 14px;
        padding-right: 14px;
    }

    #loadMoreContainer {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .shop-container {
        padding: 10px 14px 20px;
    }

    .shop-layout {
        gap: 14px;
    }

    .filters-sidebar {
        margin-bottom: 16px !important;
    }

    #categoryFilterGroup h3 {
        padding: 14px 16px !important;
        font-size: 0.88rem !important;
    }

    #shopSearchGroup h3, #priceFilterGroup h3, #sortFilterGroup h3 {
        padding: 14px 16px !important;
        font-size: 0.85rem !important;
    }

    .mobile-popup-header {
        padding: 16px;
    }

    .mobile-popup-header h3 {
        font-size: 1rem;
        letter-spacing: 0.6px;
    }

    .mobile-popup-content {
        padding: 16px 14px 20px;
    }

    .mobile-cat-item {
        padding: 14px;
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1rem !important;
        margin-bottom: 16px;
    }

    .product-info {
        padding: 12px !important;
    }

    #productsGrid .product-info {
        padding: 12px !important;
    }

    .product-info h3 {
        font-size: 0.9rem !important;
    }

    #productsGrid h3 {
        font-size: 0.9rem !important;
    }

    .price {
        font-size: 0.95rem;
    }

    .buy-btn {
        padding: 11px 14px !important;
        font-size: 0.8rem !important;
    }

    #productsGrid .buy-btn {
        padding: 11px 14px !important;
        font-size: 0.8rem !important;
    }

    .filter-input,
    .filter-select {
        font-size: 16px;
    }

    .price-filter-row {
        gap: 8px;
    }
}

/* ========================================= */
/* 5. SHOP UI UPGRADE (SEARCH, ACTIVE FILTERS, PRODUCT CARDS, QUICK VIEW) */
/* ========================================= */

/* Reset Button */
.reset-filters-btn {
    width: 100%;
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-strong-muted);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.reset-filters-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    color: white;
    border-color: rgba(139, 92, 246, 0.4);
}

/* Category Counts */
.cat-count {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    transition: 0.3s;
}
.custom-cat-item.active .cat-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* Active Filters Bar */
.active-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}
.filter-chip {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.filter-chip span { opacity: 0.7; font-weight: 400; }
.filter-chip button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.6;
    display: flex;
    align-items: center;
    transition: 0.2s;
}
.filter-chip button:hover { opacity: 1; color: #ff4444; }
.reset-all-chip {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--color-text-strong-muted);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
}
.reset-all-chip:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Product Card Upgrades */
.wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
}
.wishlist-btn:hover { background: rgba(0, 0, 0, 0.6); transform: scale(1.1); }
.wishlist-btn.active { color: #ff4444; }
.wishlist-btn.active i { font-weight: 900; }

.product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.card-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
}
.badge-instant { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-rcon { background: rgba(59, 130, 246, 0.15); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-manual { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-verified { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; border: 1px solid rgba(139, 92, 246, 0.3); }

/* Quick View Modal */
.qv-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}
.qv-modal.active { display: flex; }
.qv-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}
.qv-content {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    animation: qvScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
@keyframes qvScale { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.qv-close {
    position: absolute;
    top: 20px; right: 20px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
    z-index: 10;
}
.qv-close:hover { background: rgba(255,255,255,0.2); transform: rotate(90deg); }

.qv-layout {
    display: flex;
    flex-direction: row;
}
.qv-image-side {
    width: 50%;
    background: var(--color-bg-input-deep);
}
.qv-image-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.qv-info-side {
    width: 50%;
    padding: 40px;
    display: flex;
    flex-direction: column;
}
.qv-info-side h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 800;
    line-height: 1.3;
}
.qv-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--color-text-soft);
}
.qv-meta span { display: flex; align-items: center; gap: 5px; }
.qv-meta i { color: var(--accent); }
.qv-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
}
.qv-info-list {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.qv-info-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 6px;
}
.qv-info-item .label { color: var(--color-text-soft); }
.qv-info-item .val { font-weight: 700; }
.qv-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: auto;
}
.qv-actions button {
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.qv-btn-primary { background: var(--accent); color: white; border: none; grid-column: 1 / -1; }
.qv-btn-primary:hover { background: var(--color-primary); transform: translateY(-2px); box-shadow: 0 5px 15px var(--color-primary-glow); }
.qv-btn-secondary { background: rgba(255,255,255,0.05); color: white; border: 1px solid rgba(255,255,255,0.1); }
.qv-btn-secondary:hover { background: rgba(255,255,255,0.1); }
.qv-btn-outline { background: transparent; color: white; border: 1px solid rgba(255,255,255,0.2); grid-column: 1 / -1; }
.qv-btn-outline:hover { background: rgba(255,255,255,0.05); }

/* Grid Loading */
.products-grid.loading {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Mobile Accordion Fix & Responsive Quick View */
@media (max-width: 900px) {
    .filter-group.collapsed > *:not(h3) {
        display: none !important;
    }

    #priceFilterGroup h3, #sortFilterGroup h3 {
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    #priceFilterGroup h3::after, #sortFilterGroup h3::after {
        content: '\f078';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        transition: transform 0.25s ease;
    }

    #priceFilterGroup:not(.collapsed) h3::after,
    #sortFilterGroup:not(.collapsed) h3::after {
        transform: rotate(180deg);
    }
    
    .qv-layout {
        flex-direction: column;
    }
    .qv-image-side {
        width: 100%;
        height: 250px;
    }
    .qv-info-side {
        width: 100%;
        padding: 25px;
    }
    .qv-info-side h2 { font-size: 1.25rem; }
    .qv-actions { display: flex; flex-direction: column; }
}
