/* ============================================================
   AFRIYAH SHOP PAGE CUSTOMIZATIONS
   ============================================================ */

/* 1. GRID LAYOUT & ALIGNMENT FIX */
.post-type-archive-product ul.products,
.tax-product_cat ul.products,
.tax-product_tag ul.products,
.af-shop-grid {
    display: grid !important;
    gap: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    justify-content: start !important;
    /* Start from left */
    justify-items: start !important;
    width: 100% !important;
}

/* Desktop: 3 Columns (Standard) */
@media (min-width: 992px) {

    .post-type-archive-product ul.products,
    .tax-product_cat ul.products,
    .tax-product_tag ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Tablet: 2 Columns */
@media (max-width: 991px) and (min-width: 768px) {

    .post-type-archive-product ul.products,
    .tax-product_cat ul.products,
    .tax-product_tag ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Mobile: 2 Columns (User Preference) */
@media (max-width: 767px) {

    .post-type-archive-product ul.products,
    .tax-product_cat ul.products,
    .tax-product_tag ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        /* Smaller gap for mobile */
    }
}

/* 2. PRODUCT CARD CONSISTENCY */
.af-product-card,
ul.products li.product {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    /* Remove default margins */
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    background: #fff !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
}

.af-product-card:hover,
ul.products li.product:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Image Container */
.af-product-image {
    position: relative !important;
    padding-top: 100% !important;
    /* 1:1 Aspect Ratio */
    overflow: hidden !important;
    width: 100% !important;
}

.af-product-image img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* 3. CTA BUTTON STANDARDIZATION */
.af-product-actions .button,
.af-product-actions .add_to_cart_button,
ul.products li.product .button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    padding: 10px 15px !important;
    margin-top: auto !important;
    /* Push to bottom */
    border-radius: 50px !important;
    /* Pill shape */
    background-color: #006400 !important;
    /* Africah Green */
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    border: none !important;
    text-decoration: none !important;
    transition: background 0.2s !important;
}

.af-product-actions .button:hover,
ul.products li.product .button:hover {
    background-color: #004d00 !important;
    color: #fff !important;
}

/* 4. SIDEBAR ADJUSTMENT (Reduce Width) */
@media (min-width: 992px) {
    .site-main .shop-layout {
        display: grid !important;
        grid-template-columns: 1fr 22% !important;
        /* Reduced sidebar width */
        gap: 30px !important;
        align-items: start !important;
    }

    #wf-sidebar {
        width: 100% !important;
        max-width: 100% !important;
    }
}