/* ============================================================ */
/* COMPREHENSIVE FIXES - PRODUCT CARD UNIFICATION              */
/* ============================================================ */
/* HIGHEST PRIORITY - Loads last to override all other styles */

/* ============================================================ */
/* BUTTON HOVER EFFECTS - Ensure all buttons have working hovers */
/* ============================================================ */

/* Flash Sale Button Hover - Ensure it works */
.wf_navbar-button-item .wf-btn-primary:hover,
.wf_navbar-button-item .wf-btn-primary:focus,
.wf-btn-primary:hover,
.wf-btn-primary:focus {
    color: #fff;
    background-color: rgba(230, 46, 4, 0.9);
    border-color: rgba(230, 46, 4, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(230, 46, 4, 0.3);
    transition: all 0.3s ease;
}

/* All WooCommerce button hovers */
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

/* Search button hover */
.header-search-button:hover,
.wf_search-submit:hover {
    background-color: rgba(230, 46, 4, 0.9);
    transform: scale(1.05);
    transition: all 0.3s ease;
}

/* ============================================================ */
/* PRODUCT CARD UNIFICATION                                    */
/* ============================================================ */

/* Ensure all product cards use the same format as Best Seller */
/* High specificity to override style.css and afriyah-shop-styles-v2.css */
body.woocommerce-shop ul.products li.product .af-product-card,
body.tax-product_cat ul.products li.product .af-product-card,
body.tax-product_tag ul.products li.product .af-product-card,
body.woocommerce-page ul.products li.product .af-product-card,
.page-best-sellers ul.products li.product .af-product-card,
.page-best-sellers .af-product-card,
body.woocommerce-shop .af-product-card,
body.tax-product_cat .af-product-card,
body.tax-product_tag .af-product-card,
body.woocommerce-page .af-product-card,
ul.products li.product .af-product-card,
.woocommerce ul.products li.product .af-product-card,
.af-product-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    height: 100%;
    min-height: auto;
    /* Override style.css min-height: 450px */
    width: 100%;
    /* Ensure full width */
    max-width: 100%;
    /* Prevent overflow */
}

/* Override style.css product list item min-height/height */
body.woocommerce-shop ul.products li.product,
body.tax-product_cat ul.products li.product,
body.tax-product_tag ul.products li.product,
body.woocommerce-page ul.products li.product,
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
ul.products li.product {
    height: auto;
    min-height: 0;
    float: none;
    width: auto;
    margin-right: 0;
    display: flex;
    flex-direction: column;
}

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

/* Override style.css overflow: visible - HIGHEST SPECIFICITY */
body.woocommerce-shop ul.products li.product .af-product-image,
body.tax-product_cat ul.products li.product .af-product-image,
body.tax-product_tag ul.products li.product .af-product-image,
body.woocommerce-page ul.products li.product .af-product-image,
.woocommerce ul.products li.product .af-product-image,
.woocommerce-page ul.products li.product .af-product-image,
.related.products li.product .af-product-image,
.up-sells.products li.product .af-product-image,
.cross-sells li.product .af-product-image,
.woocommerce-cart-empty .new-products-grid li.product .af-product-image,
ul.products li.product .af-product-image,
.af-product-card .af-product-image,
li.product .af-product-image,
.af-product-image {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    /* Override style.css overflow: visible */
    background: #f9f9f9;
}

.af-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.af-product-card:hover .af-product-image img {
    transform: scale(1.05);
}

/* Override afriyah-shop-styles-v2.css padding: 15px and justify-content - HIGHEST SPECIFICITY */
body.woocommerce-shop ul.products li.product .af-product-info,
body.tax-product_cat ul.products li.product .af-product-info,
body.tax-product_tag ul.products li.product .af-product-info,
body.woocommerce-page ul.products li.product .af-product-info,
.woocommerce ul.products li.product .af-product-info,
.woocommerce-page ul.products li.product .af-product-info,
.related.products li.product .af-product-info,
.up-sells.products li.product .af-product-info,
.cross-sells li.product .af-product-info,
.woocommerce-cart-empty .new-products-grid li.product .af-product-info,
ul.products li.product .af-product-info,
.af-product-card .af-product-info,
li.product .af-product-info,
.af-product-info {
    padding: 16px;
    /* Override afriyah-shop-styles-v2.css padding: 15px */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: flex-start;
    /* Override style.css justify-content: space-between */
}

/* Product Title - 2 Lines (Standardized across all cards) */
body.woocommerce-shop .af-product-title,
body.tax-product_cat .af-product-title,
body.tax-product_tag .af-product-title,
ul.products li.product .af-product-title,
.woocommerce ul.products li.product .af-product-title,
.related.products .af-product-title,
.up-sells.products .af-product-title,
.cross-sells .af-product-title,
.woocommerce-cart-empty .af-product-title,
.af-product-card .af-product-title,
.af-product-info .af-product-title,
.af-product-title {
    margin: 0 0 8px;
    padding: 0;
    text-align: left;
    text-indent: 0;
    font-size: clamp(12px, 2.2vw, 16px);
    line-height: 1.4;
    font-weight: 600;
    width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* 2 lines standard */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    min-height: calc(1.4em * 2);
    /* 2 lines height */
    max-height: calc(1.4em * 2);
    height: auto;
}

.af-product-title a {
    color: #333;
    text-decoration: none;
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
}

/* Override afriyah-shop-styles-v2.css short desc (2 lines) */
body.woocommerce-shop .af-loop-short-desc,
body.tax-product_cat .af-loop-short-desc,
body.tax-product_tag .af-loop-short-desc,
ul.products li.product .af-loop-short-desc,
.woocommerce ul.products li.product .af-loop-short-desc,
.af-product-card .af-loop-short-desc,
.af-product-info .af-loop-short-desc,
.af-loop-short-desc {
    font-size: clamp(11px, 2vw, 13px);
    font-weight: 400;
    color: #666;
    margin: 4px 0 12px;
    padding: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* Override afriyah-shop-styles-v2.css 2 lines */
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    text-indent: 0;
    word-wrap: break-word;
}

/* Product Price - Single Line, Full Range Visible */
.af-product-price {
    margin: 8px 0;
    padding: 0;
    font-weight: 700;
    color: #006400;
    font-size: clamp(11px, 1.8vw, 16px);
    line-height: 1.3;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    display: inline-block;
    width: auto;
    max-width: 100%;
    text-align: left;
    text-indent: 0;
    letter-spacing: -0.2px;
    word-break: keep-all;
    vertical-align: baseline;
}

/* All price elements must stay inline */
.af-product-price del,
.af-product-price ins,
.af-product-price .woocommerce-Price-amount,
.af-product-price .price,
.af-product-price .amount,
.af-product-price span,
.af-product-price bdi {
    white-space: nowrap;
    display: inline;
    vertical-align: baseline;
}

.af-delivery-info {
    margin: 8px 0;
    padding: 0;
    font-size: clamp(10px, 1.8vw, 12px);
    color: #666;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    text-align: left;
    text-indent: 0;
}

.af-delivery-info i {
    color: #006400;
    flex-shrink: 0;
}

.af-delivery-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.af-product-actions {
    margin-top: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Shop Page Product Buttons - Match Website Structure */
body.woocommerce-shop .af-product-actions .button,
body.tax-product_cat .af-product-actions .button,
body.tax-product_tag .af-product-actions .button,
body.woocommerce-shop ul.products li.product .button,
body.tax-product_cat ul.products li.product .button,
body.tax-product_tag ul.products li.product .button,
body.woocommerce-shop .woocommerce ul.products li.product .button,
body.tax-product_cat .woocommerce ul.products li.product .button,
body.tax-product_tag .woocommerce ul.products li.product .button,
body.woocommerce-shop .af-product-actions .button.add_to_cart_button,
body.woocommerce-shop .af-product-actions .button.select-options-btn,
body.woocommerce-shop .af-product-actions a.button,
.af-product-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0 20px;
    border-radius: 50px;
    background-color: #006400;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    line-height: normal;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: 10px;
    white-space: nowrap;
    box-sizing: border-box;
    cursor: pointer;
    border: none;
}

body.woocommerce-shop .af-product-actions .button:hover,
body.tax-product_cat .af-product-actions .button:hover,
body.tax-product_tag .af-product-actions .button:hover,
body.woocommerce-shop ul.products li.product .button:hover,
body.tax-product_cat ul.products li.product .button:hover,
body.tax-product_tag ul.products li.product .button:hover,
body.woocommerce-shop .woocommerce ul.products li.product .button:hover,
body.tax-product_cat .woocommerce ul.products li.product .button:hover,
body.tax-product_tag .woocommerce ul.products li.product .button:hover,
.af-product-actions .button:hover {
    background: #004d00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.af-product-actions .added_to_cart {
    background: #fff;
    color: #006400;
    border: 1px solid #006400;
}

