/**
 * Archive Product Styles
 * Optimized and organized styles for the product archive
 */

/* ===== PRODUCT CARDS ===== */
.product-card {
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background: white;
}


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


/* .product-card .add-to-cart-btn {
    background: rgba(130, 75, 25, 0.2);
    color: white;
    padding: 0.375rem;
    border-radius: 0.375rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border: none;
    cursor: pointer;
}

.product-card .add-to-cart-btn:hover {
    background: rgba(130, 75, 25, 0.4);
}

.product-card .add-to-cart-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
} */

/* ===== FILTER STYLES ===== */
.sidebar-container .sidebar {
    position: sticky;
    top: 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
}

.filter-section {
    margin-bottom: 1.5rem;
}

.filter-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.filter-section .space-y-2 > * {
    margin-bottom: 0.5rem;
}

.filter-section input[type="checkbox"],
.filter-section input[type="radio"] {
    color: #dc2626;
    margin-right: 0.5rem;
}

.filter-section input[type="checkbox"]:checked,
.filter-section input[type="radio"]:checked {
    background-color: var(--color-primary, #dc2626);
    border-color: var(--color-primary, #dc2626);
}

.filter-section input[type="checkbox"]:focus,
.filter-section input[type="radio"]:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    border-color: var(--color-primary, #dc2626);
}

/* ===== MOBILE FILTER MODAL ===== */
#mobile-filter-modal {
    z-index: 9999;
}

#mobile-filter-content {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-height: fit-content;
    max-height: 100vh;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    transform: translateX(100%) scale(0.95);
    overflow: hidden;
}

#mobile-filter-content.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

#mobile-filter-content .flex-1.overflow-y-auto {
    max-height: calc(100vh - 140px);
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

#mobile-filter-content .flex-1.overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

#mobile-filter-content .flex-1.overflow-y-auto::-webkit-scrollbar-track {
    background: transparent;
}

#mobile-filter-content .flex-1.overflow-y-auto::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

#mobile-filter-content .flex-1.overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
}

#mobile-filter-content form {
    padding-bottom: 1rem;
}

/* ===== LOADING STATES ===== */
.filter-loading {
    position: relative;
    pointer-events: none;
}

.filter-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ACTIVE FILTERS ===== */
.active-filters {
    background: #f9fafb;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.active-filters .filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(220, 38, 38, 0.1);
    color: #1f2937;
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== FILTER COUNT BADGE ===== */
#mobile-filter-count,
#modal-filter-count {
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    animation: scaleIn 0.3s ease-out;
}

/* ===== PRODUCT MODAL ===== */
.product-modal {
    backdrop-filter: blur(2px);
}

.product-modal .modal-content {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ===== WOOCOMMERCE OVERRIDES ===== */
.woocommerce .star-rating {
    color: #fbbf24 !important;
}

.added_to_cart,
.woocommerce-message .button.wc-forward {
    display: none !important;
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    .sidebar-container .sidebar {
        position: static;
    }

    .filter-sort-controls {
        display: none;
    }

    #mobile-filter-btn {
        min-height: 48px;
        font-size: 14px;
    }

    #product-orderby-mobile {
        min-height: 48px;
        font-size: 14px;
    }

    #mobile-filter-content {
        width: 85vw;
        max-width: 320px;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (min-width: 769px) {
    #mobile-filter-btn,
    #product-orderby-mobile {
        display: none !important;
    }

    .sidebar-container .sidebar::-webkit-scrollbar {
        width: 0px;
    }

    .sidebar-container .sidebar::-webkit-scrollbar-track {
        background: transparent;
    }
}

@media (min-width: 1025px) {
    #mobile-filter-modal {
        display: none !important;
    }
}
