/* ========== Archive Products Page ========== */

.archive-products {
    padding: 40px 0 60px;
    background: #f8f9fa;
}

/* Dark theme */
.archive-products {
    background: #070b12;
    color: #f8fafc;
}

.archive-products .archive-header,
.sidebar-inner,
.woocommerce-sorting,
.filter-toggle-btn {
    background: #111827;
    border-color: #263247;
    color: #f8fafc;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .26);
}

.archive-title,
.filter-card__title,
.woocommerce-result-count {
    color: #f8fafc;
}

.archive-description,
.filter-hint,
.filter-empty {
    color: #a7b4c8;
}

.filter-option,
.price-filter-grid input,
.woocommerce-ordering select {
    background: #0b111c;
    border-color: #263247;
    color: #f8fafc;
}

.filter-option:hover,
.filter-option:has(input:checked) {
    background: #0d1b2f;
    border-color: #3b82f6;
}

.filter-reset {
    background: #162033;
    color: #cbd5e1;
}

.sidebar-overlay.active {
    background: rgba(2, 6, 23, .74);
}

.archive-header {
    text-align: center;
    margin-bottom: 40px;
}

.archive-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.archive-description {
    color: #6c757d;
    font-size: 15px;
}

/* Filter Toggle Button (Mobile) */
.filter-toggle-btn {
    display: none;
    width: 100%;
    background: #fff;
    border: 1px solid #e9ecef;
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
}

.filter-toggle-btn i {
    margin-left: 8px;
}

/* Archive Layout */
.archive-layout {
    display: flex;
    gap: 30px;
}

/* Sidebar - Right */
.shop-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.sidebar-inner {
    position: sticky;
    top: 100px;
}

.sidebar-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #adb5bd;
}

/* Widgets */
.widget {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

/* Categories Widget */
.widget_product_categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget_product_categories li {
    margin-bottom: 10px;
}

.widget_product_categories li a {
    text-decoration: none;
    color: #495057;
    font-size: 14px;
    transition: color 0.2s;
}

.widget_product_categories li a:hover {
    color: #3b82f6;
}

.widget_product_categories .count {
    color: #adb5bd;
    font-size: 12px;
    margin-right: 5px;
}

.widget_product_categories .children {
    margin-right: 15px;
    margin-top: 8px;
}

/* Price Filter Widget */
.price_slider_wrapper .price_slider {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    margin: 20px 0;
}

.price_slider_wrapper .ui-slider-range {
    background: #3b82f6;
    height: 4px;
}

.price_slider_wrapper .ui-slider-handle {
    width: 16px;
    height: 16px;
    background: #fff;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    top: -6px;
}

.price_slider_amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.price_slider_amount .price_label {
    font-size: 13px;
    color: #495057;
}

.price_slider_amount .button {
    background: #1a1a2e;
    color: #fff;
    border: none;
    padding: 6px 15px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
}

/* Brand List & Stock Status */
.brand-list, .stock-status {
    list-style: none;
    padding: 0;
    margin: 0;
}

.brand-list li, .stock-status li {
    margin-bottom: 10px;
}

.brand-list label, .stock-status label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
}

.brand-list input, .stock-status input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.brand-list span, .stock-status span {
    color: #adb5bd;
    font-size: 12px;
    margin-right: auto;
}

/* Main Content Area */
.content-area {
    flex: 1;
    min-width: 0;
}

/* WooCommerce Sorting */
.woocommerce-sorting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.woocommerce-result-count {
    font-size: 14px;
    color: #6c757d;
}

