/**
 * File: assets/css/shop-styles.css
 * Shop page styling
 */

/* FILTER SIDEBAR */
.csf-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e5e5;
}

.csf-filter-header h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: #041607;
}

.csf-reset-filters {
    background: #fff;
    border: 1px solid #23C53E;
    color: #23C53E;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.csf-reset-filters:hover {
    color: #041607;
    border-color: #23C53E;
}

.csf-filter-group {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.csf-filter-group:last-of-type {
    border-bottom: none;
}

.csf-filter-group h4 {
    margin: 0 0 16px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #041607;
}

/* Price Slider */
.csf-price-slider {
    position: relative;
    padding-top: 10px;
}

.csf-price-slider input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #23C53E;
    outline: none;
    border-radius: 2px;
    margin-bottom: 8px;
}

.csf-price-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #23C53E;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.2s;
}

.csf-price-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.csf-price-values {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
    color: #6C737F;
    margin-top: 12px;
}

/* Checkboxes & Radios */
.csf-checkbox {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: background 0.2s;
}

.csf-checkbox:hover {
    background: #f9f9f9;
}

.csf-checkbox input {
    margin-right: 10px;
    cursor: pointer;
}

.csf-checkbox span {
    font-size: 14px;
    color: #6C737F;
}

/* Apply Button */
.csf-apply-filters {
    width: 100%;
    padding: 14px;
    background-color: #23C53E !important;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.3s;
}

.csf-apply-filters:hover {
    background: #041607 !important;
}

/* Loading Overlay */
.csf-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.csf-loading-overlay.active {
    display: flex;
}

.csf-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #23C53E;
    border-top: 4px solid #041607;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* ==========================================
   PRODUCTS GRID
   ========================================== */



/* Flexbox Layout (User Request) */
.woocommerce-page .products_lists,
.woocommerce-page .elementor-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 30px;
}

/* Hide ghost/empty product items */
.woocommerce-page .products_lists .product:empty,
.woocommerce-page .elementor-grid .product:empty {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Flex Item Sizing (3 per row) */
.woocommerce-page .products_lists .product,
.woocommerce-page .elementor-grid .product {
    flex: 0 0 calc(33.333% - 20px) !important;
    max-width: calc(33.333% - 20px) !important;
    margin: 0 !important;
    float: none !important;
    width: auto !important;
}

/* Product Card */
.product {
    background: transparent;
    /* Moved to inner */
    border: none;
    box-shadow: none;
}

.product-inner {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #F3F4F6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    /* Ensure equal height */
    position: relative;
}

.product-inner:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Product Image Container */
.product .woocommerce-loop-product__link {
    position: relative;
    display: block;
    overflow: hidden;
}

.product .attachment-woocommerce_thumbnail {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.product-inner:hover .attachment-woocommerce_thumbnail {
    transform: scale(1.05);
}

/* Hover Overlay */
.product .woocommerce-loop-product__link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s;
}

.product-inner:hover .woocommerce-loop-product__link::after {
    opacity: 1;
}

/* Add to Cart Hover Button */
.csf-add-to-cart-hover {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 50px;
    height: 50px;
    background: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.product-inner:hover .csf-add-to-cart-hover {
    transform: translate(-50%, -50%) scale(1);
}

.csf-add-to-cart-hover::before {
    content: '\f07a';
    /* Font Awesome cart icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 18px;
    color: #333;
}

.csf-add-to-cart-hover.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #23C53E;
    border-top: 2px solid #23C53E;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.csf-add-to-cart-hover.added {
    background: #4caf50;
}

.csf-add-to-cart-hover.added::before {
    content: '\f00c';
    /* Checkmark */
    color: #fff;
}

/* Product Info */
.product .woocommerce-loop-product__title {
    font-size: 16px;
    font-weight: 500;
    margin: 16px 16px 8px;
    line-height: 2;
    white-space: nowrap;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #041607;
}

.product .woocommerce-loop-product__title:hover {
    color: #666;
}



/* Price */
.product .price {
    font-size: 18px;
    font-weight: 600;
    color: #6C737F;
    margin: 0 16px;
}

.product .price del {
    opacity: 0.5;
    font-size: 14px;
    margin-right: 8px;
}

.product .price ins {
    text-decoration: none;
    color: #23C53E;
}

/* Details Button */
.product .csf-details-btn {
    display: block;
    width: calc(100% - 32px);
    margin: 16px;
    padding: 12px;
    background: #23C53E;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    transition: background 0.3s;
}

.product .csf-details-btn:hover {
    background: #041607;
    color: #fff;
}

/* ==========================================
RESPONSIVE
========================================== */
/* Tablet */
@media (max-width: 1024px) {
    .woocommerce-page .products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
    }

    .csf-filter-sidebar {
        flex: 0 0 240px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .woocommerce-page {
        flex-direction: column;
    }

    .csf-filter-sidebar {
        position: relative;
        flex: 1;
        margin-bottom: 30px;
    }

    .woocommerce-page .products {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
}