/**
 * Shop Page Styles
 * 
 * استایل‌های صفحه فروشگاه
 * براساس STYLE-GUIDE.md
 * 
 * @package Tavana
 * @since 1.0.0
 */

/* ========================================
   Shop Page Layout
   ======================================== */

.shop-page {
    padding: var(--spacing-lg, 24px) 0 var(--spacing-xl, 32px);
    background: var(--bg-body, #F5F5F7);
    min-height: 70vh;
}

/* Breadcrumb */
.shop-page .breadcrumb-nav {
    margin-bottom: var(--spacing-lg, 24px);
    padding: var(--spacing-sm, 8px) 0;
    font-size: 0.9rem;
    color: var(--text-secondary, #64748b);
}

.shop-page .breadcrumb-nav a {
    color: var(--text-secondary, #64748b);
    text-decoration: none;
    transition: color 0.2s ease;
}

.shop-page .breadcrumb-nav a:hover {
    color: var(--primary, #2563EB);
}

.shop-page .breadcrumb-nav .separator {
    margin: 0 8px;
    color: var(--text-muted, #94a3b8);
}

/* Page Header */
.shop-header {
    margin-bottom: var(--spacing-xl, 32px);
    text-align: center;
}

.shop-header .page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary, #333333);
    margin: 0 0 var(--spacing-sm, 8px);
}

.shop-header .page-description {
    color: var(--text-secondary, #64748b);
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   Shop Layout (Sidebar + Content)
   ======================================== */

.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--spacing-xl, 32px);
    align-items: start;
}

/* ========================================
   Sidebar
   ======================================== */

.shop-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius, 10px);
    padding: var(--spacing-lg, 24px);
    margin-bottom: var(--spacing-md, 16px);
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #333333);
    margin: 0 0 var(--spacing-md, 16px);
    padding-bottom: var(--spacing-sm, 8px);
    border-bottom: 1px solid var(--border-light, #e2e8f0);
}

.widget-title [data-lucide] {
    width: 18px;
    height: 18px;
    color: var(--primary, #2563EB);
}

/* Category List */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: var(--spacing-xs, 4px);
}

.category-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm, 8px) var(--spacing-md, 16px);
    color: var(--text-secondary, #64748b);
    text-decoration: none;
    border-radius: var(--radius-sm, 6px);
    transition: all 0.2s ease;
}

.category-list a:hover {
    background: var(--bg-body, #F5F5F7);
    color: var(--primary, #2563EB);
}

.category-list a.active {
    background: var(--primary, #2563EB);
    color: #ffffff;
}

.category-list a.active .count {
    color: rgba(255, 255, 255, 0.8);
}

.category-list .count {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
}

/* Price Filter */
.price-filter-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md, 16px);
}

.price-inputs {
    display: flex;
    gap: var(--spacing-sm, 8px);
}

.price-input-group {
    flex: 1;
}

.price-input-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: var(--spacing-xs, 4px);
}

.price-input-group input {
    width: 100%;
    padding: var(--spacing-sm, 8px) var(--spacing-md, 16px);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius, 10px);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-card, #ffffff);
    color: var(--text-primary, #333333);
}

.price-input-group input:focus {
    border-color: var(--accent, #1E40AF);
    outline: none;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm, 8px);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary, #64748b);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary, #2563EB);
}

/* ========================================
   Mobile Filter Toggle
   ======================================== */

.mobile-filter-toggle {
    display: none;
    margin-bottom: var(--spacing-md, 16px);
}

/* ========================================
   Filters Drawer (Mobile)
   ======================================== */

.filters-drawer {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal, 500);
}

.filters-drawer-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-overlay, rgba(51, 51, 51, 0.3));
    backdrop-filter: blur(4px);
}

.filters-drawer-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    max-width: 85%;
    background: var(--bg-card, #ffffff);
    display: flex;
    flex-direction: column;
}

.filters-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md, 16px);
    border-bottom: 1px solid var(--border-light, #e2e8f0);
}

