/**
 * Product Grid - Archive/Category Pages
 * Mobile-first, elegant grid layout
 * Replaces Bulma columns system
 */

/* ============================================================================
   PAGE BACKGROUND (Reduce eye strain, make cards pop)
   ========================================================================== */

/* Apply background to body instead of wrapper to avoid covering header */
body.archive.tax-product_cat,
body.post-type-archive-product {
    background-color: #f8f9fa;
}

/* Ensure main container has proper background */
.archive.tax-product_cat .container,
.post-type-archive-product .container {
    background-color: transparent;
}

/* ============================================================================
   ACTIVE FILTERS (CHIPS)
   ========================================================================== */

.wcapf-active-filters-before-shop-loop {
    margin: 1rem 0;
}

.wcapf-active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.wcapf-active-filter-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1.5px solid #dee2e6;
    border-radius: 20px;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--dark-grey);
    cursor: pointer;
    transition: all 0.3s ease;
}

.wcapf-active-filter-item:hover {
    background: #f8f9fa;
    border-color: var(--dark-grey);
}

.wcapf-cross-sign {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1;
}

.wcapf-reset-filters-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1.5px solid var(--dark-grey);
    border-radius: 20px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--dark-grey);
    cursor: pointer;
    transition: all 0.3s ease;
}

.wcapf-reset-filters-btn:hover {
    background: var(--dark-grey);
    color: white;
}

/* ============================================================================
   TOOLBAR (SORTING)
   ========================================================================== */

.wcapf-before-products {
    display: block;
    width: 100%;
}

/* ============================================================================
   SORTING DROPDOWN
   ========================================================================== */

.woocommerce-ordering {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 1.5rem 0;
    width: 100%;
}

.woocommerce-ordering .orderby {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    max-width: 220px;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%235D6E4F' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 20px;
    border: 1.5px solid #dee2e6;
    border-radius: 8px;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--dark-grey);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.woocommerce-ordering .orderby:hover {
    border-color: var(--forest-green);
    box-shadow: 0 2px 8px rgba(93, 110, 79, 0.15);
}

.woocommerce-ordering .orderby:focus {
    outline: none;
    border-color: var(--forest-green);
    box-shadow: 0 0 0 3px rgba(93, 110, 79, 0.1);
}

/* ============================================================================
   PRODUCT GRID WRAPPER
   ========================================================================== */

ul.products.products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Remove any pseudo-elements from WooCommerce/Bulma */
.products.products-grid::before,
.products.products-grid::after {
    display: none !important;
    content: none !important;
}

/* ============================================================================
   PRODUCT GRID ITEM
   ========================================================================== */

.product-grid-item {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Remove any default WooCommerce styles */
.products.products-grid .product-grid-item {
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================================================
   TABLET (768px+)
   ========================================================================== */

@media (min-width: 768px) {
    .woocommerce-result-count {
        font-size: 1rem;
    }

    .woocommerce-ordering .orderby {
        font-size: 1rem;
    }

    ul.products.products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

/* ============================================================================
   DESKTOP (1024px+)
   ========================================================================== */

@media (min-width: 1024px) {
    ul.products.products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

/* ============================================================================
   LARGE DESKTOP (1440px+)
   ========================================================================== */

@media (min-width: 1440px) {
    ul.products.products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}