.woocommerce-ordering select {
    padding: 8px 30px 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

/* Product Card */
.product-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.product-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f8f9fa;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.badge-sale, .badge-featured {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.badge-featured {
    background: #3b82f6;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 12px 12px 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    margin: 0 12px 8px;
}

.product-price .price {
    font-size: 16px;
    font-weight: 700;
    color: #3b82f6;
}

.product-price .old-price {
    font-size: 13px;
    color: #adb5bd;
    text-decoration: line-through;
    margin-left: 8px;
}

.product-rating-mini {
    margin: 0 12px 12px;
}

.stars {
    display: flex;
    gap: 2px;
    font-size: 11px;
    color: #fbbf24;
}

.stars .far {
    color: #dee2e6;
}

/* Pagination */
.woocommerce-pagination {
    text-align: center;
    margin-top: 30px;
}

.woocommerce-pagination .page-numbers {
    display: inline-flex;
    gap: 8px;
    list-style: none;
    padding: 0;
}

.woocommerce-pagination .page-numbers li a,
.woocommerce-pagination .page-numbers li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    text-decoration: none;
    color: #495057;
    font-size: 14px;
    transition: all 0.2s;
}

.woocommerce-pagination .page-numbers li a:hover,
.woocommerce-pagination .page-numbers li span.current {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .archive-products {
        padding: 20px 0 40px;
    }
    
    .archive-title {
        font-size: 24px;
    }
    
    .filter-toggle-btn {
        display: block;
    }
    
    .archive-layout {
        position: relative;
    }
    
    .shop-sidebar {
        position: fixed;
        top: 0;
        right: -320px;
        width: 300px;
        height: 100vh;
        z-index: 1601;
        transition: right 0.3s ease;
    }
    
    .shop-sidebar.active {
        right: 0;
    }
    
    .sidebar-inner {
        position: relative;
        top: 0;
        height: 100%;
        overflow-y: auto;
        background: #fff;
    }
    
    .sidebar-header {
        display: flex;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 10;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1600;
        visibility: hidden;
        opacity: 0;
        transition: all 0.3s ease;
    }
    
    .sidebar-overlay.active {
        visibility: visible;
        opacity: 1;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .woocommerce-sorting {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .woocommerce-ordering select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .product-title {
        font-size: 12px;
        margin: 8px 8px 4px;
    }
    
    .product-price .price {
        font-size: 13px;
    }
    
    .product-price {
        margin: 0 8px 6px;
    }
    
    .product-rating-mini {
        margin: 0 8px 10px;
    }
}

/* Modern product archive overhaul */
.archive-products {
    background: #f5f7fa;
}

.archive-products .archive-header {
    display: grid;
    gap: 8px;
    max-width: 760px;
    margin-inline: auto;
    margin-bottom: 28px;
}

.archive-layout {
    align-items: flex-start;
}

.shop-sidebar {
    width: 300px;
}

.sidebar-inner {
    background: #fff;
    border: 1px solid #e6ebf2;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
}

.nix-product-filter {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.filter-card {
    display: grid;
    gap: 10px;
}

.filter-card__title {
    margin: 0;
    color: #111827;
    font-size: 14px;
    font-weight: 900;
}

.filter-options {
    display: grid;
    gap: 8px;
    max-height: 330px;
    overflow: auto;
    padding-inline-end: 2px;
}

.filter-option {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #e6ebf2;
    border-radius: 10px;
    background: #fbfcfe;
    color: #334155;
    cursor: pointer;
    font-size: 13px;
    transition: border-color .18s ease, background .18s ease;
}

.filter-option:hover,
.filter-option:has(input:checked) {
    border-color: #93c5fd;
    background: #eff6ff;
}

.filter-option input {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

.filter-option small {
    color: #94a3b8;
    font-size: 11px;
}

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

.price-filter-grid label {
    display: grid;
    gap: 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.price-filter-grid input,
.woocommerce-ordering select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #e6ebf2;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    font-family: inherit;
    padding: 9px 11px;
}

.filter-hint,
.filter-empty {
    margin: 0;
    color: #94a3b8;
    font-size: 11px;
}

.filter-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.filter-submit,
.filter-reset {
    min-height: 40px;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
}

.filter-submit {
    background: #2563eb;
    color: #fff;
}

.filter-reset {
    padding-inline: 12px;
    background: #eef2f7;
    color: #475569;
}

.nix-product-filter.is-loading {
    opacity: .62;
    pointer-events: none;
}

.woocommerce-sorting {
    padding: 12px;
    border: 1px solid #e6ebf2;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 16px;
}

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

.product-card {
    display: grid;
    grid-template-rows: auto auto auto auto 1fr;
    border: 1px solid #e6ebf2;
    border-radius: 12px;
    box-shadow: none;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, .08);
}

.product-title a {
    color: inherit;
    text-decoration: none;
}

.product-add-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    margin: 0 12px 12px;
    border-radius: 10px;
    background: #0f172a;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 900;
    transition: background .18s ease, transform .18s ease;
}

.product-add-cart:hover {
    background: #2563eb;
    color: #fff;
}

.product-add-cart--details {
    background: #eef2f7;
    color: #334155;
}

.product-filter-empty {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .sidebar-inner {
        border-radius: 0;
        height: 100%;
    }

    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Final archive product card redesign */
.archive-products {
    background: #f8fafc;
}

.archive-products .archive-header {
    text-align: right;
    max-width: none;
    padding: clamp(18px, 3vw, 26px);
    border: 1px solid #e8edf3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
}

.archive-title {
    color: #0f172a;
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    font-weight: 900;
}

.archive-description {
    max-width: 760px;
    color: #64748b;
    line-height: 1.9;
}

.archive-layout {
    gap: 22px;
}

.woocommerce-sorting {
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

.woocommerce-result-count {
    margin: 0;
    color: #475569;
    font-weight: 750;
}

.products-grid.woocommerce-products-grid,
.products-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    align-items: stretch;
    gap: 18px;
}

.product-card {
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    border: 1px solid #e7edf5;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    border-color: #bfdbfe;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.1);
}

.product-image {
    display: block;
    aspect-ratio: 1 / 0.86;
    padding: 14px;
    background: #f8fafc;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.badge-sale,
.badge-featured {
    top: 12px;
    right: 12px;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 0.7rem;
    font-weight: 900;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.product-card__body {
    min-width: 0;
    padding: 13px 13px 10px;
    display: grid;
    align-content: start;
    gap: 8px;
}

.product-card__category {
    width: fit-content;
    max-width: 100%;
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-title {
    min-height: 48px;
    margin: 0;
    color: #0f172a;
    font-size: 0.91rem;
    font-weight: 850;
    line-height: 1.65;
}

.product-title a {
    display: -webkit-box;
    color: inherit;
    text-decoration: none;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    margin: 0;
    color: #0f766e;
}

.product-price .price,
.product-price ins,
.product-price bdi {
    color: #0f766e;
    font-size: 0.95rem;
    font-weight: 900;
    text-decoration: none;
}

.product-price del,
.product-price del bdi {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 650;
}

.product-rating-mini {
    margin: 0;
    min-height: 18px;
}

.product-rating-mini .star-rating {
    float: none;
    color: #f59e0b;
    font-size: 0.78rem;
}

.product-card__stock {
    width: fit-content;
    min-height: 24px;
    padding: 2px 8px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #ecfdf5;
    color: #059669;
    font-size: 0.72rem;
    font-weight: 850;
}

.product-card__stock.is-out {
    background: #fef2f2;
    color: #dc2626;
}

.product-add-cart {
    min-height: 42px;
    margin: 0 13px 13px;
    border-radius: 8px;
    background: #0f172a;
    font-size: 0.82rem;
}

.product-add-cart i {
    font-size: 0.9rem;
}

.product-add-cart:hover,
.product-add-cart.adding,
.product-add-cart.added {
    background: #2563eb;
    transform: translateY(-1px);
}

.product-add-cart--details {
    background: #f1f5f9;
    color: #334155;
}

@media (max-width: 560px) {
    .products-grid.woocommerce-products-grid,
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .product-image {
        padding: 10px;
    }

    .product-card__body {
        padding: 10px;
        gap: 6px;
    }

    .product-title {
        min-height: 44px;
        font-size: 0.78rem;
    }

    .product-add-cart {
        min-height: 38px;
        margin: 0 10px 10px;
        font-size: 0.75rem;
    }
}

/* Dark theme final pass */
.archive-products { background: #070b12; color: #f8fafc; }
.archive-products .archive-header,
.sidebar-inner,
.woocommerce-sorting,
.filter-toggle-btn { background: #111827; border-color: #263247; color: #f8fafc; box-shadow: 0 16px 40px rgba(0, 0, 0, .26); }
.archive-title,
.filter-card__title,
.woocommerce-result-count { color: #f8fafc; }
.archive-description,
.filter-hint,
.filter-empty { color: #a7b4c8; }
.filter-option,
.price-filter-grid input,
.woocommerce-ordering select { background: #0b111c; border-color: #263247; color: #f8fafc; }
.filter-option:hover,
.filter-option:has(input:checked) { background: #0d1b2f; border-color: #3b82f6; }
.filter-reset { background: #162033; color: #cbd5e1; }
.sidebar-overlay.active { background: rgba(2, 6, 23, .74); }
.sidebar-header { background: #111827; border-color: #263247; }