.filters-drawer-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.btn-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body, #F5F5F7);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius, 10px);
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: var(--danger, #EF4444);
    border-color: var(--danger, #EF4444);
    color: #ffffff;
}

.filters-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md, 16px);
}

.filters-drawer-body .sidebar-widget {
    border: none;
    padding: 0;
    margin-bottom: var(--spacing-lg, 24px);
}

/* ========================================
   Shop Content
   ======================================== */

.shop-content {
    min-width: 0;
}

/* Toolbar */
.shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md, 16px);
    padding: var(--spacing-md, 16px);
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius, 10px);
    margin-bottom: var(--spacing-lg, 24px);
}

.toolbar-info {
    font-size: 0.9rem;
    color: var(--text-secondary, #64748b);
}

.orderby-select {
    padding: var(--spacing-sm, 8px) var(--spacing-md, 16px);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius, 10px);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-card, #ffffff);
    color: var(--text-primary, #333333);
    cursor: pointer;
}

.orderby-select:focus {
    border-color: var(--accent, #1E40AF);
    outline: none;
}

/* ========================================
   Products Grid
   ======================================== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg, 24px);
}

/* ========================================
   Product Card
   ======================================== */

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius, 10px);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.product-card:hover {
    border-color: var(--accent, #1E40AF);
}

/* Product Image */
.product-card-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-body, #F5F5F7);
}

.product-card-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.product-card-image img,
.product-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

/* Product Badge */
.product-card .product-badge {
    position: absolute;
    top: var(--spacing-sm, 8px);
    right: var(--spacing-sm, 8px);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm, 6px);
    z-index: 5;
}

.product-card .badge-danger {
    background: var(--danger, #EF4444);
    color: #ffffff;
}

.product-card .badge-secondary {
    background: var(--text-muted, #94a3b8);
    color: #ffffff;
}

.product-card .product-badge-stock {
    top: auto;
    bottom: var(--spacing-sm, 8px);
}

/* Quick Actions */
.product-card-actions {
    position: absolute;
    top: var(--spacing-sm, 8px);
    left: var(--spacing-sm, 8px);
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s ease;
    z-index: 5;
}

.product-card:hover .product-card-actions {
    opacity: 1;
    transform: translateX(0);
}

.product-card-actions .product-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius-sm, 6px);
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.product-card-actions .product-action-btn:hover {
    background: var(--primary, #2563EB);
    border-color: var(--primary, #2563EB);
    color: #ffffff;
}

.product-card-actions .product-action-btn [data-lucide] {
    width: 16px;
    height: 16px;
}

/* Product Body */
.product-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs, 4px);
    padding: var(--spacing-md, 16px);
}

/* Product Title */
.product-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-title a {
    color: var(--text-primary, #333333);
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-card-title a:hover {
    color: var(--primary, #2563EB);
}

/* Product Rating */
.product-card-rating {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs, 4px);
    margin: var(--spacing-xs, 4px) 0;
}

.product-card-rating .rating-stars {
    display: flex;
    gap: 2px;
}

.product-card-rating .star-icon {
    width: 14px;
    height: 14px;
}

.product-card-rating .star-filled {
    color: var(--warning, #F59E0B);
    fill: var(--warning, #F59E0B);
}

.product-card-rating .star-empty {
    color: var(--border-light, #e2e8f0);
}

.product-card-rating .rating-count {
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
}

/* Product Price */
.product-card-price {
    margin-top: auto;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #333333);
}

.product-card-price del {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted, #94a3b8);
    margin-left: var(--spacing-xs, 4px);
}

.product-card-price ins {
    text-decoration: none;
    color: var(--danger, #EF4444);
}

.product-card-price .toman-icon {
    width: 14px;
    height: 14px;
}

/* Product Footer */
.product-card-footer {
    padding: 0 var(--spacing-md, 16px) var(--spacing-md, 16px);
}

.product-card-footer .btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
}

.product-card-footer .btn [data-lucide] {
    width: 16px;
    height: 16px;
}

/* Loading State */
.product-card-footer .btn.loading {
    opacity: 0.7;
    cursor: wait;
}

/* ========================================
   Pagination
   ======================================== */

.shop-pagination {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xs, 4px);
    margin-top: var(--spacing-xl, 32px);
}

.shop-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--spacing-sm, 8px);
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius, 10px);
    color: var(--text-primary, #333333);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.shop-pagination .page-numbers:hover {
    border-color: var(--accent, #1E40AF);
    color: var(--accent, #1E40AF);
}

.shop-pagination .page-numbers.current {
    background: var(--primary, #2563EB);
    border-color: var(--primary, #2563EB);
    color: #ffffff;
}

.shop-pagination .page-numbers [data-lucide] {
    width: 16px;
    height: 16px;
}

/* ========================================
   Empty State
   ======================================== */

.no-products-found {
    padding: var(--spacing-xl, 32px);
}

.empty-state {
    text-align: center;
    padding: var(--spacing-xl, 32px);
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius, 10px);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted, #94a3b8);
    margin-bottom: var(--spacing-md, 16px);
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #333333);
    margin: 0 0 var(--spacing-sm, 8px);
}

.empty-state p {
    color: var(--text-secondary, #64748b);
    margin: 0 0 var(--spacing-lg, 24px);
}

/* ========================================
   Archive Product Page (WooCommerce)
   ======================================== */

.archive-product-page {
    padding: var(--spacing-lg, 24px) 0 var(--spacing-xl, 32px);
    background: var(--bg-body, #F5F5F7);
}

.archive-header {
    margin-bottom: var(--spacing-xl, 32px);
}

.archive-header .page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary, #333333);
    margin: 0 0 var(--spacing-sm, 8px);
}

.archive-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--spacing-xl, 32px);
    align-items: start;
}

.archive-sidebar {
    position: sticky;
    top: 100px;
}

.archive-content {
    min-width: 0;
}

/* Products Grid inside archive-content */
.archive-content .products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg, 24px);
}

.archive-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md, 16px);
    padding: var(--spacing-md, 16px);
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius, 10px);
    margin-bottom: var(--spacing-lg, 24px);
}

