/* ============================================================
   AFRIYAH FOOTER STYLES
   ============================================================ */
/* Sticky Cart Z-Index Fix - High Priority */
.afriyah-sticky-add-to-cart,
.sticky-add-to-cart-bar,
#sticky-cart-panel,
.af-sticky-atc {
    z-index: 9 !important;
}

#whatsapp-widget,
.whatsapp-widget,
.chat-widget,
iframe[title="chat"],
.joinchat,
.ht-ctc-chat {
    z-index: 2147483647 !important;
}


/* Hide plugin's Amara widget - use theme's button instead */
.amara-ai-widget,
#amara-ai-widget {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Footer Link Hover Effects */
.af-footer a {
    transition: color 0.3s, transform 0.3s;
}

.af-footer a:hover,
.af-footer-contact a:hover {
    color: var(--wf-main-color, #006400) !important;
    /* Fallback to green */
    transform: translateX(4px);
}

.af-footer-column a[href*="facebook"]:hover {
    background: #1877F2 !important;
    color: #fff !important;
    border-color: #1877F2 !important;
}

.af-footer-column a[href*="twitter"]:hover {
    background: #1DA1F2 !important;
    color: #fff !important;
    border-color: #1DA1F2 !important;
}

.af-footer-column a[href*="instagram"]:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
    color: #fff !important;
    border-color: transparent !important;
}

.af-footer-column a[href*="linkedin"]:hover {
    background: #0077B5 !important;
    color: #fff !important;
    border-color: #0077B5 !important;
}

.af-footer-column a[href*="youtube"]:hover {
    background: #FF0000 !important;
    color: #fff !important;
    border-color: #FF0000 !important;
}

/* Newsletter Form */
.af-newsletter-form input:focus {
    border-color: var(--wf-main-color, #006400) !important;
    background: rgba(255, 255, 255, 0.15) !important;
}

.af-newsletter-form button:hover {
    background: var(--wf-main-color, #006400) !important;
    opacity: 0.9 !important;
    transform: translateY(-2px);
}

/* Floating Buttons */
.af-whatsapp-float,
.af-ai-chat-float {
    transition: transform 0.3s;
}

.af-whatsapp-float:hover,
.af-ai-chat-float:hover {
    transform: scale(1.1);
}

/* Desktop & Tablet Positioning */
@media (min-width: 769px) {
    .af-whatsapp-float {
        bottom: 30px !important;
        right: 20px !important;
    }

    .af-ai-chat-float {
        bottom: 100px !important;
        right: 20px !important;
    }

    /* Desktop Footer Grid */
    .af-footer-grid {
        display: grid;
        grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
        /* Standard efficient 4-col footer */
        gap: 30px;
    }
}

/* Mobile Footer Grid - 2 Columns for Links */
@media (max-width: 768px) {
    .af-footer-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
    }

    /* Company Info - Full Width */
    .af-footer-grid .af-footer-column:nth-child(1) {
        grid-column: 1 / -1 !important;
        text-align: center;
    }

    /* Quick Links & Customer Service - Side by Side */
    .af-footer-grid .af-footer-column:nth-child(2),
    .af-footer-grid .af-footer-column:nth-child(3) {
        grid-column: span 1 !important;
        margin: 0 !important;
        text-align: left;
    }

    /* Newsletter - Full Width */
    .af-footer-grid .af-footer-column:nth-child(4) {
        grid-column: 1 / -1 !important;
        text-align: center;
    }

    /* Mobile Floating Buttons */
    .af-whatsapp-float {
        bottom: 100px !important;
        right: 16px !important;
        width: 50px !important;
        height: 50px !important;
        font-size: 24px !important;
    }

    .af-ai-chat-float {
        bottom: 160px !important;
        right: 16px !important;
        width: 50px !important;
        height: 50px !important;
        font-size: 20px !important;
    }

    /* Product Page Adjustments */
    body.single-product .af-whatsapp-float,
    body.woocommerce.single-product .af-whatsapp-float {
        bottom: 160px !important;
    }

    body.single-product .af-ai-chat-float,
    body.woocommerce.single-product .af-ai-chat-float {
        bottom: 220px !important;
    }

    .af-sticky-atc {
        bottom: 70px !important;
    }
}

@media (max-width: 480px) {

    .af-whatsapp-float,
    .af-ai-chat-float {
        right: 12px !important;
    }
}

/* AI Chat Window Styles */
.afriyah-ai-chat-window {
    position: fixed;
    bottom: 160px;
    right: 20px;
    width: 380px;
    max-height: 500px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.afriyah-ai-chat-header {
    background: linear-gradient(135deg, #006400 0%, #008000 100%);
    color: #fff;
    padding: 20px 24px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.afriyah-ai-chat-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.afriyah-ai-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.afriyah-ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.afriyah-ai-chat-messages {
    flex: 1;
    max-height: 350px;
    overflow-y: auto;
    padding: 20px 24px;
    background: #fafafa;
}

.afriyah-ai-message {
    margin-bottom: 16px;
    display: flex;
}

.afriyah-ai-message.user {
    justify-content: flex-end;
}

.afriyah-ai-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.afriyah-ai-message.ai .afriyah-ai-message-content {
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid #e8f5e9;
}

.afriyah-ai-message.user .afriyah-ai-message-content {
    background: linear-gradient(135deg, #006400 0%, #008000 100%);
    color: #ffffff;
}

.afriyah-ai-chat-input-area {
    padding: 20px 24px;
    background: #ffffff;
    border-top: 1px solid #e8f5e9;
    border-radius: 0 0 20px 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

#afriyah-ai-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e8f5e9;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
}

#afriyah-ai-input:focus {
    border-color: #006400;
}

#afriyah-ai-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #006400 0%, #008000 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#afriyah-ai-send:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .afriyah-ai-chat-window {
        width: calc(100vw - 30px);
        max-width: 360px;
        right: 15px;
        bottom: 160px;
    }
}

@media (max-width: 480px) {
    .afriyah-ai-chat-window {
        right: 12px;
        bottom: 160px;
    }

    body.single-product .afriyah-ai-chat-window,
    body.woocommerce.single-product .afriyah-ai-chat-window {
        bottom: 220px;
    }
}

/* Cart Abandonment Animation */
@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    #af-cart-abandonment-notice {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Mobile Bottom Nav */
@media (max-width:768px) {
    .af-mobile-bottom-nav {
        display: block !important
    }

    body {
        padding-bottom: 70px
    }
}

.af-mobile-bottom-nav a:hover,
.af-mobile-bottom-nav button:hover {
    color: #006400
}

/* Quick View Modal (Matches Search Modal) */
#af-quick-view-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    /* Above Search Modal */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

#af-quick-view-modal .af-qv-content {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#af-quick-view-modal .af-qv-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #333;
    transition: background 0.3s;
    z-index: 10;
}

#af-quick-view-modal .af-qv-close:hover {
    background: #e0e0e0;
    color: #000;
}

/* Ensure images in QV don't overflow */
#af-quick-view-modal img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Layout for Product Content */
.af-qv-product-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .af-qv-product-wrapper {
        grid-template-columns: 1fr;
    }

    #af-quick-view-modal {
        padding: 10px;
        align-items: flex-end;
        /* Sheet-like on mobile? Or just center */
    }

    #af-quick-view-modal .af-qv-content {
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
        /* Sheet style */
        margin-bottom: 0;
    }
}