/* ============================================================
   AFRIYAH WOOCOMMERCE CUSTOM STYLES
   ============================================================ */

/* Savings Badge */
.af-badge-savings {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #FFD700;
    color: #1a1a1a;
    font-weight: 800;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 14px;
    z-index: 5;
}

/* AI Product Optimization Button (Admin/Meta Box) */
.af-ai-optimize-wrapper {
    margin-bottom: 20px;
    padding: 12px;
    background: linear-gradient(135deg, #006400 0%, #009900 100%);
    border-radius: 8px;
    text-align: center;
}

#af-ai-optimize-btn {
    width: 100%;
    padding: 12px;
    background: #fff;
    color: #006400;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#af-ai-optimize-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.af-ai-optimize-desc {
    margin: 8px 0 0;
    color: #fff;
    font-size: 11px;
    opacity: 0.9;
}

#af-ai-optimize-status {
    margin-top: 8px;
    display: none;
    color: #fff;
    font-size: 12px;
}

/* Trust Badges */
.af-trust-badges {
    margin: 16px 0;
    padding: 12px 16px;
    background: #f7faf7;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.af-trust-badges-header {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.af-trust-label {
    font-weight: 600;
    color: #333;
    margin-right: 8px;
}

.af-payment-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    background: #fff;
    border-radius: 6px;
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.af-payment-icon.paystack {
    min-width: 90px;
}

.af-payment-icon.flutterwave {
    min-width: 110px;
}

.af-payment-icon.mpesa {
    min-width: 85px;
}

.af-payment-icon.opay {
    min-width: 80px;
}

.af-payment-icon.mastercard,
.af-payment-icon.visa {
    width: auto;
    max-width: 80px;
    overflow: hidden;
    flex-shrink: 0;
    padding: 6px 10px;
}

.af-payment-icon.visa {
    padding: 6px 12px;
}

.af-payment-text {
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.af-payment-text.paystack {
    color: #00AFF0;
}

.af-payment-text.flutterwave {
    color: #F5A623;
}

.af-payment-text.mpesa {
    color: #00A94E;
}

.af-payment-text.opay {
    color: #1bbd5b;
}

.af-payment-text.opay:before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #1bbd5b;
    border-radius: 50%;
    margin-right: 4px;
}

.af-payment-img {
    height: 14px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.af-payment-icon.visa .af-payment-img {
    height: 16px;
}

.af-trust-badges-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap !important;
    color: #555;
    font-size: 14px;
    justify-content: flex-start;
    align-items: center;
}

.af-trust-badges-row span {
    white-space: nowrap;
    flex-shrink: 0;
}

.af-trust-badges-row i {
    color: #006400;
}