.archive-pagination {
    display: flex;
    justify-content: center;
    margin-top: var(--spacing-xl, 32px);
}

/* ========================================
   Responsive
   ======================================== */

/* Tablet */
@media (max-width: 1023px) {

    .shop-layout,
    .archive-layout {
        grid-template-columns: 1fr;
    }

    .shop-sidebar,
    .archive-sidebar.desktop-sidebar {
        display: none;
    }

    .mobile-filter-toggle {
        display: block;
    }

    .products-grid,
    .archive-content .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile */
@media (max-width: 767px) {

    .shop-page,
    .archive-product-page {
        padding: var(--spacing-md, 16px) 0 var(--spacing-lg, 24px);
    }

    .shop-header .page-title,
    .archive-header .page-title {
        font-size: 1.35rem;
    }

    .shop-toolbar,
    .archive-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm, 8px);
    }

    .products-grid,
    .archive-content .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md, 16px);
    }

    .product-card-body {
        padding: var(--spacing-sm, 8px);
    }

    .product-card-title {
        font-size: 0.85rem;
    }

    .product-card-price {
        font-size: 0.95rem;
    }

    .product-card-footer {
        padding: 0 var(--spacing-sm, 8px) var(--spacing-sm, 8px);
    }

    .product-card-footer .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {

    .products-grid,
    .archive-content .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm, 8px);
    }

    .product-card-actions {
        top: 4px;
        left: 4px;
    }

    .product-card-actions .product-action-btn {
        width: 30px;
        height: 30px;
    }

    .product-card .product-badge {
        padding: 2px 6px;
        font-size: 0.65rem;
    }
}

/* ========================================
   Alpine.js Cloak
   ======================================== */

[x-cloak] {
    display: none !important;
}

