/* --- Loading Overlay --- */
.products-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#shop-products-grid {
    position: relative;
    min-height: 300px;
    transition: opacity 0.3s ease;
}

/* --- Shop Filter Bar --- */

.woocommerce-breadcrumb,
.shop-filters .woocommerce-result-count {
    display: none;
}

.shop-container {
    padding: 60px 0 80px;
}

.shop-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.shop-filters .filter-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.shop-category-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.shop-container .woocommerce-ordering {
    margin: 0 !important;
}

.woocommerce-ordering select,
#shop-category-select {
    border: 1px solid #DDDDDD;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 24px;
    border-radius: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    min-width: 150px;
    /* Set a sensible min-width */
    max-width: 100%;
    /* Prevent overflow */
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
    background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position-x: 90%;
    background-position-y: 8px;
}

.shop-filter-btn {
    border: none;
    color: var(--main-green);
    background: transparent;
    border: 1px solid var(--main-green);
    padding: 0.5rem 30px;
    border-radius: 24px 24px 0 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;

}

.shop-filter-btn.active,
.shop-filter-btn:hover {
    background: var(--main-green);
    color: var(--main-white);
}

/* --- Product Grid --- */
#shop-products-grid {
    display: grid;
    list-style: none;
    gap: 1rem;
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .custom-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .custom-products-grid {
        grid-template-columns: 1fr;
    }

    #shop-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .shop-filters .filter-btn {
        gap: 14px;
    }

    .shop-category-buttons {
        gap: 14px;
    }

    .shop-filter-btn {
        padding: 0.5rem 16px;
        font-size: 14px;
    }
}

/* --- Product Card --- */
.custom-product-card {
    background: #fff;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
}

.custom-product-card .product-content {
    text-align: left;
}

.custom-product-image img {
    width: 100%;
    height: auto;
}

.product-category a {
    font-weight: 300;
    font-size: 15px;
    text-align: center;
    color: var(--main-body-text);
}

.custom-product-title {
    font-weight: 700;
    font-size: 25px;
    text-align: center;
    margin-bottom: 14px;
    color: var(--main-green);
}

.custom-product-volume,
.custom-product-keyfeatures,
.custom-product-ingredients {
    font-size: 15px;
    margin-bottom: 0.4rem;
}

.custom-product-ingredients-list {
    list-style: disc;
    margin-left: 1rem;
    margin-bottom: 20px;
}


.custom-product-details-btn {
    background-color: var(--main-green);
    color: var(--main-white);
    padding: 8px 25px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: auto;
}

.custom-product-details-btn:hover {
    background-color: var(--main-yellow);
}

.hide-on-mobile {
    display: flex;
}

.show-on-mobile {
    display: none;
}

/* Mobile Styles */
@media (max-width: 600px) {
    .custom-product-details-btn {
        padding: 8px 15px;
    }

    .custom-product-title {
        font-size: 24px;
        height: 2lh;
    }

    .hide-on-mobile {
        display: none;
    }

    .show-on-mobile {
        display: block;
    }
}