@media (max-width:768px) {
    .af-trust-badges-row {
        flex-wrap: nowrap !important;
        gap: 12px !important;
        font-size: 12px !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .af-trust-badges-row span {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
}

@media (max-width:480px) {
    .af-trust-badges-row {
        gap: 8px !important;
        font-size: 11px !important;
    }
}

/* Delivery Estimate */
.af-delivery-estimate {
    margin: 16px 0;
    padding: 16px;
    background: linear-gradient(135deg, #f7faf7 0%, #ffffff 100%);
    border-radius: 12px;
    border-left: 4px solid #006400;
}

.af-delivery-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.af-delivery-header i {
    color: #006400;
    font-size: 18px;
}

.af-delivery-header strong {
    color: #333;
    font-size: 16px;
}

.af-delivery-msg {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

/* QA Badge */
.af-qa-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a1a;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    margin: 12px 0;
}

.af-qa-badge i {
    font-size: 16px;
}

/* FOMO Bar */
.af-fomo-single {
    margin: 16px 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff4757 100%);
    color: #fff;
    border-radius: 12px;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    animation: pulse 2s infinite;
}

.af-fomo-single i {
    margin-right: 8px;
}

/* Buy Now Button */
.af-buy-now-btn,
.af-sticky-atc-buy {
    background: #FFD700 !important;
    color: #1a1a1a !important;
    border: none !important;
    border-radius: 50px !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    padding: 16px 32px !important;
    min-width: 160px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-left: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.af-buy-now-btn:hover {
    background: #e0a800 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.single_add_to_cart_button.button.alt+.af-buy-now-btn {
    margin-left: 12px !important;
    flex: 1;
}

.woocommerce-variation-add-to-cart {
    display: flex !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    margin-left: 8px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}

/* Fix Excess Top Spacing on Product Page */
.single-product .site-content {
    padding-top: 20px !important;
}

.single-product .product {
    margin-top: 0 !important;
}

/* Best Seller Card Height Fix */
.af-product-card {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.af-product-info {
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.af-product-actions {
    margin-top: auto !important;
}

/* WhatsApp & Quick Actions Fix */
.af-quick-actions {
    width: 36px !important;
    align-items: center !important;
}

.af-whatsapp-btn,
.af-quick-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    padding: 0 !important;
    margin: 0 auto !important;
}

.af-whatsapp-btn i,
.af-quick-btn i {
    font-size: 14px !important;
    line-height: 1 !important;
    margin: 0 !important;
}

/* Top Rated CTA Fix */
.af-top-rated-cta {
    background-color: #006400 !important;
    color: #fff !important;
    border: 2px solid #006400 !important;
    border-radius: 50px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.af-top-rated-cta:hover {
    background-color: #004d00 !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.2);
}

@media (max-width: 768px) {

    .af-buy-now-btn,
    .single_add_to_cart_button.button.alt {
        padding: 14px 28px !important;
        font-size: 15px !important;
        margin-left: 8px !important;
    }
}

/* ============================================================
   VISUAL REFINEMENTS (Title, Buttons, Grids)
   ============================================================ */

/* 1. Product Title Size */
.product-title {
    font-size: 24px !important;
    /* Reduced from default large size */
    line-height: 1.3 !important;
}

/* 2. Add to Cart & Buy Now Buttons (Pill Shape & Colors) */
.single_add_to_cart_button.button,
.af-buy-now-btn,
button[name="add-to-cart"] {
    border-radius: 50px !important;
    /* Pill shape */
    height: 50px !important;
    /* 50px edges/height */
    line-height: normal !important;
    /* Reset line height */
    padding: 0 20px !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-transform: capitalize !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    min-width: 180px !important;
    /* Ensure minimal width */
    flex: 1 !important;
    /* Flex grow */
    margin: 0 !important;
    border: none !important;
}

.single_add_to_cart_button.button {
    background-color: #006400 !important;
    /* Theme Green */
    color: #fff !important;
}

.af-buy-now-btn {
    background-color: #FFD700 !important;
    /* Theme Gold */
    color: #1a1a1a !important;
}

/* Ensure buttons wrapper handles them correctly */
.product-actions-wrapper,
.cart,
.afriyah-product-actions {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    width: 100% !important;
}

/* 3. Pairs Well With & Related Products (Single Line, Smaller Cards) */
.related.products ul.products,
.upsells.products ul.products,
.cross-sells.products ul.products,
.related-products-section ul.products {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 16px !important;
    padding-bottom: 20px !important;
    /* Space for scrollbar */
    margin-bottom: 0 !important;
    justify-content: flex-start !important;
}

.related.products ul.products li.product,
.upsells.products ul.products li.product,
.related-products-section ul.products li.product {
    flex: 0 0 220px !important;
    /* Fixed width for single line */
    width: 220px !important;
    min-width: 220px !important;
    margin-bottom: 0 !important;
    float: none !important;
}

/* Ensure images in these cards are visible and sized correctly */
.related.products ul.products li.product img,
.upsells.products ul.products li.product img,
.related-products-section ul.products li.product img {
    height: 220px !important;
    width: 100% !important;
    object-fit: cover !important;
    border-radius: 12px;
    margin-bottom: 10px;
}

/* Ensure images in these cards are visible and sized correctly */
.related.products ul.products li.product img,
.upsells.products ul.products li.product img {
    height: 220px !important;
    width: 100% !important;
    object-fit: cover !important;
    border-radius: 12px;
    margin-bottom: 10px;
}

/* Hide scrollbar for cleaner look but allow scroll */
.related.products ul.products::-webkit-scrollbar,
.upsells.products ul.products::-webkit-scrollbar {
    height: 6px;
}

.related.products ul.products::-webkit-scrollbar-thumb,
.upsells.products ul.products::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* WhatsApp Quick Button */
.af-whatsapp-btn {
    background: rgba(37, 211, 102, 0.95) !important;
    color: #fff !important;
}

/* Wishlist Styles */
.af-wishlist-empty {
    text-align: center;
    padding: 60px 20px;
}

.af-wishlist-empty p {
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
}

.af-wishlist-login-btn,
.af-wishlist-browse-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #006400;
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.af-wishlist-browse-btn:hover {
    background: #009900;
    transform: translateY(-2px);
}

.af-wishlist-empty-icon {
    font-size: 64px;
    color: #ccc;
    margin-bottom: 20px;
}

.af-wishlist-empty-title {
    color: #666;
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 600;
}

.af-wishlist-empty-desc {
    color: #999;
    margin-bottom: 24px;
    font-size: 16px;
}

.af-wishlist-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.af-wishlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #006400;
}

.af-wishlist-title {
    margin: 0;
    color: #333;
    font-size: 28px;
    font-weight: 700;
}

.af-wishlist-count {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.af-wishlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.af-wishlist-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.af-wishlist-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.af-wishlist-img-link {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    display: block;
    background: #f0f0f0;
}

.af-wishlist-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.af-wishlist-save-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #dc3545;
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.af-remove-wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #dc3545;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.af-remove-wishlist:hover {
    background: #dc3545 !important;
    color: #fff !important;
    transform: scale(1.1);
}

.af-wishlist-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.af-wishlist-product-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}

.af-wishlist-product-link {
    color: #333;
    text-decoration: none;
}

.af-wishlist-footer {
    margin-top: auto;
}

.af-wishlist-price {
    font-size: 20px;
    font-weight: 700;
    color: #006400;
    margin-bottom: 12px;
}

.af-wishlist-price-drop {
    font-size: 12px;
    color: #dc3545;
    margin-bottom: 8px;
}

.af-wishlist-actions {
    display: flex;
    gap: 8px;
}

.af-wishlist-action-btn {
    flex: 1;
    padding: 10px;
    background: #006400;
    color: #fff;
    border-radius: 50px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}

.af-wishlist-out-stock {
    flex: 1;
    padding: 10px;
    background: #ccc;
    color: #666;
    border-radius: 50px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .af-wishlist-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        gap: 16px !important;
    }
}

/* Sticky Add to Cart - Same template: product left, CTA right, no WhatsApp overlap */
.af-sticky-atc {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    padding: 12px 16px;
    padding-right: 90px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: none;
    border-top: 1px solid #e0e0e0;
    box-sizing: border-box;
}

.af-sticky-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.af-sticky-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.af-sticky-content {
    flex: 1;
    min-width: 0;
}

.af-sticky-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.af-sticky-price {
    font-size: 16px;
    font-weight: 700;
    color: #006400;
}

.af-sticky-buttons-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.af-sticky-btn {
    padding: 12px 24px;
    background: #006400;
    color: #fff;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    flex: 1;
    min-width: 120px;
    text-align: center;
}

@media (max-width: 768px) {
    .af-sticky-atc {
        display: block !important;
    }

    body {
        padding-bottom: 140px;
    }

    .woocommerce-product-gallery {
        margin-bottom: 80px;
    }
}

/* Mobile Filter Bar */
.af-mobile-filter-bar {
    display: none;
    margin-bottom: 20px;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 991px) {
    .af-mobile-filter-bar {
        display: flex !important;
    }
}

/* Select Options Popup Responsive */
#af-select-options-popup .af-popup-content {
    max-height: 85vh;
    overflow-y: auto;
    width: 90%;
    max-width: 600px;
    margin: 0 auto;
}

#af-select-options-popup .af-popup-body {
    padding: 20px !important;
}