/* ===
=====================================
   Archive Sidebar Filters
   ======================================== */

.archive-filters {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md, 16px);
}

.filter-section {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius, 10px);
    padding: var(--spacing-lg, 24px);
}

.filter-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #333333);
    margin: 0 0 var(--spacing-md, 16px);
    padding-bottom: var(--spacing-sm, 8px);
    border-bottom: 1px solid var(--border-light, #e2e8f0);
}

.filter-title [data-lucide] {
    width: 18px;
    height: 18px;
    color: var(--primary, #2563EB);
}

/* Filter List */
.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-item {
    margin-bottom: var(--spacing-xs, 4px);
}

.filter-item.active .filter-link {
    background: var(--primary, #2563EB);
    color: #ffffff;
}

.filter-item.active .filter-count {
    color: rgba(255, 255, 255, 0.8);
}

.filter-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm, 8px) var(--spacing-md, 16px);
    color: var(--text-secondary, #64748b);
    text-decoration: none;
    border-radius: var(--radius-sm, 6px);
    transition: all 0.2s ease;
}

.filter-link:hover {
    background: var(--bg-body, #F5F5F7);
    color: var(--primary, #2563EB);
}

.filter-count {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
}

/* Price Filter */
.price-filter {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md, 16px);
}

.price-filter .price-inputs {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm, 8px);
}

.price-filter .price-input-group {
    flex: 1;
}

.price-filter .price-input-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 4px;
}

.price-filter .price-input {
    width: 100%;
    padding: var(--spacing-sm, 8px);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius-sm, 6px);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-card, #ffffff);
    color: var(--text-primary, #333333);
    text-align: center;
}

.price-filter .price-input:focus {
    border-color: var(--accent, #1E40AF);
    outline: none;
}

.price-filter .price-separator {
    color: var(--text-muted, #94a3b8);
    font-size: 0.9rem;
}

/* Checkbox Filter */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm, 8px);
    padding: var(--spacing-sm, 8px) var(--spacing-md, 16px);
    cursor: pointer;
    border-radius: var(--radius-sm, 6px);
    transition: background 0.2s ease;
}