/* Single product: ensure Add to Cart / Buy Now are clickable when enabled */
body.single-product .single_add_to_cart_button:not([disabled]):not(.disabled),
body.single-product .af-buy-now-btn:not([disabled]):not(.disabled),
body.single-product .afriyah-add-to-cart-btn:not([disabled]):not(.disabled),
body.single-product .afriyah-buy-now-btn:not([disabled]):not(.disabled) {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Scoped Product Action Buttons (Safe & Consistent) */
/* Using proper CSS specificity instead of !important */
body .woocommerce .product .af-btn-buy-now,
body .woocommerce .product .single_add_to_cart_button,
body .woocommerce .product .button.add_to_cart_button,
body .af-premium-popup-wrapper .af-btn-buy-now,
body .af-premium-popup-wrapper .single_add_to_cart_button,
body .af-premium-popup-wrapper .button,
body .af-featured-product .af-btn-secondary,
body .af-featured-product .af-dynamic-payment-btn button,
body .af-fp-buttons-row .button,
body .af-fp-buttons-row a.button,
body .af-fp-buttons-row .af-pay-btn,
body .woocommerce ul.products li.product .button {
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    line-height: normal;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-shadow: none;
    text-shadow: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

body .woocommerce .product .af-btn-buy-now,
body .af-premium-popup-wrapper .af-btn-buy-now {
    background: #FFD700;
    color: #1a1a1a;
    border: none;
}

body .af-btn-secondary,
body .af-quick-view-btn {
    background: transparent;
    border: 2px solid #006400;
    color: #006400;
}

/* Hero secondary CTA should be white */
body .af-hero-section .af-btn-secondary {
    color: #ffffff;
    border-color: #ffffff;
    background: transparent;
}

body .af-btn-buy-now:hover,
body .single_add_to_cart_button:hover,
body .add_to_cart_button:hover,
body .af-pay-btn:hover,
body .af-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0.95;
}

/* Global Button Colors & Standardization */
body .woocommerce button.button.alt,
body .woocommerce a.button.alt,
body .woocommerce .product .add_to_cart_button,
body .woocommerce .product .single_add_to_cart_button,
body .af-btn-primary {
    background-color: #006400;
    color: #ffffff;
    border: none;
}

body .woocommerce button.button.alt:hover,
body .woocommerce .product .add_to_cart_button:hover {
    background-color: #004d00;
}

body .af-btn-buy-now,
body .af-buy-now-btn {
    background-color: #FFD700;
    color: #000000;
}

body .af-btn-buy-now:hover {
    background-color: #e6c200;
}

/* Dynamic Payment & Button Alignment Fixes */
/* Using proper CSS specificity for Featured Product payment buttons */
.af-featured-product .af-pay-btn,
.af-featured-product .af-btn-secondary,
body .af-featured-product .af-dynamic-payment-btn .af-pay-btn {
    height: 48px;
    min-height: 48px;
    line-height: normal;
    padding: 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.af-featured-product .af-dynamic-payment-btn,
body .af-featured-product .af-dynamic-payment-btn,
.af-featured-info .af-dynamic-payment-btn {
    margin-top: 15px;
    width: 100%;
    display: block;
    visibility: visible;
    opacity: 1;
    min-height: 48px;
}

.af-featured-product .af-dynamic-payment-btn button,
.af-featured-product .af-dynamic-payment-btn .af-pay-btn,
body .af-featured-product .af-dynamic-payment-btn button,
body .af-featured-product .af-dynamic-payment-btn .af-pay-btn,
.af-featured-info .af-dynamic-payment-btn button,
.af-featured-info .af-dynamic-payment-btn .af-pay-btn {
    display: inline-flex;
    visibility: visible;
    opacity: 1;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    padding: 0 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 15px;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    width: 100%;
    margin: 0;
}

.af-featured-product .af-dynamic-payment-btn .af-pay-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.af-featured-product .af-pay-btn i {
    font-size: 18px;
}

.af-featured-product .af-pay-paypal:hover {
    background: #ffde7d;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 196, 57, 0.4);
}

.af-featured-product .af-pay-apple:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.af-featured-product .af-pay-btn.loading {
    opacity: 0.8;
    pointer-events: none;
}

/* Featured Product & Mobile Button Fixes */
.af-featured-product,
.elementor-widget-woocommerce-product-images,
.product_image_area {
    background: #fff;
}

@media (max-width: 768px) {

    body .af-featured-product #wc-stripe-payment-request-button,
    body .af-featured-product #wc-stripe-payment-request-wrapper,
    body .af-featured-product .wc-block-components-express-payment,
    body .af-featured-product .paypal-button,
    body .af-featured-product .wc-ppcp-buttons,
    body .af-featured-product button.paypal-button,
    body .af-featured-product #ppc-button {
        height: 48px;
        border-radius: 50px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    body.single-product .single_add_to_cart_button,
    body.single-product .af-buy-now-btn {
        height: 48px;
        border-radius: 50px;
        flex: 1 1 100%;
        width: 100%;
        margin-bottom: 10px;
    }

    body.single-product .woocommerce-variation-add-to-cart {
        flex-wrap: wrap;
    }
}

/* Featured Product Buttons Row */
.af-featured-product .af-fp-buttons-row,
.af-featured-info .af-fp-buttons-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
    margin-top: 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px;
    scrollbar-width: none;
}

.af-featured-product .af-fp-buttons-row::-webkit-scrollbar,
.af-featured-info .af-fp-buttons-row::-webkit-scrollbar {
    display: none;
}

.af-featured-product .af-fp-buttons-row>a,
.af-featured-product .af-fp-buttons-row>button,
.af-featured-product .af-fp-buttons-row>span,
.af-featured-product .af-fp-buttons-row .af-dynamic-payment-btn button,
.af-featured-info .af-fp-buttons-row>a,
.af-featured-info .af-fp-buttons-row>button,
.af-featured-info .af-fp-buttons-row>span,
.af-featured-info .af-fp-buttons-row .af-dynamic-payment-btn button {
    height: 48px;
    min-height: 48px;
    line-height: normal;
    padding: 0 24px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    white-space: nowrap;
    margin: 0;
}

.af-featured-product .af-fp-buttons-row i,
.af-featured-info .af-fp-buttons-row i {
    margin-right: 8px;
}

/* Base display handled by row layout; keep only mobile overrides below */

@media (max-width: 768px) {

    .af-featured-product .af-fp-buttons-row>a,
    .af-featured-product .af-fp-buttons-row>button,
    .af-featured-product .af-fp-buttons-row>span,
    .af-featured-product .af-fp-buttons-row .af-dynamic-payment-btn button,
    .af-featured-info .af-fp-buttons-row>a,
    .af-featured-info .af-fp-buttons-row>button,
    .af-featured-info .af-fp-buttons-row>span,
    .af-featured-info .af-fp-buttons-row .af-dynamic-payment-btn button,
    .af-featured-info .af-dynamic-payment-btn button {
        padding: 0 20px;
    }
}

@media (max-width: 768px) {

    .af-featured-products-section .af-fp-buttons-row .af-btn-primary,
    .af-featured-products-section .af-fp-buttons-row .af-btn-buy-now,
    .af-featured-products-section .af-fp-buttons-row .af-pay-btn,
    .af-featured-products-section .af-fp-buttons-row .af-pay-paypal,
    .af-featured-products-section .af-fp-buttons-row .af-pay-apple,
    .af-featured-products-section .af-fp-buttons-row button.af-pay-btn,
    .af-featured-products-section .af-fp-buttons-row button.af-pay-paypal,
    .af-featured-products-section .af-fp-buttons-row button.af-pay-apple,
    .af-featured-products-section .af-fp-buttons-row .button,
    .af-featured-products-section .af-fp-buttons-row .add_to_cart_button,
    .af-featured-products-section .af-fp-buttons-row .single_add_to_cart_button,
    .af-featured-info .af-dynamic-payment-btn,
    .af-featured-info .af-dynamic-payment-btn button,
    .af-featured-info .af-dynamic-payment-btn .af-pay-btn,
    .af-featured-info .af-dynamic-payment-btn button.af-pay-paypal,
    .af-featured-info .af-dynamic-payment-btn button.af-pay-apple,
    .af-featured-product .af-dynamic-payment-btn button,
    .af-featured-product .af-dynamic-payment-btn button.af-pay-paypal,
    .af-featured-product .af-dynamic-payment-btn button.af-pay-apple {
        height: 48px;
        min-height: 48px;
        max-height: 48px;
        padding: 0 20px;
        font-size: 15px;
        font-weight: 700;
        border-radius: 50px;
        flex: 1 1 auto;
        min-width: 120px;
        width: auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        line-height: normal;
        box-sizing: border-box;
        margin: 0;
    }

    .af-featured-products-section button.af-pay-paypal[style],
    .af-featured-info button.af-pay-paypal[style],
    .af-featured-product button.af-pay-paypal[style],
    .af-fp-buttons-row button.af-pay-paypal[style] {
        height: 48px;
        min-height: 48px;
        max-height: 48px;
        padding: 0 20px;
        line-height: normal;
    }

    .af-featured-products-section button.af-pay-apple[style],
    .af-featured-info button.af-pay-apple[style],
    .af-featured-product button.af-pay-apple[style],
    .af-fp-buttons-row button.af-pay-apple[style] {
        height: 48px;
        min-height: 48px;
        max-height: 48px;
        padding: 0 20px;
        line-height: normal;
    }

    .af-featured-info .af-dynamic-payment-btn {
        display: inline-block;
        visibility: visible;
        opacity: 1;
        margin-top: 12px;
    }

    .af-featured-info .af-dynamic-payment-btn button.af-pay-btn {
        display: inline-flex;
        visibility: visible;
        opacity: 1;
    }

    .af-featured-product .af-fp-buttons-row,
    .af-featured-info .af-fp-buttons-row,
    .woocommerce-variation-add-to-cart,
    form.cart {
        gap: 8px;
    }

    .af-featured-product .af-fp-buttons-row>*,
    .af-featured-info .af-fp-buttons-row>* {
        min-width: 0;
        flex-basis: 0;
        max-width: 100%;
    }

    .af-featured-product .af-fp-buttons-row>*,
    .af-featured-info .af-fp-buttons-row>*,
    .woocommerce-variation-add-to-cart .button,
    .woocommerce-variation-add-to-cart .af-btn-buy-now,
    .product-type-simple .single_add_to_cart_button,
    .product-type-simple .af-btn-buy-now {
        font-size: 14px;
        padding: 0 16px;
        flex: 1 0 auto;
        width: auto;
    }
}

/* Featured Product Buttons - Side by Side */
.af-featured-product .af-fp-buttons-row,
.af-featured-info .af-fp-buttons-row {
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
    max-width: 100%;
    width: 100%;
    overflow: visible;
    padding-bottom: 0;
    margin-left: auto;
    margin-right: auto;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.af-featured-product .af-fp-buttons-row>a:not(.af-btn-secondary),
.af-featured-product .af-fp-buttons-row>button,
.af-featured-product .af-fp-buttons-row>.af-dynamic-payment-btn,
.af-featured-product .af-fp-buttons-row>span,
.af-featured-info .af-fp-buttons-row>a:not(.af-btn-secondary),
.af-featured-info .af-fp-buttons-row>button,
.af-featured-info .af-fp-buttons-row>.af-dynamic-payment-btn,
.af-featured-info .af-fp-buttons-row>span {
    width: auto;
    margin: 0;
    flex: 1 1 0;
    min-width: 0;
    height: 48px;
}

.af-featured-product .af-fp-buttons-row .af-dynamic-payment-btn button,
.af-featured-info .af-fp-buttons-row .af-dynamic-payment-btn button {
    width: 100%;
}

.af-featured-product .af-fp-buttons-row .af-dynamic-payment-btn,
.af-featured-info .af-fp-buttons-row .af-dynamic-payment-btn,
.af-featured-product .af-fp-buttons-row .af-pay-paypal,
.af-featured-product .af-fp-buttons-row .af-pay-apple,
.af-featured-info .af-fp-buttons-row .af-pay-paypal,
.af-featured-info .af-fp-buttons-row .af-pay-apple {
    flex: 1 1 0;
    min-width: 0;
}

.af-featured-product .af-fp-buttons-row .af-pay-paypal,
.af-featured-product .af-fp-buttons-row .af-pay-apple,
.af-featured-info .af-fp-buttons-row .af-pay-paypal,
.af-featured-info .af-fp-buttons-row .af-pay-apple {
    height: 48px;
    padding: 0 24px;
    font-size: 15px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.af-featured-product .af-fp-buttons-row .af-btn-secondary,
.af-featured-info .af-fp-buttons-row .af-btn-secondary {
    display: none;
}

/* Compare Button - Loop Cards */
.woocommerce ul.products li.product .af-compare-btn,
.woocommerce ul.products li.product .compare {
    height: auto;
    min-height: 0;
    padding: 5px;
    background: transparent;
    border: none;
    color: #333;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 0;
    box-shadow: none;
    font-weight: normal;
    font-size: 14px;
}

.woocommerce ul.products li.product .af-compare-btn:hover,
.woocommerce ul.products li.product .compare:hover {
    color: #006400;
    background: rgba(0, 100, 0, 0.1);
    border-radius: 50px;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.2);
    transition: all 0.3s ease;
}

.woocommerce ul.products li.product .af-compare-btn i,
.woocommerce ul.products li.product .compare i {
    font-size: 16px;
    margin: 0;
}

/* Popup Visibility Logic - Single Source of Truth */
#af-select-options-popup,
#af-quick-view-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

#af-select-options-popup[style*="display: flex"],
#af-select-options-popup[style*="display:flex"],
#af-quick-view-modal[style*="display: flex"],
#af-quick-view-modal[style*="display:flex"] {
    display: flex;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

#af-select-options-popup.active,
#af-select-options-popup:not([style*="display: flex"]):not([style*="display:flex"]),
#af-quick-view-modal.active,
#af-quick-view-modal:not([style*="display: flex"]):not([style*="display:flex"]) {
    display: none;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Quick View Popup UI */
.af-qv-body {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    background: #fff;
}

.af-popup-header {
    background: linear-gradient(135deg, #006400 0%, #004d00 100%);
    padding: 20px 24px;
}

.af-popup-title {
    font-family: inherit;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.af-popup-thumb {
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.af-popup-content {
    padding: 24px;
}

.af-popup-content table.variations td.label {
    padding-bottom: 8px;
}

.af-popup-content table.variations td.value {
    margin-bottom: 15px;
}

.af-qv-content {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: transparent;
    box-shadow: none;
}

.af-premium-popup-wrapper.af-diagram-popup {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.af-diagram-popup .af-qv-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #333;
    z-index: 100;
    transition: all 0.2s ease;
}

.af-diagram-popup .af-qv-close:hover {
    background: #d32f2f;
    color: #fff;
}

.af-popup-top-section {
    display: flex;
    flex-direction: row;
    border-bottom: 1px solid #eee;
}

@media (max-width: 768px) {
    .af-popup-top-section {
        flex-direction: column;
    }
}

.af-popup-col-left {
    width: 45%;
    background: #fdfdfd;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-right: 1px solid #f0f0f0;
}

@media (max-width: 768px) {
    .af-popup-col-left {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 15px;
    }
}

.af-popup-image-container {
    width: 100%;
    text-align: center;
    margin-bottom: 15px;
    position: relative;
}

.af-popup-image-container img {
    max-height: 300px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.af-popup-urgency-wrapper {
    width: 100%;
    margin-bottom: 15px;
    margin-top: 10px;
}

.af-popup-delivery-tiny {
    font-size: 12px;
    color: #555;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.af-popup-delivery-tiny i {
    color: #006400;
}

.af-popup-col-right {
    width: 55%;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .af-popup-col-right {
        width: 100%;
        padding: 20px;
    }
}

.af-popup-title-new {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1.3;
    color: #111;
}

.af-popup-price-new {
    font-size: 18px;
    color: #006400;
    font-weight: 700;
    margin-bottom: 0;
}

.af-popup-description-short {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 20px;
}

.af-popup-form-container table.variations {
    width: 100%;
    margin-bottom: 15px;
    display: block;
}

.af-popup-form-container tbody {
    display: block;
}

.af-popup-form-container tr {
    display: block;
    margin-bottom: 10px;
}

.af-popup-form-container td {
    display: block;
    padding: 0;
}

.af-popup-form-container label {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.af-popup-form-container select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    height: 36px;
}

.af-popup-form-container .single_add_to_cart_button,
.af-popup-form-container .af-buy-now-btn,
.af-popup-form-container button.button {
    width: 100%;
    border-radius: 50px;
    height: 44px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.af-popup-bottom-section {
    background: #fdfdfd;
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

.af-popup-bottom-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.af-popup-pairs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .af-popup-pairs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.af-pair-card {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e1e1e1;
    padding: 10px;
    border-radius: 8px;
    gap: 10px;
    transition: border-color 0.2s;
}

.af-pair-card:hover {
    border-color: #006400;
    transform: translateY(-2px);
}

.af-pair-img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
}

.af-pair-img img,
.af-pair-card img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.af-pair-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.af-pair-info .name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.af-pair-info .price {
    font-size: 12px;
    color: #006400;
    font-weight: 700;
}

.af-pair-link {
    width: 24px;
    height: 24px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    text-decoration: none;
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}

.af-pair-link:hover {
    background: #006400;
    color: #fff;
}

.af-popup-form-container table.variations select:focus {
    border-color: #006400;
    outline: none;
}

.af-qv-body .product-bundle-section {
    margin-top: 10px;
    padding: 15px;
    background: #fdfdfd;
    border: 1px dashed #ccc;
}

.af-qv-body h3.bundle-title {
    font-size: 16px;
    margin-bottom: 10px;
}

.woocommerce-variation-add-to-cart {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

body.woocommerce-shop ul.products::before,
body.woocommerce-shop ul.products::after,
body.tax-product_cat ul.products::before,
body.tax-product_cat ul.products::after,
body.tax-product_tag ul.products::before,
body.tax-product_tag ul.products::after {
    display: none;
}

/* Shop page: product cards start left to right, no gap or blank first card */
#af-shop-products-section,
body.woocommerce-shop #af-shop-products-section,
body.tax-product_cat #af-shop-products-section,
body.tax-product_tag #af-shop-products-section,
body.woocommerce-shop .wf-main,
body.tax-product_cat .wf-main,
body.tax-product_tag .wf-main {
    padding-left: 0;
}


#af-shop-products-section ul.products,
body.woocommerce-shop ul.products,
body.tax-product_cat ul.products,
body.tax-product_tag ul.products {
    padding-left: 0;
    margin-left: 0;
    justify-content: start;
}

.product-inner {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Button UI in Popup */
.af-popup-form-container .woocommerce-variation-add-to-cart .single_add_to_cart_button,
.af-premium-popup-wrapper .woocommerce-variation-add-to-cart .single_add_to_cart_button {
    background: #000;
    color: #fff;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.2s;
}

.af-popup-form-container .woocommerce-variation-add-to-cart .single_add_to_cart_button:hover,
.af-premium-popup-wrapper .woocommerce-variation-add-to-cart .single_add_to_cart_button:hover {
    background: #333;
    transform: translateY(-1px);
}

.af-popup-form-container .woocommerce-variation-add-to-cart .af-buy-now-btn,
.af-premium-popup-wrapper .woocommerce-variation-add-to-cart .af-buy-now-btn {
    background: #f7931e;
    color: #fff;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(247, 147, 30, 0.3);
}

.af-popup-form-container .woocommerce-variation-add-to-cart .af-buy-now-btn:hover,
.af-premium-popup-wrapper .woocommerce-variation-add-to-cart .af-buy-now-btn:hover {
    background: #e68a1c;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(247, 147, 30, 0.4);
}

.af-sticky-add-to-cart-trigger {
    background: #006400;
    color: #fff;
}

.woocommerce-variation-add-to-cart .quantity {
    flex: 0 0 auto;
    width: 60px;
    margin-right: 0;
    display: inline-block;
}

.woocommerce-variation-add-to-cart .quantity input.qty {
    width: 100%;
    height: 48px;
    padding: 0 5px;
    text-align: center;
}

.af-sticky-atc .af-sticky-btn {
    font-size: 13px;
    padding: 0 15px;
    height: 40px;
    line-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
}

.shop-page-title-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.shop-top-rated-btn {
    order: 2;
    margin-top: 10px;
}

/* Reinforced Button Alignment & Premium Popup */
/* Using proper CSS specificity instead of !important */
body.single-product .woocommerce div.product .woocommerce-variation-add-to-cart,
body.single-product .woocommerce div.product form.cart:not(.variations_form) {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    width: 100%;
}

body.single-product .woocommerce div.product .woocommerce-variation-add-to-cart .single_add_to_cart_button,
body.single-product .woocommerce div.product .woocommerce-variation-add-to-cart .af-buy-now-btn,
body.single-product .woocommerce div.product.product-type-simple .single_add_to_cart_button,
body.single-product .woocommerce div.product.product-type-simple .af-buy-now-btn {
    margin: 0;
    height: 48px;
    line-height: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border-radius: 50px;
    box-sizing: border-box;
    vertical-align: middle;
    flex: 1;
    width: auto;
    font-size: 15px;
    font-weight: 700;
}

body.single-product .woocommerce div.product .woocommerce-variation-add-to-cart .af-buy-now-btn {
    background: #FFD700;
    color: #000;
    border: none;
}

body.single-product .woocommerce div.product .woocommerce-variation-add-to-cart .single_add_to_cart_button {
    background: #006400;
    color: #fff;
}

body.single-product .woocommerce div.product .quantity {
    display: inline-flex;
    height: 48px;
    margin: 0;
    vertical-align: middle;
    align-items: center;
}

body.single-product .woocommerce div.product .quantity input.qty {
    height: 48px;
    border-radius: 8px;
    border: 1px solid #ddd;
    line-height: normal;
}

/* Bundle Tick Visibility */
.bundle-checkbox input {
    display: block;
    opacity: 1;
    z-index: 99;
}



.af-bundle-checkbox-wrapper {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 20;
}

/* Delivery Estimate in Popup */
.af-delivery-estimate {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border: 1px dashed #ced4da;
    margin-bottom: 20px;
    margin-top: 10px;
}

.af-delivery-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #006400;
    margin-bottom: 5px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.af-delivery-msg {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

/* Bundle & Pairs Well With */
.product-bundle-section {
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.bundle-header {
    text-align: center;
    margin-bottom: 30px;
}

.bundle-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: #28a745;
    margin-bottom: 8px;
}

.bundle-header p {
    color: #666;
    font-size: 16px;
}

.bundle-product-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
}

.bundle-product {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    max-width: 150px;
    width: 150px;
    flex-shrink: 0;
    position: relative;
}

.bundle-product.current-product {
    border: 2px solid #28a745;
}

.bundle-product-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.bundle-product-image img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 60px !important;
    min-height: 60px !important;
    object-fit: cover !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Single variant / Pairs well with - force image container and fallback */
.bundle-product-image,
.product-bundle-section .bundle-product-image {
    min-width: 60px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.bundle-product-info h4 {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    text-align: center;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.bundle-price {
    font-size: 14px;
    font-weight: 700;
    color: #28a745;
    margin: 0;
}

.bundle-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
}

.bundle-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.bundle-checkbox label {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #eee;
    border-radius: 4px;
    border: 1px solid #ccc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bundle-checkbox input:checked~label {
    background-color: #28a745;
    border-color: #28a745;
}

.bundle-checkbox input:checked~label::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.bundle-plus {
    font-size: 20px;
    color: #28a745;
    font-weight: bold;
    flex-shrink: 0;
}

.bundle-actions {
    text-align: center;
}

.bundle-add-to-cart-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.bundle-add-to-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
    background-image: none;
}

/* Shop Page - Result Count & Ordering Layout */
.woocommerce-products-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    gap: 15px;
}

/* Best Sellers Grid */
#af-bestsellers-grid {
    display: grid;
    grid-template-columns: repeat(var(--af-bestseller-cols-desktop, 4), minmax(0, 1fr));
    gap: 24px;
}

#af-bestsellers-grid li.product {
    width: 100%;
    min-width: 0;
}

@media (max-width: 768px) {
    #af-bestsellers-grid {
        grid-template-columns: repeat(var(--af-bestseller-cols-mobile, 2), minmax(0, 1fr));
        gap: 16px;
    }
}

/* Legacy product image container */
.product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

@supports not (aspect-ratio: 1 / 1) {
    .product-image {
        padding-top: 100%;
        height: 0;
    }
}

/* Featured Product - View Details Link */
.af-fp-view-details-top {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    z-index: 5;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.af-fp-view-details-top:hover {
    color: #006400;
    text-decoration: underline;
}

/* Urgency & Scarcity Bars */
.af-urgency-bar {
    padding: 12px 16px;
    margin: 15px 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    line-height: 1.4;
}

.af-urgency-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.af-urgency-text {
    font-weight: 600;
}

.af-fomo-bar {
    background: #FFEBEE;
    border-left: 4px solid #FF5252;
    color: #C62828;
}

.af-fomo-bar .af-urgency-icon {
    color: #FF1744;
}

.af-timer-bar {
    background: #E0F2F1;
    border-left: 4px solid #009688;
    color: #00695C;
}

.af-timer-bar .af-urgency-icon {
    color: #00897B;
}

.af-social-proof-viewing {
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
    color: #495057;
}

.af-social-proof-sold {
    background: #E8F5E9;
    border-left: 4px solid #43A047;
    color: #2E7D32;
}

.af-social-proof-sold .af-urgency-icon {
    color: #2E7D32;
}

/* Header - Topbar Layout & Mobile Toggle */
.af-site-header .wf-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

@media (min-width: 992px) {
    .af-site-header .widget--left {
        text-align: left;
        justify-content: flex-start;
        display: flex;
    }

    .af-site-header .widget--center {
        text-align: center;
        justify-content: center;
        display: flex;
    }

    .af-site-header .widget--right {
        text-align: right;
        justify-content: flex-end;
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .af-mobile-top-toggle {
        display: none;
    }

    .wf_header-topbar {
        display: block;
    }

    .wf_header-topbar .af-site-header {
        display: block;
    }

    .wf_navbar-wrapper,
    .wf_navbar-navwrapper,
    .wf_header-navwrapperinner {
        overflow: visible;
    }

    .product-categories.active .wf_navbar-nav.vertical-menu {
        display: block;
        visibility: visible;
        opacity: 1;
    }

    .product-categories .wf_navbar-nav.vertical-menu {
        z-index: 1000;
        pointer-events: auto;
    }
}

@media (max-width: 991px) {
    .af-site-header {
        display: none;
    }

    .af-site-header .wf-row {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px 0;
        gap: 10px;
    }

    /* Display in 2 rows: First row has 2 items, second row has 1 item */
    .af-site-header .wf-col-lg-4 {
        width: calc(50% - 5px);
        text-align: center;
        margin-bottom: 10px;
        flex: 0 0 calc(50% - 5px);
    }

    /* Third column (right) takes full width on second row */
    .af-site-header .wf-col-lg-4:last-child {
        width: 100%;
        flex: 0 0 100%;
    }

    .af-site-header .widget--left,
    .af-site-header .widget--center,
    .af-site-header .widget--right {
        justify-content: center;
        text-align: center;
    }

    .wf_header-topbar {
        display: none;
    }

    .wf_navbar,
    .wf_navbar-wrapper,
    .wf_navbar-menu,
    .wf_navbar-nav {
        display: none;
        visibility: hidden;
    }

    .wf-d-lg-block {
        display: none;
    }

    .wf-d-lg-none {
        display: block;
    }

    .wf_mobilenav-topbar {
        display: flex;
        flex-direction: column-reverse;
        align-items: center;
        justify-content: flex-start;
        text-align: center;
        background: var(--wf-main-color);
        padding: 8px 0;
        width: 100%;
        box-sizing: border-box;
    }

    .wf_mobilenav-topbar-toggle {
        display: inline-block;
        position: relative;
        width: 2.5rem;
        height: 2.5rem;
        line-height: 2.8rem;
        background-color: #fff;
        border: none;
        color: var(--wf-secondary-color);
        cursor: pointer;
        border-radius: 4px;
        z-index: 10;
    }

    .wf_mobilenav-topbar-content {
        display: none;
        width: 100%;
        max-width: 100%;
        padding: 1.7rem 15px;
        box-sizing: border-box;
        overflow: visible;
        -webkit-overflow-scrolling: touch;
    }

    .wf_mobilenav-topbar-content.active {
        display: block;
        visibility: visible;
        opacity: 1;
    }

    .wf_mobilenav-topbar-content .wf-container {
        max-width: 100%;
        padding: 0 15px;
        box-sizing: border-box;
    }

    .wf_mobilenav-topbar-content .wf-row {
        margin: 0;
        width: 100%;
        max-width: 100%;
    }

    .wf_mobilenav-topbar-content .wf-col-12 {
        width: 100%;
        max-width: 100%;
        padding: 0;
        box-sizing: border-box;
    }

    .wf_mobilenav-topbar-content.active .af-site-header,
    .wf_mobilenav-topbar-content.active .widget,
    .wf_mobilenav-topbar-content.active .wf_header-widget,
    .wf_mobilenav-topbar-content.active [class*="widget"] {
        display: block;
        visibility: visible;
        opacity: 1;
    }

    .wf_mobilenav-topbar-content.active .af-site-header .wf-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 15px;
        padding: 20px 0;
    }

    /* Professional 2-row layout: first 2 items side-by-side, third item full width */
    .wf_mobilenav-topbar-content.active .af-site-header .wf-col-lg-4 {
        width: 100%;
        flex: 0 0 100%;
        margin-bottom: 0;
        padding-left: 20px;
        padding-right: 20px;
    }

    /* First two columns in first row */
    .wf_mobilenav-topbar-content.active .af-site-header .wf-col-lg-4:nth-child(1),
    .wf_mobilenav-topbar-content.active .af-site-header .wf-col-lg-4:nth-child(2) {
        grid-column: span 1;
    }

    /* Third column takes full width on second row */
    .wf_mobilenav-topbar-content.active .af-site-header .wf-col-lg-4:last-child {
        grid-column: 1 / -1;
        width: 100%;
        flex: 0 0 100%;
        margin-top: 10px;
    }

    /* Professional spacing and indentation for content */
    .wf_mobilenav-topbar-content.active .af-site-header .widget--left,
    .wf_mobilenav-topbar-content.active .af-site-header .widget--center,
    .wf_mobilenav-topbar-content.active .af-site-header .widget--right {
        padding: 12px 0;
        line-height: 1.6;
    }

    /* Promo text styling - two lines, well spaced */
    .wf_mobilenav-topbar-content.active .af-promo-text {
        display: block;
        font-size: 14px;
        line-height: 1.8;
        padding-left: 0;
        text-align: left;
    }

    /* Social icons - centered, well spaced */
    .wf_mobilenav-topbar-content.active .widget--center {
        text-align: center;
        padding: 12px 0;
    }

    /* Email and currency - right aligned, well spaced */
    .wf_mobilenav-topbar-content.active .widget--right {
        text-align: right;
        padding: 12px 0;
    }

    .wf_mobilenav-topbar-content.active .af-header-email {
        display: block;
        margin-bottom: 12px;
        font-size: 14px;
        line-height: 1.6;
    }
}

/* Mobile Side Nav - ensure active panel is visible */
body.wf_mobilenav-mainmenu--active .wf_mobilenav-mainmenu-content {
    display: block;
    visibility: visible;
    opacity: 1;
}

.wf_mobilenav-mainmenu-content .wf_mobilenav-mainmenu-inner {
    height: 100%;
}

.af-site-header {
    background-color: #0a1027;
    color: #fff;
}

.af-site-header a {
    color: #fff;
}

/* Single Product - Quantity input height */
body.single-product .woocommerce div.product form.cart .quantity,
body.single-product .woocommerce div.product form.cart .quantity input.qty {
    height: 48px;
    min-height: 48px;
    line-height: normal;
    box-sizing: border-box;
}

/* Footer Fix - Desktop Side by Side */
@media (min-width: 992px) {
    .af-footer-grid {
        display: grid;
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
        gap: 30px;
        align-items: start;
    }
}

/* Line Clamp Utility */
.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Short Description Styling */
.woocommerce-product-details__short-description {
    margin-bottom: 15px;
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Featured Product Quick Actions */
.af-featured-product-card .af-quick-actions,
.af-featured-product-section .af-quick-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: auto;
}

.af-featured-product-card .af-quick-actions>*,
.af-featured-product-section .af-quick-actions>* {
    width: auto;
    max-width: 100%;
    display: inline-flex;
    flex-shrink: 0;
}

.af-featured-product-card .af-quick-actions .af-compare-btn,
.af-featured-product-card .af-quick-actions .compare,
.af-featured-product-section .af-quick-actions .af-compare-btn,
.af-featured-product-section .af-quick-actions .compare,
.af-featured-product-card .af-quick-actions .yith-woocompare-button,
.af-featured-product-section .af-quick-actions .yith-woocompare-button,
.af-featured-product-card .af-quick-actions .yith-woocompare-button a,
.af-featured-product-section .af-quick-actions .yith-woocompare-button a {
    height: auto;
    min-height: 0;
    padding: 5px;
    background: transparent;
    border: none;
    color: #333;
    width: auto;
    max-width: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 50px;
    box-shadow: none;
    font-weight: normal;
    font-size: 14px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.af-featured-product-card .af-quick-actions .af-compare-btn:hover,
.af-featured-product-card .af-quick-actions .compare:hover,
.af-featured-product-section .af-quick-actions .af-compare-btn:hover,
.af-featured-product-section .af-quick-actions .compare:hover,
.af-featured-product-card .af-quick-actions .yith-woocompare-button:hover,
.af-featured-product-section .af-quick-actions .yith-woocompare-button:hover,
.af-featured-product-card .af-quick-actions .yith-woocompare-button a:hover,
.af-featured-product-section .af-quick-actions .yith-woocompare-button a:hover {
    color: #fff;
    background: #006400;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.2);
    border-radius: 50px;
}

/* Best Sellers / Featured Compare Buttons */
#af-bestsellers-grid .af-compare-btn,
#af-bestsellers-grid .compare,
#af-bestsellers-grid .yith-woocompare-button,
#af-bestsellers-grid .yith-woocompare-button a,
.af-featured-products-section .af-compare-btn,
.af-featured-products-section .compare,
.best-sellers-products .af-compare-btn,
.best-sellers-products .compare,
.best-sellers-products .yith-woocompare-button,
.best-sellers-products .yith-woocompare-button a,
.shop-products .af-compare-btn,
.shop-products .compare,
.shop-products .yith-woocompare-button,
.shop-products .yith-woocompare-button a,
.page-best-sellers .af-compare-btn,
.page-best-sellers .compare,
.page-best-sellers .yith-woocompare-button,
.page-best-sellers .yith-woocompare-button a {
    height: auto;
    min-height: 0;
    padding: 5px;
    background: transparent;
    border: none;
    color: #333;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 50px;
    box-shadow: none;
    font-weight: normal;
    font-size: 14px;
    transition: all 0.3s ease;
}

#af-bestsellers-grid .af-compare-btn:hover,
#af-bestsellers-grid .compare:hover,
#af-bestsellers-grid .yith-woocompare-button:hover,
#af-bestsellers-grid .yith-woocompare-button a:hover,
.af-featured-products-section .af-compare-btn:hover,
.af-featured-products-section .compare:hover,
.best-sellers-products .af-compare-btn:hover,
.best-sellers-products .compare:hover,
.best-sellers-products .yith-woocompare-button:hover,
.best-sellers-products .yith-woocompare-button a:hover,
.shop-products .af-compare-btn:hover,
.shop-products .compare:hover,
.shop-products .yith-woocompare-button:hover,
.shop-products .yith-woocompare-button a:hover,
.page-best-sellers .af-compare-btn:hover,
.page-best-sellers .compare:hover,
.page-best-sellers .yith-woocompare-button:hover,
.page-best-sellers .yith-woocompare-button a:hover {
    color: #fff;
    background: #006400;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.2);
    border-radius: 50px;
}

/* Social Share Styles - Unified */
.af-product-social-share {
    margin: 24px 0;
    padding: 16px;
    background: #f7faf7;
    border-radius: 12px;
}

.af-share-title {
    margin: 0 0 12px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.af-share-title i {
    color: #006400;
    margin-right: 6px;
}

.af-social-share-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.af-share-row {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
}

.af-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: #fff;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
    flex: 1;
    min-width: 0;
    justify-content: center;
}

.af-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #fff;
}

.af-share-facebook {
    background: #1877F2;
}

.af-share-twitter {
    background: #1DA1F2;
}

.af-share-whatsapp {
    background: #25D366;
}

.af-share-pinterest {
    background: #BD081C;
}

.af-share-linkedin {
    background: #0077B5;
}

.af-share-tiktok {
    background: #000000;
    border: none;
    cursor: pointer;
}

@media (max-width: 768px) {
    .af-share-row {
        width: 100%;
    }

    .af-share-btn {
        font-size: 12px;
        padding: 8px 12px;
    }

    .af-share-btn span {
        display: inline;
    }
}

@media (max-width: 480px) {
    .af-share-btn {
        font-size: 11px;
        padding: 6px 10px;
    }

    .af-share-btn i {
        font-size: 14px;
    }
}

/* Popup FOMO Styles */
.af-popup-urgency-wrapper .af-fomo-single {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffecb3;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.af-qv-body .af-fomo-single {
    background: #fff5f5;
    color: #ff0000;
    border: 1px dashed #ff0000;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
    display: table;
}

/* Popup Delivery Details */
.af-popup-delivery-wrapper {
    margin-top: 25px;
    padding: 15px;
    background: #f0f7f0;
    border-radius: 8px;
    border: 1px solid #e0ebe0;
    font-size: 13px;
    color: #006400;
    display: flex;
    gap: 10px;
    align-items: center;
}

.af-popup-delivery-wrapper i {
    font-size: 16px;
}

/* Badges */
.af-badge-savings {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #FFD700;
    color: #1a1a1a;
    font-weight: 700;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 12px;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.af-qa-badge-icon {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    width: clamp(28px, 8vw, 36px);
    height: clamp(28px, 8vw, 36px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(12px, 3vw, 16px);
    z-index: 5;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

.af-quick-actions {
    position: absolute;
    right: 8px;
    top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 100;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

.af-quick-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #fff;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 14px;
    opacity: 1;
}

.af-quick-btn:hover {
    background: #006400;
    color: #fff;
}

/* FOMO Badge */
.af-fomo {
    margin: 8px 0;
    padding: 2px 10px;
    background: #ff6b6b;
    color: #fff;
    font-weight: 700;
    border-radius: 8px;
    font-size: clamp(10px, 1.8vw, 12px);
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    width: auto;
    max-width: 100%;
    text-indent: 0;
}

/* Ensure related/upsell/cross-sell cards use full height */
.related.products li.product:not(.af-related-products-single-row li.product),
.up-sells.products li.product,
.cross-sells li.product {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.related.products li.product:not(.af-related-products-single-row li.product) .af-product-card,
.up-sells.products li.product .af-product-card,
.cross-sells li.product .af-product-card {
    height: 100%;
}

/* Related Products - Single Row Layout - Handled by layout-styles.php with higher specificity */

/* Upsells and Cross-sells - Handled by layout-styles.php */

.related.products ul.products li.product,
.up-sells.products ul.products li.product,
.cross-sells ul.products li.product {
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.related.products .af-product-card,
.up-sells.products .af-product-card,
.cross-sells .af-product-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 100%;
}

/* Ensure Related Products Use Same Template */
.related.products .af-product-image,
.up-sells.products .af-product-image,
.cross-sells .af-product-image {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: #f9f9f9;
}

.related.products .af-product-info,
.up-sells.products .af-product-info,
.cross-sells .af-product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Trust Badges Spacing Fix */
.af-trust-badges {
    margin: 20px 0 16px 0;
    padding: 0;
}

.af-trust-badges-header {
    margin-bottom: 12px;
}

.af-trust-badges-row {
    margin-top: 0;
}

/* Browse Categories Responsive */
.product-categories {
    position: relative;
}

.browse-categories-btn {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #006400;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.browse-categories-btn:hover {
    background: #008000;
}

.wf_navbar-nav.vertical-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    background: #fff;
    width: 100%;
    min-width: 280px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 8px 8px;
    margin-top: 4px;
}

/* CTA Button Fix */
.af-top-rated-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 200px;
}

.af-top-rated-cta i,
.af-top-rated-cta .fas {
    display: inline-block;
    font-size: 16px;
}

.af-top-rated-cta span {
    display: inline-block;
}

/* Shop Sidebar - Hide WooCommerce Default, Show Afriyah */
/* Using proper CSS specificity instead of !important */
body.woocommerce-shop #secondary,
body.tax-product_cat #secondary,
body.tax-product_tag #secondary,
body.woocommerce-shop .woocommerce-sidebar,
body.tax-product_cat .woocommerce-sidebar,
body.tax-product_tag .woocommerce-sidebar,
body.woocommerce-shop aside.widget-area:not(#wf-sidebar),
body.tax-product_cat aside.widget-area:not(#wf-sidebar),
body.tax-product_tag aside.widget-area:not(#wf-sidebar) {
    display: none;
}

/* Desktop: Show Afriyah sidebar */
@media (min-width: 992px) {

    body.woocommerce-shop #wf-sidebar:not(.af-fixed-sidebar),
    body.tax-product_cat #wf-sidebar:not(.af-fixed-sidebar),
    body.tax-product_tag #wf-sidebar:not(.af-fixed-sidebar),
    body.woocommerce-shop .wf_widget-area:not(.af-fixed-sidebar),
    body.tax-product_cat .wf_widget-area:not(.af-fixed-sidebar),
    body.tax-product_tag .wf_widget-area:not(.af-fixed-sidebar),
    body.woocommerce-shop .shop-sidebar:not(.af-fixed-sidebar),
    body.tax-product_cat .shop-sidebar:not(.af-fixed-sidebar),
    body.tax-product_tag .shop-sidebar:not(.af-fixed-sidebar) {
        display: block;
        visibility: visible;
        opacity: 1;
        position: relative;
        width: 100%;
    }
}

/* Mobile: Hide sidebar by default, show as dropdown when toggled */
@media (max-width: 991px) {

    body.woocommerce-shop #wf-sidebar:not(.af-show-mobile-filters),
    body.tax-product_cat #wf-sidebar:not(.af-show-mobile-filters),
    body.tax-product_tag #wf-sidebar:not(.af-show-mobile-filters) {
        display: none;
        visibility: hidden;
        opacity: 0;
    }

    /* Show sidebar when mobile filter button is clicked */
    body.woocommerce-shop #wf-sidebar.af-show-mobile-filters,
    body.tax-product_cat #wf-sidebar.af-show-mobile-filters,
    body.tax-product_tag #wf-sidebar.af-show-mobile-filters {
        display: block;
        visibility: visible;
        opacity: 1;
        position: fixed;
        top: 0;
        left: 0;
        width: 300px;
        height: 100vh;
        z-index: 99999;
        background: #fff;
        overflow-y: auto;
        padding: 20px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
}

/* CRITICAL: Fixed sidebar override - must override ALL relative positioning rules */
body.woocommerce-shop #wf-sidebar.af-fixed-sidebar,
body.tax-product_cat #wf-sidebar.af-fixed-sidebar,
body.tax-product_tag #wf-sidebar.af-fixed-sidebar {
    position: fixed;
    right: 0;
    left: auto;
    top: 100px;
    height: calc(100vh - 100px);
    width: 280px;
    z-index: 9999;
    max-width: 280px;
    flex: none;
    float: none;
    margin: 0;
    padding: 0;
    transform: none;
}

/* WooCommerce Sort/Result Count Styling - Match Theme Structure */
/* Shop sort bar - perfect vertical alignment of result count and sort dropdown */
.af-shop-sort-bar {
    align-items: center;
}
.af-shop-sort-bar .woocommerce-result-count,
.af-shop-sort-bar .woocommerce-ordering {
    margin: 0;
    display: flex;
    align-items: center;
}
.af-shop-sort-bar .woocommerce-result-count,
.af-shop-sort-bar .woocommerce-result-count p,
.af-shop-sort-bar .woocommerce-ordering,
.af-shop-sort-bar .woocommerce-ordering form {
    float: none !important;
}
.af-shop-sort-bar .woocommerce-result-count p,
.af-shop-sort-bar .woocommerce-ordering form {
    margin: 0;
    display: inline-flex;
    align-items: center;
}

body.woocommerce-shop .woocommerce-result-count,
body.tax-product_cat .woocommerce-result-count,
body.tax-product_tag .woocommerce-result-count,
body.woocommerce-shop .woocommerce-ordering,
body.tax-product_cat .woocommerce-ordering,
body.tax-product_tag .woocommerce-ordering {
    margin: 0;
    padding: 0;
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

body.woocommerce-shop .woocommerce-ordering select,
body.tax-product_cat .woocommerce-ordering select,
body.tax-product_tag .woocommerce-ordering select {
    padding: 10px 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

body.woocommerce-shop .woocommerce-ordering select:hover,
body.tax-product_cat .woocommerce-ordering select:hover,
body.tax-product_tag .woocommerce-ordering select:hover,
body.woocommerce-shop .woocommerce-ordering select:focus,
body.tax-product_cat .woocommerce-ordering select:focus,
body.tax-product_tag .woocommerce-ordering select:focus {
    border-color: #006400;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 100, 0, 0.1);
}

/* Hide WooCommerce Default Sidebar Completely - HIGHEST PRIORITY */
body.woocommerce-shop #secondary,
body.tax-product_cat #secondary,
body.tax-product_tag #secondary,
body.woocommerce-shop .woocommerce-sidebar,
body.tax-product_cat .woocommerce-sidebar,
body.tax-product_tag .woocommerce-sidebar,
body.woocommerce-shop aside.widget-area:not(#wf-sidebar):not(.shop-sidebar),
body.tax-product_cat aside.widget-area:not(#wf-sidebar):not(.shop-sidebar),
body.tax-product_tag aside.widget-area:not(#wf-sidebar):not(.shop-sidebar),
body.woocommerce-shop .widget-area:not(#wf-sidebar),
body.tax-product_cat .widget-area:not(#wf-sidebar),
body.tax-product_tag .widget-area:not(#wf-sidebar),
body.woocommerce-shop .sidebar,
body.tax-product_cat .sidebar,
body.tax-product_tag .sidebar {
    display: none;
    visibility: hidden;
    height: 0;
    width: 0;
    overflow: hidden;
    position: absolute;
    left: -9999px;
}

/* Desktop: Show Afriyah sidebar */
@media (min-width: 992px) {

    body.woocommerce-shop #wf-sidebar:not(.af-fixed-sidebar),
    body.tax-product_cat #wf-sidebar:not(.af-fixed-sidebar),
    body.tax-product_tag #wf-sidebar:not(.af-fixed-sidebar) {
        display: block;
        visibility: visible;
        height: auto;
        width: auto;
        position: relative;
        left: auto;
    }
}

/* Fixed sidebar override - must come after relative rule */
body.woocommerce-shop #wf-sidebar.af-fixed-sidebar,
body.tax-product_cat #wf-sidebar.af-fixed-sidebar,
body.tax-product_tag #wf-sidebar.af-fixed-sidebar {
    position: fixed;
    right: 0;
    left: auto;
    top: 100px;
    height: calc(100vh - 100px);
    width: 280px;
    z-index: 9999;
}

body.woocommerce-shop #wf-sidebar:not(.af-fixed-sidebar),
body.tax-product_cat #wf-sidebar:not(.af-fixed-sidebar),
body.tax-product_tag #wf-sidebar:not(.af-fixed-sidebar) {
    flex: 0 0 280px;
    max-width: 280px;
}

/* Fixed sidebar - override flex and positioning */
body.woocommerce-shop #wf-sidebar.af-fixed-sidebar,
body.tax-product_cat #wf-sidebar.af-fixed-sidebar,
body.tax-product_tag #wf-sidebar.af-fixed-sidebar {
    flex: none;
    max-width: 280px;
    position: fixed;
    right: 0;
    left: auto;
    top: 100px;
    height: calc(100vh - 100px);
    width: 280px;
    z-index: 9999;
}

@media (max-width: 991px) {

    body.woocommerce-shop #wf-sidebar.af-show-mobile-filters,
    body.tax-product_cat #wf-sidebar.af-show-mobile-filters,
    body.tax-product_tag #wf-sidebar.af-show-mobile-filters {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 300px;
        height: 100vh;
        z-index: 99999;
        background: #fff;
        padding: 20px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
}

/* Shop grid fallback to ensure customizer columns apply - HIGHEST PRIORITY */
/* Override style.css flexbox rules with grid - Apply to ALL shop product lists */
/* NOTE: Desktop columns are controlled by inline styles in archive-product.php */
/* This rule only sets base grid properties, not columns (columns set via inline styles) */
body.woocommerce-shop #af-shop-products-section ul.products,
body.tax-product_cat #af-shop-products-section ul.products,
body.tax-product_tag #af-shop-products-section ul.products,
body.woocommerce-shop ul.products.af-products-grid,
body.tax-product_cat ul.products.af-products-grid,
body.tax-product_tag ul.products.af-products-grid,
body.woocommerce-shop .woocommerce ul.products,
body.tax-product_cat .woocommerce ul.products,
body.tax-product_tag .woocommerce ul.products,
body.woocommerce-shop ul.products,
body.tax-product_cat ul.products,
body.tax-product_tag ul.products,
.woocommerce-shop ul.products,
.woocommerce-shop .woocommerce ul.products,
.woocommerce-page ul.products,
.woocommerce ul.products {
    display: grid;
    /* Don't set grid-template-columns here - let inline styles in archive-product.php control it */
    /* This prevents overriding the customizer value */
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    justify-items: stretch;
    box-sizing: border-box;
    /* Override any flexbox rules from style.css */
    flex-wrap: unset;
    flex-direction: unset;
}

/* Desktop: Only set columns if CSS variable is available (fallback) */
/* But inline styles in archive-product.php will override this */
@media (min-width: 769px) {

    body.woocommerce-shop ul.products,
    body.tax-product_cat ul.products,
    body.tax-product_tag ul.products,
    body.woocommerce-shop .woocommerce ul.products,
    body.tax-product_cat .woocommerce ul.products,
    body.tax-product_tag .woocommerce ul.products {
        /* Use CSS variable only as fallback - inline styles take precedence */
        grid-template-columns: repeat(var(--af-shop-cols-desktop, 4), minmax(0, 1fr));
    }
}

/* Override flexbox rules on product items */
body.woocommerce-shop ul.products li.product,
body.tax-product_cat ul.products li.product,
body.tax-product_tag ul.products li.product,
body.woocommerce-shop .woocommerce ul.products li.product,
body.tax-product_cat .woocommerce ul.products li.product,
body.tax-product_tag .woocommerce ul.products li.product,
.woocommerce-shop ul.products li.product,
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    flex: unset;
    max-width: 100%;
    width: auto;
    margin: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    float: none;
}

@media (max-width: 768px) {

    /* Shop page mobile columns - using proper specificity */
    body.woocommerce-shop #af-shop-products-section ul.products,
    body.tax-product_cat #af-shop-products-section ul.products,
    body.tax-product_tag #af-shop-products-section ul.products,
    body.woocommerce-shop ul.products.af-products-grid,
    body.tax-product_cat ul.products.af-products-grid,
    body.tax-product_tag ul.products.af-products-grid,
    body.woocommerce-shop .woocommerce ul.products,
    body.tax-product_cat .woocommerce ul.products,
    body.tax-product_tag .woocommerce ul.products {
        grid-template-columns: repeat(var(--af-shop-cols-mobile, 2), minmax(0, 1fr));
        gap: 16px;
    }

    /* Use CSS custom property from data attribute (set via JS) or fallback to data attribute selector */
    body.woocommerce-shop ul.products[data-af-mobile-cols],
    body.tax-product_cat ul.products[data-af-mobile-cols],
    body.tax-product_tag ul.products[data-af-mobile-cols] {
        grid-template-columns: repeat(var(--af-mobile-cols, 2), minmax(0, 1fr));
    }

    /* Fallback: Direct data attribute selectors for specific values */
    body.woocommerce-shop ul.products[data-af-mobile-cols="1"],
    body.tax-product_cat ul.products[data-af-mobile-cols="1"],
    body.tax-product_tag ul.products[data-af-mobile-cols="1"] {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    body.woocommerce-shop ul.products[data-af-mobile-cols="2"],
    body.tax-product_cat ul.products[data-af-mobile-cols="2"],
    body.tax-product_tag ul.products[data-af-mobile-cols="2"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.woocommerce-shop ul.products[data-af-mobile-cols="3"],
    body.tax-product_cat ul.products[data-af-mobile-cols="3"],
    body.tax-product_tag ul.products[data-af-mobile-cols="3"] {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.woocommerce-shop ul.products[data-af-mobile-cols="4"],
    body.tax-product_cat ul.products[data-af-mobile-cols="4"],
    body.tax-product_tag ul.products[data-af-mobile-cols="4"] {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Shop/Category/Tag cards should mirror Best Seller cards */
body.woocommerce-shop ul.products li.product a,
body.tax-product_cat ul.products li.product a,
body.tax-product_tag ul.products li.product a {
    display: block;
    width: 100%;
}

body.woocommerce-shop ul.products li.product .af-product-card,
body.tax-product_cat ul.products li.product .af-product-card,
body.tax-product_tag ul.products li.product .af-product-card {
    width: 100%;
    max-width: 100%;
}

/* Override woo-styles.css float-based layout - Force grid layout */
/* Target ALL possible column classes with maximum specificity */
/* NOTE: Desktop columns controlled by inline styles in archive-product.php */
@media (min-width: 769px) {

    body.woocommerce-shop .woocommerce ul.products.columns-2,
    body.woocommerce-shop .woocommerce ul.products.columns-3,
    body.woocommerce-shop .woocommerce ul.products.columns-4,
    body.woocommerce-shop .woocommerce ul.products.columns-5,
    body.tax-product_cat .woocommerce ul.products.columns-2,
    body.tax-product_cat .woocommerce ul.products.columns-3,
    body.tax-product_cat .woocommerce ul.products.columns-4,
    body.tax-product_cat .woocommerce ul.products.columns-5,
    body.tax-product_tag .woocommerce ul.products.columns-2,
    body.tax-product_tag .woocommerce ul.products.columns-3,
    body.tax-product_tag .woocommerce ul.products.columns-4,
    body.tax-product_tag .woocommerce ul.products.columns-5,
    body.woocommerce-shop ul.products.columns-2,
    body.woocommerce-shop ul.products.columns-3,
    body.woocommerce-shop ul.products.columns-4,
    body.woocommerce-shop ul.products.columns-5,
    body.tax-product_cat ul.products.columns-2,
    body.tax-product_cat ul.products.columns-3,
    body.tax-product_cat ul.products.columns-4,
    body.tax-product_cat ul.products.columns-5,
    body.tax-product_tag ul.products.columns-2,
    body.tax-product_tag ul.products.columns-3,
    body.tax-product_tag ul.products.columns-4,
    body.tax-product_tag ul.products.columns-5 {
        display: grid;
        /* Use CSS variable as fallback - inline styles in archive-product.php will override */
        grid-template-columns: repeat(var(--af-shop-cols-desktop, 4), minmax(0, 1fr));
        gap: 24px;
        list-style: none;
        margin: 0;
        padding: 0;
        width: 100%;
        box-sizing: border-box;
        /* Override any float-based rules */
        flex-wrap: unset;
        flex-direction: unset;
    }
}

@media (max-width: 768px) {

    body.woocommerce-shop .woocommerce ul.products.columns-2,
    body.woocommerce-shop .woocommerce ul.products.columns-3,
    body.woocommerce-shop .woocommerce ul.products.columns-4,
    body.tax-product_cat .woocommerce ul.products.columns-2,
    body.tax-product_cat .woocommerce ul.products.columns-3,
    body.tax-product_cat .woocommerce ul.products.columns-4,
    body.tax-product_tag .woocommerce ul.products.columns-2,
    body.tax-product_tag .woocommerce ul.products.columns-3,
    body.tax-product_tag .woocommerce ul.products.columns-4 {
        grid-template-columns: repeat(var(--af-shop-cols-mobile, 2), minmax(0, 1fr));
        gap: 16px;
    }
}

body.woocommerce-shop .woocommerce ul.products.columns-2 li.product,
body.woocommerce-shop .woocommerce ul.products.columns-3 li.product,
body.woocommerce-shop .woocommerce ul.products.columns-4 li.product,
body.tax-product_cat .woocommerce ul.products.columns-2 li.product,
body.tax-product_cat .woocommerce ul.products.columns-3 li.product,
body.tax-product_cat .woocommerce ul.products.columns-4 li.product,
body.tax-product_tag .woocommerce ul.products.columns-2 li.product,
body.tax-product_tag .woocommerce ul.products.columns-3 li.product,
body.tax-product_tag .woocommerce ul.products.columns-4 li.product {
    width: auto;
    float: none;
    margin: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ============================================================ */
/* SIDEBAR FILTER HOVER EFFECTS                                */
/* ============================================================ */

/* Category Filter Hover Effects */
.shop-sidebar .category-item,
.afriyah-shop-sidebar .category-item,
#wf-sidebar .category-item {
    transition: all 0.3s ease;
}

.shop-sidebar .category-item:hover,
.afriyah-shop-sidebar .category-item:hover,
#wf-sidebar .category-item:hover {
    background: #e8f5e8;
    border-left: 3px solid #006400;
}

.shop-sidebar .category-link,
.afriyah-shop-sidebar .category-link,
#wf-sidebar .category-link {
    transition: color 0.3s ease;
}

.shop-sidebar .category-link:hover,
.afriyah-shop-sidebar .category-link:hover,
#wf-sidebar .category-link:hover {
    color: #006400;
}

/* Brand Filter Hover Effects */
.shop-sidebar .brand-item,
.afriyah-shop-sidebar .brand-item,
#wf-sidebar .brand-item {
    transition: all 0.3s ease;
}

.shop-sidebar .brand-item:hover,
.afriyah-shop-sidebar .brand-item:hover,
#wf-sidebar .brand-item:hover {
    background: #e8f5e8;
    border-left: 3px solid #006400;
}

.shop-sidebar .brand-label,
.afriyah-shop-sidebar .brand-label,
#wf-sidebar .brand-label {
    transition: color 0.3s ease;
}

.shop-sidebar .brand-label:hover,
.afriyah-shop-sidebar .brand-label:hover,
#wf-sidebar .brand-label:hover {
    color: #006400;
}

/* Rating Filter Hover Effects */
.shop-sidebar .rating-item,
.afriyah-shop-sidebar .rating-item,
#wf-sidebar .rating-item {
    transition: all 0.3s ease;
}

.shop-sidebar .rating-item:hover,
.afriyah-shop-sidebar .rating-item:hover,
#wf-sidebar .rating-item:hover {
    background: #e8f5e8;
    border-left: 3px solid #006400;
}

.shop-sidebar .rating-label,
.afriyah-shop-sidebar .rating-label,
#wf-sidebar .rating-label {
    transition: color 0.3s ease;
}

.shop-sidebar .rating-label:hover,
.afriyah-shop-sidebar .rating-label:hover,
#wf-sidebar .rating-label:hover {
    color: #006400;
}

/* Price Filter Input Hover */
.shop-sidebar .price-input:hover,
.afriyah-shop-sidebar .price-input:hover,
#wf-sidebar .price-input:hover {
    border-color: #006400;
}

.shop-sidebar .apply-price-filter-btn:hover,
.afriyah-shop-sidebar .apply-price-filter-btn:hover,
#wf-sidebar .apply-price-filter-btn:hover {
    background: #004d00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.3);
}

/* Currency dropdown in topbar */
.wf_header-topbar #af-currency-dropdown,
.wf_header-topbar .af-currency-list {
    display: none;
    list-style: none;
    margin: 8px 0 0;
    padding: 6px 0;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    z-index: 10000;
    max-height: 60vh;
    overflow-y: auto;
}

.wf_header-topbar .af-currency-switcher.is-open #af-currency-dropdown,
.wf_header-topbar .af-currency-switcher.is-open .af-currency-list {
    display: block;
}

/* Hide duplicate Select Options button after category */
.product-meta+.single_add_to_cart_button,
.product-meta+.button.select-options-btn,
.product-meta+a.select-options-btn,
.meta-item+.single_add_to_cart_button,
.meta-item+.button.select-options-btn,
.meta-item+a.select-options-btn {
    display: none;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

/* Avoid hiding valid add-to-cart forms/buttons rendered by templates/plugins */

/* Empty Cart - New in Store Single Row - HIGHEST PRIORITY */
/* Override ALL grid rules for empty cart new products */
body.woocommerce-cart-empty .new-products-grid,
body.woocommerce-cart-empty .new-products-grid.products,
.woocommerce-cart-empty .new-products-grid,
.woocommerce-cart-empty .new-products-grid.products,
.woocommerce-cart-empty ul.products.new-products-grid,
.woocommerce-cart-empty .new-in-store-section .new-products-grid,
.woocommerce-cart-empty .new-in-store-section ul.products.new-products-grid,
body.woocommerce-cart-empty .new-in-store-section .new-products-grid,
body.woocommerce-cart-empty .new-in-store-section ul.products.new-products-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 20px;
    padding-bottom: 25px;
    justify-content: flex-start;
    align-items: stretch;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #006400 #f1f1f1;
    scroll-snap-type: x mandatory;
    width: 100%;
    margin: 0;
    list-style: none;
    grid-template-columns: none;
    grid-template-rows: none;
    grid-auto-flow: unset;
}

/* Individual product cards in horizontal scroll */
body.woocommerce-cart-empty .new-products-grid li.product,
.woocommerce-cart-empty .new-products-grid li.product,
.woocommerce-cart-empty .new-products-grid.products li.product,
.woocommerce-cart-empty ul.products.new-products-grid li.product,
.woocommerce-cart-empty .new-in-store-section .new-products-grid li.product,
.woocommerce-cart-empty .new-in-store-section ul.products.new-products-grid li.product {
    flex: 0 0 240px;
    width: 240px;
    min-width: 240px;
    max-width: 240px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    margin: 0;
    float: none;
    grid-column: unset;
    grid-row: unset;
}

/* Custom scrollbar for empty cart products */
.woocommerce-cart-empty .new-products-grid::-webkit-scrollbar,
body.woocommerce-cart-empty .new-products-grid::-webkit-scrollbar {
    height: 12px;
    display: block;
}

.woocommerce-cart-empty .new-products-grid::-webkit-scrollbar-track,
body.woocommerce-cart-empty .new-products-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
    margin: 10px 0;
}

.woocommerce-cart-empty .new-products-grid::-webkit-scrollbar-thumb,
body.woocommerce-cart-empty .new-products-grid::-webkit-scrollbar-thumb {
    background: #006400;
    border-radius: 10px;
    border: 2px solid #f1f1f1;
}

.woocommerce-cart-empty .new-products-grid::-webkit-scrollbar-thumb:hover,
body.woocommerce-cart-empty .new-products-grid::-webkit-scrollbar-thumb:hover {
    background: #008000;
}

/* New in store - support both ul.products and div.new-product-wrapper structure */
.woocommerce-cart-empty .new-in-store-section .new-products-grid .new-product-wrapper {
    flex: 0 0 240px !important;
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
    scroll-snap-align: start;
    display: block !important;
}

/* New in store: single row, same card style as related/shop (af-product-card) */
.new-in-store-section,
.woocommerce-cart .new-in-store-section,
body.woocommerce-cart-empty .new-in-store-section {
    padding-left: 0;
    margin-left: 0;
    width: 100%;
}

.new-in-store-section .new-products-grid,
.new-in-store-section ul.products.new-products-grid,
body.woocommerce-cart-empty .new-in-store-section ul.products.new-products-grid {
    padding-left: 0;
    margin-left: 0;
    justify-content: flex-start;
}

.new-in-store-section ul.products li.product .af-product-card,
.new-in-store-section ul.products li.product .af-product-image,
.new-in-store-section ul.products li.product .af-product-info {
    width: 100%;
    min-width: 0;
}

@media (max-width: 768px) {

    body.woocommerce-cart-empty .new-products-grid li.product,
    .woocommerce-cart-empty .new-products-grid li.product,
    .woocommerce-cart-empty .new-products-grid.products li.product,
    .woocommerce-cart-empty ul.products.new-products-grid li.product {
        flex: 0 0 200px;
        width: 200px;
        min-width: 200px;
        max-width: 200px;
    }
}

/* Empty cart: product card images same as rest of site (horizontal row, visible) */
.woocommerce-cart-empty .new-products-grid li.product img,
.woocommerce-cart-empty .new-in-store-section ul.products li.product img,
.woocommerce-cart-empty .new-products-grid li.product .af-product-image,
.woocommerce-cart-empty .new-products-grid li.product .attachment-woocommerce_thumbnail {
    display: block;
    visibility: visible;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Shop page: product cards start left, no gap or blank first card */
body.woocommerce-shop #af-shop-products-section,
body.tax-product_cat #af-shop-products-section,
body.tax-product_tag #af-shop-products-section {
    padding-left: 0;
    margin-left: 0;
}

body.woocommerce-shop #af-shop-products-section ul.products,
body.woocommerce-shop .woocommerce ul.products,
body.tax-product_cat #af-shop-products-section ul.products,
body.tax-product_cat .woocommerce ul.products,
body.tax-product_tag #af-shop-products-section ul.products,
body.tax-product_tag .woocommerce ul.products {
    padding-left: 0;
    margin-left: 0;
}

/* Checkout Layout - Consolidated (match old theme structure) */
.woocommerce-checkout-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.woocommerce-checkout-wrapper .checkout-row {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    align-items: start;
}

.checkout-form-column,
.order-summary-column {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.woocommerce-checkout .form-row input.input-text,
.woocommerce-checkout .form-row textarea {
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

@media (max-width: 991px) {
    .woocommerce-checkout-wrapper .checkout-row {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .woocommerce-checkout-wrapper .order-summary-column {
        position: static;
    }
}

/* Cart & Checkout - Sidebar cleanup */
body.woocommerce-cart #secondary,
body.woocommerce-checkout #secondary,
body.woocommerce-account #secondary {
    display: none;
    visibility: hidden;
}

/* Cart Layout - match old theme two-column layout (form left, collaterals right) */
body.woocommerce-cart .af-cart-layout-wrapper {
    display: block;
    width: 100%;
}

body.woocommerce-cart .woocommerce-cart-wrapper {
    width: 100%;
}

@media (min-width: 992px) {
    body.woocommerce-cart .af-cart-layout-wrapper {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 350px;
        gap: 30px;
        align-items: start;
    }

    body.woocommerce-cart .woocommerce-cart-form {
        min-width: 0;
    }

    body.woocommerce-cart .cart-collaterals {
        width: 100%;
        background: #f9f9f9;
        border-radius: 12px;
        padding: 24px;
        position: sticky;
        top: 20px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
        margin-top: 0;
    }
}

body.woocommerce-cart .cart-collaterals .cross-sells {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 30px;
}

/* Cart Page - "New In Store" Scroller (Cart page) */
.woocommerce-cart .new-products-grid,
.new-in-store-section .new-products-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    list-style: none;
}

.woocommerce-cart .new-products-grid .product-card,
.new-in-store-section .new-products-grid .product-card {
    flex: 0 0 220px;
    width: 220px;
    min-width: 220px;
}

@media (max-width: 768px) {
    .woocommerce-checkout-wrapper {
        padding: 20px 15px;
    }

    .woocommerce-checkout-wrapper .checkout-form-column,
    .woocommerce-checkout-wrapper .order-summary-column {
        padding: 20px;
    }
}

/* Search Overlay Fix */
.wf_search.search--header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
}

body.wf_header-search--active .wf_search.search--header,
body.is--overlay .wf_search.search--header {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Ensure search form content is visible in overlay */
body.wf_header-search--active .wf_search.search--header .wf_search-form,
body.is--overlay .wf_search.search--header .wf_search-form {
    opacity: 1;
    visibility: visible;
    display: flex;
}

.wf_search-form {
    width: 90%;
    max-width: 600px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wf_search-field,
#wf_search-form-header {
    flex: 1;
    padding: 16px 20px;
    font-size: 18px;
    border: 2px solid #fff;
    border-radius: 50px;
    background: #fff;
    color: #333;
    opacity: 1;
    visibility: visible;
    width: 100%;
}

.wf_search-field:focus,
#wf_search-form-header:focus {
    outline: none;
    border-color: #006400;
    box-shadow: 0 0 0 3px rgba(0, 100, 0, 0.1);
}

.wf_search-submit {
    padding: 16px 24px;
    background: #006400;
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 18px;
}

.wf_search-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 1;
    visibility: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    font-size: 24px;
    transition: all 0.3s;
}

.wf_search-close:hover {
    background: #fff;
    color: #000;
}

/* Call Anytime Icon Fix - Match Old Theme Styling with Circular Background */
.wf_navbar-info-contact .contact__list i,
.wf_navbar-info-contact .contact__list i:before {
    display: inline-flex;
    visibility: visible;
    opacity: 1;
    align-items: center;
    justify-content: center;
    text-align: center;
    -webkit-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

/* Match old theme circular icon styling */
.wf_navbar-info-contact .contact__list i {
    width: 4.2rem;
    height: 4.2rem;
    background: rgba(189, 189, 189, 0.15);
    color: var(--wf-main-color, #006400);
    border-radius: 50%;
    font-size: 2.2rem;
    margin-right: 1rem;
    line-height: 1;
    padding: 0;
}

/* Ensure icon is visible even if Font Awesome Light (fal) is not loaded */
.wf_navbar-info-contact .contact__list i.fal,
.wf_navbar-info-contact .contact__list i[class*="fa-phone"] {
    display: inline-flex;
    visibility: visible;
    opacity: 1;
}

/* Fallback: If fal doesn't work, ensure fas works */
.wf_navbar-info-contact .contact__list i.fas,
.wf_navbar-info-contact .contact__list i.far,
.wf_navbar-info-contact .contact__list i.fab {
    display: inline-flex;
    visibility: visible;
    opacity: 1;
}

/* Best Seller Page - Force All Product Cards Same Size - HIGHEST PRIORITY */
.page-best-sellers ul.products li.product,
.page-best-sellers .products li.product,
.best-sellers-products ul.products li.product {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {

    body.woocommerce-shop .af-product-title,
    body.tax-product_cat .af-product-title,
    body.tax-product_tag .af-product-title,
    ul.products li.product .af-product-title,
    .related.products .af-product-title,
    .up-sells.products .af-product-title,
    .cross-sells .af-product-title,
    .woocommerce-cart-empty .af-product-title,
    .af-product-card .af-product-title,
    .af-product-title {
        font-size: clamp(12px, 3vw, 14px);
        -webkit-line-clamp: 2;
        /* Keep 2 lines on mobile */
        line-clamp: 2;
        min-height: calc(1.4em * 2);
        max-height: calc(1.4em * 2);
    }

    .af-loop-short-desc {
        font-size: clamp(10px, 2.5vw, 12px);
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .af-product-price {
        font-size: clamp(14px, 3vw, 16px);
    }

    .browse-categories-btn {
        font-size: 14px;
        padding: 10px 14px;
    }
}

/* Cart Empty - New in Store scroller (override generic product list layout) */
body.woocommerce-cart .woocommerce-cart-empty ul.products.new-products-grid,
body.woocommerce-cart .woocommerce-cart-empty ul.products.af-cart-new-products,
body.woocommerce-cart .woocommerce-cart-empty .new-in-store-section ul.products.new-products-grid,
body.woocommerce-cart .woocommerce-cart-empty .new-in-store-section ul.products.af-cart-new-products {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 20px;
    padding-bottom: 25px;
    margin: 0;
    list-style: none;
    align-items: stretch;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

body.woocommerce-cart .woocommerce-cart-empty ul.products.new-products-grid>li.product,
body.woocommerce-cart .woocommerce-cart-empty ul.products.af-cart-new-products>li.product,
body.woocommerce-cart .woocommerce-cart-empty .new-in-store-section ul.products.new-products-grid>li.product,
body.woocommerce-cart .woocommerce-cart-empty .new-in-store-section ul.products.af-cart-new-products>li.product {
    flex: 0 0 240px;
    width: 240px;
    min-width: 240px;
    max-width: 240px;
    margin: 0;
    float: none;
    scroll-snap-align: start;
}


@media (max-width: 768px) {

    body.woocommerce-cart .woocommerce-cart-empty ul.products.new-products-grid>li.product,
    body.woocommerce-cart .woocommerce-cart-empty ul.products.af-cart-new-products>li.product,
    body.woocommerce-cart .woocommerce-cart-empty .new-in-store-section ul.products.new-products-grid>li.product,
    body.woocommerce-cart .woocommerce-cart-empty .new-in-store-section ul.products.af-cart-new-products>li.product {
        flex-basis: 200px;
        width: 200px;
        min-width: 200px;
        max-width: 200px;
    }
}

/* ============================================================ */
/* ALL 12 ISSUES FIXES - MAXIMUM SPECIFICITY                  */
/* ============================================================ */

/* ISSUE 1: REMOVED - Functionality already in original theme (afriyah-single-product-custom.css) */
/* The variant selector, CTA buttons, bundle section, and sticky cart visibility */
/* are already handled by the original theme's CSS and JavaScript. */
/* Adding duplicate rules here was causing conflicts. */

/* ISSUE 2: Frontpage Featured Product - PayPal/Apple Pay dynamic button visibility */
html body .af-featured-product .af-dynamic-payment-btn,
html body .af-featured-info .af-dynamic-payment-btn,
html body .af-dynamic-payment-btn {
    display: inline-block;
    visibility: visible;
    opacity: 1;
    margin: 0;
    padding: 0;
}

html body .af-featured-product .af-dynamic-payment-btn button,
html body .af-featured-info .af-dynamic-payment-btn button,
html body .af-dynamic-payment-btn button {
    display: inline-flex;
    visibility: visible;
    opacity: 1;
    align-items: center;
    justify-content: center;
    height: 48px;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    margin: 0;
}

html body .af-featured-product .af-dynamic-payment-btn.af-paypal-btn button,
html body .af-featured-info .af-dynamic-payment-btn.af-paypal-btn button {
    background: #0070ba;
    color: #fff;
}

html body .af-featured-product .af-dynamic-payment-btn.af-applepay-btn button,
html body .af-featured-info .af-dynamic-payment-btn.af-applepay-btn button {
    background: #000;
    color: #fff;
}

/* ISSUE 3 & 4: Best Seller and Shop Page mobile columns (2 per row) */
/* CRITICAL: Override all conflicting grid rules with maximum specificity */
@media (max-width: 768px) {

    /* Best Seller Page - 2 columns on mobile */
    body.page-best-sellers ul.products,
    body.page-best-sellers .woocommerce ul.products,
    body.page-best-sellers #af-bestsellers-grid,
    body.page-best-sellers .best-sellers-products ul.products,
    body.page-best-sellers ul.products.af-products-grid,
    body.page-best-sellers ul.products[data-af-mobile-cols] {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    body.page-best-sellers ul.products li.product,
    body.page-best-sellers .woocommerce ul.products li.product,
    body.page-best-sellers #af-bestsellers-grid li.product,
    body.page-best-sellers .best-sellers-products ul.products li.product {
        width: 100%;
        margin: 0;
        flex: 0 0 auto;
        grid-column: auto;
    }

    /* Shop Page - 2 columns on mobile */
    body.woocommerce-shop ul.products,
    body.woocommerce-shop .woocommerce ul.products,
    body.woocommerce-shop #af-shop-products-section ul.products,
    body.woocommerce-shop ul.products.af-products-grid,
    body.woocommerce-shop ul.products[data-af-mobile-cols],
    body.tax-product_cat ul.products,
    body.tax-product_cat .woocommerce ul.products,
    body.tax-product_tag ul.products,
    body.tax-product_tag .woocommerce ul.products {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    body.woocommerce-shop ul.products li.product,
    body.woocommerce-shop .woocommerce ul.products li.product,
    body.woocommerce-shop #af-shop-products-section ul.products li.product,
    body.tax-product_cat ul.products li.product,
    body.tax-product_cat .woocommerce ul.products li.product,
    body.tax-product_tag ul.products li.product,
    body.tax-product_tag .woocommerce ul.products li.product {
        width: 100%;
        margin: 0;
        flex: 0 0 auto;
        grid-column: auto;
    }
}

/* ISSUE 5: Shop Page mobile sidebar dropdown */
@media (max-width: 768px) {

    body.woocommerce-shop #wf-sidebar,
    body.tax-product_cat #wf-sidebar,
    body.tax-product_tag #wf-sidebar {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    body.woocommerce-shop #wf-sidebar.af-show-mobile-filters,
    body.tax-product_cat #wf-sidebar.af-show-mobile-filters,
    body.tax-product_tag #wf-sidebar.af-show-mobile-filters {
        display: block;
        max-height: 1000px;
        padding: 20px;
    }

    body.woocommerce-shop #af-mobile-filter-toggle,
    body.tax-product_cat #af-mobile-filter-toggle,
    body.tax-product_tag #af-mobile-filter-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 20px;
        background: #006400;
        color: #fff;
        border: none;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
    }
}

/* ISSUE 6: Description tab expand/collapse responsiveness */
/* CRITICAL: Override afriyah-single-product-custom.css conflicting rules */
html body.single-product .woocommerce-tabs .panel,
html body.single-product .woocommerce-tabs .panel#tab-description {
    display: block;
    visibility: visible;
    opacity: 1;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    padding: 0;
}

html body.single-product .woocommerce-tabs .panel.active,
html body.single-product .woocommerce-tabs .panel#tab-description.active,
html body.single-product .woocommerce-tabs .panel.af-tab-open,
html body.single-product .woocommerce-tabs .panel#tab-description.af-tab-open {
    max-height: 5000px;
    padding: 20px 0;
}

html body.single-product .woocommerce-tabs .panel.collapsed,
html body.single-product .woocommerce-tabs .panel#tab-description.collapsed {
    max-height: 0;
    padding: 0;
}

/* Override the :not(.af-tab-open) rule from afriyah-single-product-custom.css */
html body.single-product .woocommerce-tabs .panel:not(.af-tab-open) {
    max-height: 0;
    overflow: hidden;
}

html body.single-product .woocommerce-tabs .panel:not(.af-tab-open).active {
    max-height: 5000px;
    overflow: visible;
}

/* Description/Reviews tabs: single row horizontal like Image 5 - override woo-styles display:block */
.woocommerce div.product .woocommerce-tabs ul.tabs,
html body.single-product .woocommerce-tabs ul.tabs,
body.single-product .woocommerce-tabs ul.tabs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    padding-top: 0 !important;
    border-bottom: 2px solid #e0e0e0;
    gap: 8px;
    width: 100%;
}

.woocommerce div.product .woocommerce-tabs ul.tabs::before,
.woocommerce div.product .woocommerce-tabs ul.tabs::after,
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
    display: none !important;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li,
html body.single-product .woocommerce-tabs ul.tabs li,
body.single-product .woocommerce-tabs ul.tabs li {
    display: inline-block !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    float: none !important;
    border: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a,
html body.single-product .woocommerce-tabs ul.tabs li a,
body.single-product .woocommerce-tabs ul.tabs li a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    cursor: pointer;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: #333;
    font-weight: 600;
    text-decoration: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a,
html body.single-product .woocommerce-tabs ul.tabs li.active a,
body.single-product .woocommerce-tabs ul.tabs li.active a {
    background: #333;
    color: #fff;
    border-color: #333;
}

html body.single-product .woocommerce-tabs,
body.single-product .woocommerce-tabs {
    display: block;
}

html body.single-product .woocommerce-tabs ul.tabs li a .af-tab-toggle {
    transition: transform 0.3s ease;
}

html body.single-product .woocommerce-tabs ul.tabs li.active a .af-tab-toggle {
    transform: rotate(180deg);
}

/* ISSUE 7: Mobile side nav button responsiveness */
@media (max-width: 768px) {

    html body .wf_mobilenav-toggle,
    html body .mobile-menu-toggle,
    html body #mobile-menu-toggle {
        display: flex;
        visibility: visible;
        opacity: 1;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 1000;
    }
}

/* ISSUE 8: Live search desktop responsiveness */
/* CRITICAL: Override afriyah-header.css and afriyah-search-dropdown.css conflicting rules */
@media (min-width: 769px) {

    html body .af-search-dropdown,
    html body .header-search-form .af-search-dropdown,
    html body .product-search .af-search-dropdown,
    html body .search-wrapper .af-search-dropdown {
        display: block;
        visibility: visible;
        opacity: 1;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        max-width: 600px;
        background: #fff;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        border-radius: 8px;
        z-index: 10000;
        margin-top: 8px;
        min-width: 400px;
    }

    /* Override afriyah-header.css .af-search-results rule */
    html body .af-search-results {
        display: block;
        visibility: visible;
        opacity: 1;
    }

    html body .af-search-results.active {
        display: block;
    }
}

/* ISSUE 9: Cart and Checkout page structure - already fixed in cart.php and review-order.php */

/* ISSUE 10: Mobile blue banner content alignment (max 2 rows) */
@media (max-width: 768px) {

    html body .wf_navbar-topbar,
    html body .blue-banner,
    html body .top-banner {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 8px 16px;
        max-height: 60px;
        overflow: hidden;
    }

    html body .wf_navbar-topbar>*,
    html body .blue-banner>*,
    html body .top-banner>* {
        flex: 0 0 auto;
        font-size: 12px;
        line-height: 1.2;
        max-width: calc(50% - 4px);
    }
}

/* ISSUE 11: Blue banner on desktop visibility */
@media (min-width: 769px) {

    html body .wf_navbar-topbar,
    html body .blue-banner,
    html body .top-banner {
        display: block;
        visibility: visible;
        opacity: 1;
        background: #006400;
        color: #fff;
        padding: 12px 20px;
        text-align: center;
    }
}

/* ISSUE 12: Shop Page quick link button sizes and structure */
html body.woocommerce-shop .af-quick-actions,
html body.tax-product_cat .af-quick-actions,
html body.tax-product_tag .af-quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

html body.woocommerce-shop .af-quick-actions .af-quick-action-btn,
html body.tax-product_cat .af-quick-actions .af-quick-action-btn,
html body.tax-product_tag .af-quick-actions .af-quick-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    padding: 0;
    border-radius: 50%;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    transition: all 0.3s ease;
}

html body.woocommerce-shop .af-quick-actions .af-quick-action-btn:hover,
html body.tax-product_cat .af-quick-actions .af-quick-action-btn:hover,
html body.tax-product_tag .af-quick-actions .af-quick-action-btn:hover {
    background: #006400;
    color: #fff;
    border-color: #006400;
    transform: scale(1.1);
}

/* ============================================================ */
/* SHOP PAGE GRID ALIGNMENT & CART FIXES                        */
/* ============================================================ */

/* Shop Page: Respect customizer columns (--af-shop-cols-desktop set in archive-product.php) */
body.woocommerce-shop ul.products,
body.tax-product_cat ul.products,
body.tax-product_tag ul.products {
    display: grid !important;
    grid-template-columns: repeat(var(--af-shop-cols-desktop, 4), minmax(0, 1fr)) !important;
    gap: 24px !important;
}

@media (max-width: 768px) {
    body.woocommerce-shop ul.products,
    body.tax-product_cat ul.products,
    body.tax-product_tag ul.products {
        grid-template-columns: repeat(var(--af-shop-cols-mobile, 2), minmax(0, 1fr)) !important;
    }
}

/* FIX: Remove "Ghost" Grid Items caused by Clearfix Pseudo-elements */
body.woocommerce-shop ul.products::before,
body.woocommerce-shop ul.products::after,
body.tax-product_cat ul.products::before,
body.tax-product_cat ul.products::after,
body.tax-product_tag ul.products::before,
body.tax-product_tag ul.products::after,
ul.products::before,
ul.products::after {
    display: none !important;
    content: none !important;
}

/* FIX: Hide ANY direct child of the product grid that isn't a product list item */
/* This catches stray scripts, divs, anchors, or text nodes that render as empty grid slots */
#af-shop-products-section ul.products > *:not(li.product),
body.woocommerce-shop ul.products > *:not(li.product),
body.tax-product_cat ul.products > *:not(li.product),
body.tax-product_tag ul.products > *:not(li.product),
ul.products > *:not(li.product) {
    display: none !important;
}

/* Ensure first product anchors to grid position 1,1 */
body.woocommerce-shop ul.products li.product:first-of-type,
body.tax-product_cat ul.products li.product:first-of-type,
body.tax-product_tag ul.products li.product:first-of-type {
    grid-column: 1;
    grid-row: 1;
}

/* FIX: Squash whitespace text nodes that might act as grid items */
body.woocommerce-shop ul.products,
body.tax-product_cat ul.products,
body.tax-product_tag ul.products {
    font-size: 0 !important;
}

body.woocommerce-shop ul.products li.product,
body.tax-product_cat ul.products li.product,
body.tax-product_tag ul.products li.product {
    font-size: 1rem !important;
    /* Reset font size for content */
}

/* User Request: Collapsible Tabs Styles */
.woocommerce-tabs ul.tabs li a {
    cursor: pointer !important;
}

.woocommerce-tabs .panel {
    transition: all 0.3s ease;
}

/* Use max-height/overflow for collapse - NOT display:none - so re-expand works reliably */
.woocommerce-tabs .panel.collapsed {
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

body.woocommerce-shop ul.products li.product,
body.tax-product_cat ul.products li.product,
body.tax-product_tag ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
}

/* Ensure title has min-height to align separate lines */
.af-product-title {
    min-height: 44px !important;
    /* Approx 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Empty Cart: New in Store Grid - Force Horizontal Single Row */
.woocommerce-cart-empty .new-products-grid ul.products,
.cart-empty .new-products-grid ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    overflow-x: auto;
    /* Allow scroll if needed on small screens, though grid usually wraps */
}

@media (max-width: 992px) {

    .woocommerce-cart-empty .new-products-grid ul.products,
    .cart-empty .new-products-grid ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {

    .woocommerce-cart-empty .new-products-grid ul.products,
    .cart-empty .new-products-grid ul.products {
        grid-template-columns: repeat(1, 1fr) !important;
    }
}

/* Ensure cards in empty cart look good */
.woocommerce-cart-empty .new-products-grid li.product .af-product-card {
    height: 100%;
}