@media (max-width: 768px) {
    #af-select-options-popup .af-popup-content {
        width: 95%;
    }
}

/* ============================================================
   8. SHOP PAGE LAYOUT & SIDEBAR (Moved from woocommerce.php)
   ============================================================ */

/* Ensure the main content area is always visible */
#wf-main {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Sidebar Visibility logic */
.post-type-archive-product #wf-sidebar,
.tax-product_cat #wf-sidebar,
.tax-product_tag #wf-sidebar,
body.woocommerce #wf-sidebar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#wf-sidebar aside.shop-sidebar {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (min-width: 992px) {
    #wf-sidebar aside.shop-sidebar {
        position: sticky;
        top: 20px;
    }
}

/* Hide sidebar completely on mobile/tablet */
@media (max-width: 991px) {
    #wf-sidebar {
        display: none !important;
    }

    /* Ensure main content takes full width */
    #wf-main.wf-col-lg-8 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* ============================================================
   MOBILE SIDE MENU FIXES (Restored & Enhanced)
   ============================================================ */

@media (max-width: 991px) {
    .wf_mobilenav-mainmenu-content {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100% !important;
        z-index: 99999 !important;
        display: none !important;
        overflow: hidden !important;
        background-color: rgba(0, 0, 0, 0.5);
        /* Overlay */
    }

    .wf_mobilenav-mainmenu-content.wf_mobilenav-mainmenu--active,
    body.wf_mobilenav-mainmenu--active .wf_mobilenav-mainmenu-content,
    .wf_mobilenav-mainmenu-content.active,
    .wf_mobilenav-mainmenu-content.toggled {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .wf_mobilenav-mainmenu-inner {
        position: absolute !important;
        top: 0;
        left: 0;
        width: 85% !important;
        max-width: 400px !important;
        height: 100vh !important;
        padding-top: 60px !important;
        background: #fff !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease-out !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
    }

    body.wf_mobilenav-mainmenu--active .wf_mobilenav-mainmenu-inner,
    .wf_mobilenav-mainmenu-content.active .wf_mobilenav-mainmenu-inner {
        transform: translateX(0) !important;
    }

    /* Prevent body scroll when menu is open */
    body.wf_mobilenav-mainmenu--active {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }

    /* Close Button - Enhanced for touch */
    .wf_header-closemenu {
        position: absolute !important;
        top: 15px !important;
        right: 15px !important;
        z-index: 100000 !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        background: rgba(0, 0, 0, 0.1) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        touch-action: manipulation !important;
        cursor: pointer !important;
    }

    .wf_header-closemenu:hover,
    .wf_header-closemenu:active {
        background: rgba(0, 100, 0, 0.2) !important;
    }

    /* Mobile Menu Dropdown Items - Touch Friendly */
    .wf_mobilenav-mainmenu .menu-item-has-children>a,
    .wf_mobilenav-mainmenu .menu-item-has-children>.nav-link {
        touch-action: manipulation !important;
        padding: 12px 16px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
    }

    .wf_mobilenav-dropdown-toggle {
        touch-action: manipulation !important;
        min-width: 44px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .wf_mobilenav-mainmenu .sub-menu,
    .wf_mobilenav-mainmenu .dropdown-menu {
        padding-left: 20px !important;
        display: none;
        /* JS toggles this */
    }

    .wf_mobilenav-mainmenu .sub-menu a,
    .wf_mobilenav-mainmenu .dropdown-menu a {
        padding: 10px 16px !important;
        min-height: 40px !important;
    }
}

/* ============================================================
   PAIRS WELL & HERO FIXES
   ============================================================ */

/* 7. Pairs Well With Fixes */
.pairs-well-with .current-product {
    max-width: 100% !important;
    width: 100% !important;
}

.pairs-well-with .product-card,
.pairs-well-with .af-product-card {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.af-product-image img,
.product-card-image img {
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    visibility: visible !important;
    border-radius: 8px !important;
}

/* 5. Hero Section Visibility */
.af-hero-section,
.hero-section,
.af-hero-content,
.hero-content,
.af-hero-title,
.hero-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ============================================================
   TOP RATED CTA BUTTON (Restored)
   ============================================================ */

.af-featured-products-section .af-view-all-container,
.af-view-all-container,
section.af-featured-products-section .af-view-all-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    margin-top: 40px !important;
    margin-bottom: 0 !important;
    text-align: center !important;
    padding: 20px 0 !important;
    clear: both !important;
    position: relative !important;
    z-index: 100 !important;
}

.af-view-all-container a,
.af-view-all-container .af-btn-primary,
.af-view-all-container .af-top-rated-cta,
a.af-top-rated-cta {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: #006400 !important;
    color: #fff !important;
    border: none !important;
    position: relative !important;
    z-index: 101 !important;
    padding: 12px 32px !important;
    border-radius: 50px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-decoration: none !important;
    min-height: 48px !important;
    min-width: 200px !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.2) !important;
}

.af-view-all-container a:hover,
a.af-top-rated-cta:hover {
    background: #008000 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 12px rgba(0, 100, 0, 0.3) !important;
}

/* ============================================================
   QUICK ACTIONS & GRID FIXES
   ============================================================ */

.af-quick-actions,
.af-product-image .af-quick-actions,
.af-product-card .af-quick-actions,
.product .af-quick-actions {
    position: absolute !important;
    right: 8px !important;
    top: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    z-index: 10 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    pointer-events: auto !important;
    align-items: center !important;
    width: auto !important;
    min-width: auto !important;
}

/* Dynamic button sizing based on product card size */
.af-product-card .af-quick-actions button,
.af-product-card .af-quick-actions a,
.af-products-grid .af-quick-actions button,
.af-products-grid .af-quick-actions a,
li.product .af-quick-actions button,
li.product .af-quick-actions a {
    width: clamp(28px, 6vw, 36px) !important;
    height: clamp(28px, 6vw, 36px) !important;
    min-width: clamp(28px, 6vw, 36px) !important;
    min-height: clamp(28px, 6vw, 36px) !important;
    font-size: clamp(12px, 2.5vw, 16px) !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #333 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.af-quick-actions button:hover,
.af-quick-actions a:hover {
    background: #006400 !important;
    color: #fff !important;
    transform: scale(1.1) !important;
}

/* WhatsApp button special styling */
.af-quick-actions .af-whatsapp-btn {
    background: rgba(37, 211, 102, 0.95) !important;
    color: #fff !important;
}

.af-quick-actions .af-whatsapp-btn:hover {
    background: #25D366 !important;
    color: #fff !important;
}

/* Grid Layouts */
@media (min-width: 992px) {

    #af-bestsellers-grid,
    .af-products-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 991px) and (min-width: 768px) {

    #af-bestsellers-grid,
    .af-products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 767px) {

    #af-bestsellers-grid,
    .af-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================================
   LIVE SEARCH DROPDOWN STYLES
   ============================================================ */

/* Search Form Container */
form.search-form,
form.product-search,
.wf_search-form,
.header-search-form {
    position: relative !important;
}

/* Desktop Search Input - Professional Larger Size */
@media (min-width: 769px) {

    .header-search-form input.header-search-input,
    .header-search-form input[type="search"],
    .wf_search-form input[type="search"] {
        font-size: 16px !important;
        padding: 14px 20px !important;
        height: 52px !important;
        min-height: 52px !important;
        line-height: 1.5 !important;
        border-radius: 8px !important;
        border: 2px solid #e0e0e0 !important;
        width: 100% !important;
    }

    .header-search-form input:focus,
    .wf_search-form input:focus {
        border-color: #006400 !important;
        outline: none !important;
        box-shadow: 0 0 0 3px rgba(0, 100, 0, 0.1) !important;
    }

    .header-search-form,
    .product-search {
        width: 100% !important;
        max-width: 600px !important;
    }
}

/* Live Search Dropdown */
.af-search-dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    margin-top: 8px !important;
    max-height: 500px !important;
    overflow-y: auto !important;
    z-index: 1000 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Loading State */
.af-search-loading {
    padding: 20px !important;
    text-align: center !important;
    color: #666 !important;
}

.af-search-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #006400;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Search Results List */
.af-search-dropdown ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.af-search-dropdown li {
    border-bottom: 1px solid #f0f0f0 !important;
}

.af-search-dropdown li:last-child {
    border-bottom: none !important;
}

.af-search-dropdown li a {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 16px 20px !important;
    text-decoration: none !important;
    color: #333 !important;
    min-height: 80px !important;
}

.af-search-dropdown li a:hover {
    background-color: #f8f9fa !important;
}

.af-search-dropdown .thumb {
    width: 70px !important;
    height: 70px !important;
    flex-shrink: 0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background: #f0f0f0 !important;
}

.af-search-dropdown .thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.af-search-dropdown .info .title {
    font-size: 15px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.af-search-dropdown .info .price {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #006400 !important;
    margin: 0 !important;
}

/* View All Link */
.af-search-dropdown .view-all {
    padding: 12px 16px !important;
    background-color: #f8f9fa !important;
    border-top: 1px solid #e0e0e0 !important;
}

.af-search-dropdown .view-all a {
    display: block !important;
    text-align: center !important;
    color: #006400 !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
}

/* Mobile Responsive Search */
@media (max-width: 768px) {
    .af-search-dropdown {
        max-height: 60vh !important;
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        width: calc(100% - 20px) !important;
        top: auto !important;
        bottom: auto !important;
        /* Managed by JS pos */
        z-index: 99999 !important;
    }

    .header-search-form input.header-search-input {
        padding: 12px 16px !important;
        height: 48px !important;
    }
}

/* ============================================================
   MOBILE TOPBAR ALIGNMENT FIXES
   ============================================================ */
@media (max-width: 991px) {

    /* Ensure content stacks vertically and centers */
    .wf_mobilenav-topbar-content .af-site-header .wf-row {
        flex-direction: column !important;
        text-align: center !important;
        gap: 10px !important;
    }

    .wf_mobilenav-topbar-content .widget--left,
    .wf_mobilenav-topbar-content .widget--center,
    .wf_mobilenav-topbar-content .widget--right {
        text-align: center !important;
        margin-bottom: 10px !important;
        justify-content: center !important;
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        float: none !important;
    }

    /* Fix individual widget spacing */
    .wf_mobilenav-topbar-content .af-promo-text {
        display: block !important;
        margin-bottom: 5px !important;
    }

    /* Currency switcher alignment */
    .wf_mobilenav-topbar-content .af-currency-switcher {
        margin: 0 auto !important;
        display: inline-block !important;
    }

    /* Email alignment */
    .wf_mobilenav-topbar-content .af-header-email {
        justify-content: center !important;
        margin-bottom: 8px !important;
    }

    /* Ensure content is visible when active */
    .wf_mobilenav-topbar-content.active {
        display: block !important;
        padding: 15px 0 !important;
        background: #fff !important;
        border-bottom: 1px solid #eee !important;
    }
}

/* FINAL Z-INDEX FIX */
.afriyah-sticky-add-to-cart,
.sticky-add-to-cart-bar,
#sticky-cart-panel,
.af-sticky-atc {
    z-index: 90 !important;
    /* Low priority */
}

#whatsapp-widget,
.whatsapp-widget,
.chat-widget,
iframe[title="chat"],
.joinchat,
.ht-ctc-chat,
.af-whatsapp-float,
.af-ai-chat-float {
    z-index: 2147483647 !important;
    /* Max priority */
}/* ============================================================
   FIXES FOR USER REPORTED ISSUES (Bundle, Tables, Delivery)
   ============================================================ */

/* 1. Force Bundle to Single Row & Scrollable */
.af-bundle-flex {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    /* Start aligned to prevent centering cutting off content */
    gap: 20px !important;
    flex-wrap: nowrap !important;
    /* FORCE NO WRAP */
    overflow-x: auto !important;
    padding-bottom: 15px !important;
    /* Scroll space */
    width: 100% !important;
    -webkit-overflow-scrolling: touch;
}

.af-bundle-card {
    flex: 0 0 200px !important;
    width: 200px !important;
    min-width: 200px !important;
}

/* 2. Style Product Description & Attribute Tables "Correct Format" */
/* Design the standard WooCommerce attributes table to look premium and structured */
.woocommerce-product-details__short-description table,
.woocommerce-Tabs-panel--description table,
.woocommerce-Tabs-panel--additional_information table.shop_attributes {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 20px !important;
    border: 1px solid #eee !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.woocommerce-product-details__short-description table th,
.woocommerce-Tabs-panel--description table th,
.woocommerce-Tabs-panel--additional_information table.shop_attributes th {
    background-color: #f9f9f9 !important;
    color: #333 !important;
    font-weight: 700 !important;
    padding: 12px 16px !important;
    text-align: left !important;
    border-bottom: 1px solid #eee !important;
    width: 30% !important;
    /* Fixed label width */
}

.woocommerce-product-details__short-description table td,
.woocommerce-Tabs-panel--description table td,
.woocommerce-Tabs-panel--additional_information table.shop_attributes td {
    padding: 12px 16px !important;
    border-bottom: 1px solid #eee !important;
    color: #555 !important;
    font-style: normal !important;
    /* Remove default italic for attributes */
}

.woocommerce-Tabs-panel--additional_information table.shop_attributes tr:nth-child(even) th,
.woocommerce-Tabs-panel--additional_information table.shop_attributes tr:nth-child(even) td {
    background-color: #fafafa !important;
}

/* 3. Delivery Message Visibility */
/* Ensure the urgency bar is always visible if generated */
.urgency-message,
.fomo-bar,
.social-proof-urgency,
.social-proof-sold {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}