.filter-checkbox:hover {
    background: var(--bg-body, #F5F5F7);
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary, #2563EB);
    cursor: pointer;
}

.filter-checkbox .filter-name {
    flex: 1;
    color: var(--text-secondary, #64748b);
    font-size: 0.9rem;
}

.filter-checkbox .filter-count {
    font-size: 0.75rem;
}

/* Filter Actions */
.filter-actions {
    margin-top: var(--spacing-sm, 8px);
}

/* ========================================
   WooCommerce Overrides for Archive
   ======================================== */

.archive-product-page .woocommerce-result-count {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary, #64748b);
}

.archive-product-page .woocommerce-ordering {
    margin: 0;
}

.archive-product-page .woocommerce-ordering select {
    padding: var(--spacing-sm, 8px) var(--spacing-md, 16px);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius, 10px);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-card, #ffffff);
    color: var(--text-primary, #333333);
    cursor: pointer;
}

.archive-product-page .woocommerce-ordering select:focus {
    border-color: var(--accent, #1E40AF);
    outline: none;
}

/* Pagination Override */
.archive-pagination .woocommerce-pagination {
    margin: 0;
}

.archive-pagination .woocommerce-pagination ul {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xs, 4px);
    border: none;
    margin: 0;
    padding: 0;
}

.archive-pagination .woocommerce-pagination ul li {
    border: none;
    margin: 0;
    padding: 0;
}

.archive-pagination .woocommerce-pagination ul li a,
.archive-pagination .woocommerce-pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--spacing-sm, 8px);
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius, 10px);
    color: var(--text-primary, #333333);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.archive-pagination .woocommerce-pagination ul li a:hover {
    border-color: var(--accent, #1E40AF);
    color: var(--accent, #1E40AF);
}

.archive-pagination .woocommerce-pagination ul li span.current {
    background: var(--primary, #2563EB);
    border-color: var(--primary, #2563EB);
    color: #ffffff;
}

/* ====
====================================
   Show More Button for Categories
   ======================================== */

.show-more-item {
    margin-top: var(--spacing-sm, 8px);
    padding-top: var(--spacing-sm, 8px);
    border-top: 1px solid var(--border-light, #e2e8f0);
}

.show-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: var(--spacing-sm, 8px) var(--spacing-md, 16px);
    background: transparent;
    border: 1px dashed var(--border-color, #333333);
    border-radius: var(--radius-sm, 6px);
    color: var(--primary, #2563EB);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.show-more-btn:hover {
    background: var(--primary-50, #EFF6FF);
    border-style: solid;
    border-color: var(--primary, #2563EB);
}

.show-more-btn [data-lucide] {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}


/* ========================================
   Price Range Slider
   ======================================== */

.price-range-filter {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md, 16px);
}

/* Price Display */
.price-range-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm, 8px);
    padding: var(--spacing-sm, 8px) var(--spacing-md, 16px);
    background: var(--bg-body, #F5F5F7);
    border-radius: var(--radius-sm, 6px);
    font-size: 0.85rem;
}

.price-range-display .price-value {
    color: var(--text-primary, #333333);
    font-weight: 600;
}

.price-range-display .price-separator {
    color: var(--text-muted, #94a3b8);
}

/* Range Slider Container */
.price-range-slider {
    position: relative;
    height: 40px;
    padding: 15px 0;
}

/* Track */
.range-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--border-light, #e2e8f0);
    border-radius: 3px;
    transform: translateY(-50%);
}

/* Fill (selected range) */
.range-fill {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--primary, #2563EB);
    border-radius: 3px;
}

/* Range Inputs */
.range-input {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 6px;
    background: transparent;
    pointer-events: none;
    transform: translateY(-50%);
    -webkit-appearance: none;
    appearance: none;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--bg-card, #ffffff);
    border: 2px solid var(--primary, #2563EB);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.15s ease;
}

.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.range-input::-webkit-slider-thumb:active {
    transform: scale(1.15);
    background: var(--primary, #2563EB);
}

.range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--bg-card, #ffffff);
    border: 2px solid var(--primary, #2563EB);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.15s ease;
}

.range-input::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

/* Manual Price Inputs */
.price-inputs-row {
    display: flex;
    gap: var(--spacing-sm, 8px);
}

.price-inputs-row .price-input-group {
    flex: 1;
}

.price-inputs-row .price-input-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 4px;
}

.price-inputs-row .price-input {
    width: 100%;
    padding: var(--spacing-sm, 8px);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius-sm, 6px);
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--bg-card, #ffffff);
    color: var(--text-primary, #333333);
    text-align: center;
}

.price-inputs-row .price-input:focus {
    border-color: var(--primary, #2563EB);
    outline: none;
}

/* Hide number input spinners */
.price-inputs-row .price-input::-webkit-outer-spin-button,
.price-inputs-row .price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.price-inputs-row .price-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ==
======================================
   Skeleton Loading
   ======================================== */

.products-skeleton {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg, 24px);
}

.skeleton-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius, 10px);
    overflow: hidden;
}

.skeleton-image {
    aspect-ratio: 1;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-body {
    padding: var(--spacing-md, 16px);
}

.skeleton-title {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: var(--spacing-sm, 8px);
}

.skeleton-price {
    height: 24px;
    width: 60%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: var(--spacing-md, 16px);
}

.skeleton-button {
    height: 40px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius, 10px);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Responsive Skeleton */
@media (max-width: 1023px) {
    .products-skeleton {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .products-skeleton {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md, 16px);
    }
}

/* ========================================
   AJAX Pagination
   ======================================== */

.ajax-pagination {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xs, 4px);
    flex-wrap: wrap;
}

.ajax-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--spacing-sm, 8px);
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius, 10px);
    color: var(--text-primary, #333333);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ajax-pagination .page-numbers:hover {
    border-color: var(--accent, #1E40AF);
    color: var(--accent, #1E40AF);
}

.ajax-pagination .page-numbers.current {
    background: var(--primary, #2563EB);
    border-color: var(--primary, #2563EB);
    color: #ffffff;
    cursor: default;
}

/* Pagination Dots (Ellipsis) */
.ajax-pagination .page-numbers.dots {
    background: transparent;
    border: none;
    cursor: default;
    min-width: auto;
    padding: 0 4px;
    color: var(--text-muted, #94a3b8);
}

.ajax-pagination .page-numbers.dots:hover {
    color: var(--text-muted, #94a3b8);
    border: none;
}

/* Prev/Next Buttons */
.ajax-pagination .page-prev,
.ajax-pagination .page-next {
    min-width: 40px;
}

.ajax-pagination .page-prev [data-lucide],
.ajax-pagination .page-next [data-lucide] {
    width: 18px;
    height: 18px;
}

/* ========================================
   Filter Link Button Style
   ======================================== */

.filter-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--spacing-sm, 8px) var(--spacing-md, 16px);
    background: transparent;
    border: none;
    color: var(--text-secondary, #64748b);
    text-decoration: none;
    text-align: right;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: inherit;
}

.filter-link:hover {
    background: var(--bg-body, #F5F5F7);
    color: var(--primary, #2563EB);
}

.filter-item.active .filter-link {
    background: var(--primary, #2563EB);
    color: #ffffff;
}

.filter-item.active .filter-link .filter-count {
    color: rgba(255, 255, 255, 0.8);
}

/* ========================================
   No Products Message
   ======================================== */

.no-products-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-xl, 32px);
    color: var(--text-muted, #94a3b8);
}

.no-products-message [data-lucide] {
    width: 48px;
    height: 48px;
    margin-bottom: var(--spacing-md, 16px);
}

.no-products-message p {
    margin: 0;
    font-size: 1rem;
}


/* ========================================
   Sort Options (Text Buttons)
   ======================================== */

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg, 24px);
}

/* View Toggle Wrapper - Below Toolbar */
.view-toggle-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md, 16px);
    gap: var(--spacing-md, 16px);
}

/* ========================================
   Countdown Deal
   ======================================== */

.countdown-deal {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm, 8px);
    padding: var(--spacing-sm, 8px) var(--spacing-md, 16px);
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius, 10px);
    text-decoration: none;
    color: var(--text-primary, #333333);
    font-size: 0.85rem;
    overflow: hidden;
    position: relative;
    transition: border-color 0.2s ease;
}

.countdown-deal:hover {
    border-color: var(--accent, #1E40AF);
}

.countdown-deal.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.countdown-deal__badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 26px;
    padding: 0 8px;
    background: var(--danger, #EF4444);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.75rem;
    border-radius: var(--radius-sm, 6px);
    flex-shrink: 0;
}

.countdown-deal__content {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.countdown-deal__label {
    color: var(--text-secondary, #64748b);
    white-space: nowrap;
}

.countdown-deal__name {
    color: var(--text-primary, #333333);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.countdown-deal:hover .countdown-deal__name {
    color: var(--accent, #1E40AF);
}

.countdown-deal__price {
    color: var(--danger, #EF4444);
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 600;
}

.countdown-deal__timer {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-body, #F5F5F7);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius-sm, 6px);
    font-family: monospace;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary, #333333);
    flex-shrink: 0;
}

.countdown-deal__timer [data-lucide] {
    width: 14px;
    height: 14px;
    color: var(--text-secondary, #64748b);
}

/* Skeleton */
.countdown-deal--skeleton {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-light, #e2e8f0);
    pointer-events: none;
}

.countdown-deal--skeleton .skeleton-box {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm, 6px);
}

.countdown-deal--skeleton .countdown-deal__icon {
    width: 36px;
    height: 26px;
}

.countdown-deal--skeleton .countdown-deal__text {
    width: 200px;
    height: 18px;
}

.countdown-deal--skeleton .countdown-deal__timer {
    width: 80px;
    height: 26px;
    background: transparent;
    border: none;
}

/* Responsive */
@media (max-width: 767px) {
    .view-toggle-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .countdown-deal {
        order: -1;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .countdown-deal__content {
        flex-wrap: wrap;
        justify-content: center;
    }

    .countdown-deal__name {
        max-width: 120px;
    }
}

.toolbar-sort {
    display: flex;
    align-items: center;
    gap: var(--spacing-md, 16px);
}

.sort-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary, #64748b);
    white-space: nowrap;
}

.sort-label [data-lucide] {
    width: 16px;
    height: 16px;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs, 4px);
    flex-wrap: wrap;
}

.sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm, 6px);
    color: var(--text-secondary, #64748b);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sort-btn:hover {
    background: var(--bg-body, #F5F5F7);
    color: var(--primary, #2563EB);
}

.sort-btn.active {
    background: var(--primary, #2563EB);
    color: #ffffff;
    border-color: var(--primary, #2563EB);
}

.sort-btn [data-lucide] {
    width: 14px;
    height: 14px;
}

/* Responsive Sort */
@media (max-width: 1023px) {
    .archive-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md, 16px);
    }

    .toolbar-actions {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md, 16px);
    }

    .toolbar-sort {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm, 8px);
    }

    .sort-options {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .sort-options::-webkit-scrollbar {
        height: 4px;
    }

    .sort-options::-webkit-scrollbar-thumb {
        background: var(--border-light, #e2e8f0);
        border-radius: 2px;
    }
}

@media (max-width: 767px) {
    .sort-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .sort-btn [data-lucide] {
        width: 12px;
        height: 12px;
    }
}


/* ========================================
   Price Reset Button Disabled State
   ======================================== */

.price-reset-btn {
    margin-top: var(--spacing-sm, 8px);
    transition: all 0.2s ease;
}

.price-reset-btn.is-disabled,
.price-reset-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.price-reset-btn:not(.is-disabled):hover {
    color: var(--danger, #EF4444);
    border-color: var(--danger, #EF4444);
}


/* ========================================
   Filter Section Collapsible
   ======================================== */

.filter-toggle {
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
    padding-bottom: var(--spacing-sm, 8px);
}

.filter-title-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-toggle .toggle-icon {
    margin-right: auto;
    transition: transform 0.2s ease;
    color: var(--text-muted, #94a3b8);
}

.filter-toggle .toggle-icon.rotate {
    transform: rotate(180deg);
}

.filter-toggle:hover .toggle-icon {
    color: var(--primary, #2563EB);
}

/* Content when open */
.filter-section .filter-list,
.filter-section .price-range-filter {
    margin-top: var(--spacing-md, 16px);
}


/* ========================================
   Filter Switch Toggle
   ======================================== */

.filter-switches {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm, 8px);
    margin-top: var(--spacing-md, 16px);
}

.filter-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm, 8px) var(--spacing-md, 16px);
    background: var(--bg-body, #F5F5F7);
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    transition: background 0.2s ease;
}

.filter-switch:hover {
    background: var(--bg-hover, #e2e8f0);
}

.switch-label {
    font-size: 0.9rem;
    color: var(--text-secondary, #64748b);
    user-select: none;
}

.switch-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.switch-slider {
    position: absolute;
    inset: 0;
    background: var(--border-light, #e2e8f0);
    border: 1px solid var(--border-color, #333333);
    border-radius: var(--radius-full, 9999px);
    transition: all 0.2s ease;
}

.switch-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: var(--bg-card, #ffffff);
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.switch-toggle input:checked+.switch-slider {
    background: var(--primary, #2563EB);
    border-color: var(--primary, #2563EB);
}

.switch-toggle input:checked+.switch-slider::before {
    transform: translateX(-20px);
}

.switch-toggle input:focus+.switch-slider {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}