/* OLIVE BRANCH — Global Styles & Design System */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Vazirmatn:wght@300;400;500;700&display=swap');

:root {
    /* Colors - Light Mode */
    --primary: #2C5F2D;
    --primary-light: #4A7C3C;
    --gold: #D4A017;
    --gold-light: #E8B820;
    --bg-base: #FAFAF7;
    --bg-surface: #FFFFFF;
    --text-main: #1A1A1A;
    --text-muted: #6B7280;
    --text-on-primary: #FFFFFF;
    --border: #E5E7EB;
    --danger: #EF4444;
    --success: #10B981;
    
    /* Luxury Gradients */
    --brand-gradient: linear-gradient(135deg, #2C5F2D 0%, #4A7C3C 100%);
    --gold-gradient: linear-gradient(135deg, #D4A017 0%, #E8B820 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 20px -5px rgba(0, 0, 0, 0.1), 0 4px 8px -4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-gold: 0 10px 25px -5px rgba(212, 160, 23, 0.4);
    
    /* Transitions */
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

:root.dark {
    --primary: #4A7C3C;
    --primary-light: #5E914F;
    --bg-base: #0E1A0E;
    --bg-surface: #1A2E1A;
    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;
    --border: #2C3E2C;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}

body.font-arabic { font-family: 'Vazirmatn', sans-serif; }
body.font-english { font-family: 'Outfit', sans-serif; }

a { text-decoration: none; color: inherit; transition: var(--transition); }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* Utilities */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-padding { padding: 5rem 0; }
.text-center { text-align: center; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }

/* Premium Utilities */
.glass-surface {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--glass-border);
}

/* Floating navbar overrides .glass-surface */
#main-header.glass-surface {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.45);
}
body.dark #main-header.glass-surface {
    background: rgba(20, 30, 20, 0.65);
    border-color: rgba(255, 255, 255, 0.08);
}

.text-gradient-gold {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.icon-glow:hover {
    filter: drop-shadow(0 0 12px rgba(212, 160, 23, 0.65));
    transform: scale(1.15) translateY(-2px) rotate(5deg);
    color: var(--gold);
}

.hover-lift {
    transition: var(--transition);
}
.hover-lift:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.btn-shimmer {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 50%, var(--primary) 100%);
    background-size: 200% 100%;
}
.btn-shimmer:hover {
    animation: shimmer 2s infinite linear;
}

@keyframes pulse-gold {
    0% { box-shadow: 0 0 0 0 rgba(212, 160, 23, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(212, 160, 23, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 160, 23, 0); }
}

.pulse-gold {
    animation: pulse-gold 2s infinite;
}

/* Entrance Animations - Base class (JS will handle initial hiding for progressive enhancement) */
.animate-on-scroll {
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.fade-up {
    transform: translateY(40px);
}

.fade-in {
    /* Initially visible, JS will fade it if needed */
}

.scale-up {
    transform: scale(0.95);
}

/* Guarantee visibility once 'appeared' class is added */
.animate-on-scroll.appeared,
.fade-up.appeared,
.fade-in.appeared,
.scale-up.appeared {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}

/* Section Animation Defaults - JS handles the 'hidden' state if active */
/* Removed hierarchical section constraint for better reliability */

/* Layout - Header (Floating Navbar) */
#main-header {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2.5rem);
    max-width: 1400px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 9999px;
    box-shadow: 0 8px 32px rgba(44, 95, 45, 0.10), 0 2px 8px rgba(0,0,0,0.06);
    transition: var(--transition), top 0.3s ease, width 0.3s ease;
    padding: 0.75rem 1.5rem;
}

/* Dark mode floating nav */
body.dark #main-header {
    background: rgba(20, 30, 20, 0.65);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0,0,0,0.2);
}

#main-header.scrolled {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 12px 40px rgba(44, 95, 45, 0.14), 0 2px 8px rgba(0,0,0,0.08);
    top: 0.6rem;
    width: calc(100% - 2rem);
}
body.dark #main-header.scrolled {
    background: rgba(18, 26, 18, 0.88);
}

#main-header.header-hidden {
    transform: translateX(-50%) translateY(calc(-100% - 2rem));
    opacity: 0;
}


.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-link {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Desktop Nav */
.desktop-nav {
    display: none;
    gap: 2rem;
}
@media (min-width: 1024px) {
    .desktop-nav { display: flex; }
}
.nav-link {
    font-weight: 500;
    color: var(--text-main);
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--gold);
    transition: var(--transition);
}
.nav-link:hover::after { width: 100%; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.action-btn {
    font-size: 1.25rem;
    color: var(--text-main);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: 9999px;
}
.action-btn:hover { color: var(--gold); background-color: rgba(0,0,0,0.05); }

#mobile-menu-toggle {
    display: flex;
}
@media (min-width: 1024px) {
    #mobile-menu-toggle { display: none !important; }
}

.cart-badge {
    position: absolute;
    top: -2px;
    inset-inline-end: -2px;
    background-color: var(--danger);
    color: white;
    font-size: 0.72rem;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
[dir="rtl"] .cart-badge {
    right: auto;
    left: -2px;
}
[dir="ltr"] .cart-badge {
    left: auto;
    right: -2px;
}

/* Mobile Header Optimization (<= 640px) */
@media (max-width: 640px) {
    #main-header {
        top: 0.5rem;
        width: calc(100% - 1rem);
        padding: 0.4rem 0.65rem;
    }
    #main-header.scrolled {
        top: 0.35rem;
        width: calc(100% - 0.75rem);
        padding: 0.35rem 0.55rem;
    }
    .header-actions {
        gap: 0.4rem;
    }
    .action-btn {
        padding: 0.3rem;
        font-size: 1.1rem;
    }
    .logo-link {
        font-size: 1.05rem;
        gap: 0.35rem;
    }
    .logo-link img {
        height: 1.85rem !important;
        width: 1.85rem !important;
    }
    #lang-toggle {
        font-size: 0.75rem;
        padding: 0.2rem 0.35rem;
    }
    .cart-badge {
        width: 1.05rem;
        height: 1.05rem;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .logo-link span {
        display: none;
    }
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    display: flex;
    align-items: center;
    color: white;
    z-index: 1;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    z-index: 1;
    background-image: linear-gradient(rgba(10, 20, 10, 0.55), rgba(10, 20, 10, 0.35)), url('../assets/grove_hero_banner.jpg');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-color: #1b381c;
    transition: transform 0.1s linear;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-content {
    max-width: 650px;
    opacity: 0;
    transform: translateY(30px);
    transition: 1s ease-out;
}
.hero-content.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.hero-tag {
    display: inline-block;
    background-color: var(--gold);
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

.hero-actions { display: flex; gap: 1rem; }

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-primary:hover { background-color: var(--primary-light); transform: translateY(-2px); }

.btn-secondary {
    background-color: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    border: 1px solid white;
    color: white;
    padding: 1rem 2rem;
    border-radius: 4px;
    font-weight: 600;
}
.btn-secondary:hover { background-color: white; color: var(--primary); }

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: var(--bg-surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}
.product-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }

.card-img-wrapper {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}
.card-img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.product-card:hover .card-img { transform: scale(1.1); }

.card-badges {
    position: absolute;
    top: 0.75rem;
    inset-inline-start: 0.75rem;
    inset-inline-end: auto;
    left: auto;
    right: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    width: fit-content;
    max-width: 60%;
    pointer-events: none;
    z-index: 10;
}
[dir="rtl"] .card-badges {
    left: auto !important;
    right: 0.75rem !important;
    align-items: flex-start;
}
[dir="ltr"] .card-badges {
    right: auto !important;
    left: 0.75rem !important;
    align-items: flex-start;
}

.badge {
    display: inline-block;
    width: fit-content;
    white-space: nowrap;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.2;
}
.badge-bestseller { background-color: var(--gold); color: white; }
.badge-organic { background-color: var(--primary); color: white; }
.badge-discount { background-color: var(--danger); color: white; }

.card-body { padding: 1.5rem; text-align: center; }
.card-name { font-size: 1.25rem; margin-bottom: 0.5rem; color: var(--text-main); }
.card-size { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 0.75rem; }

.card-rating-count { font-size: 0.75rem; opacity: 0.6; }
.card-price-row { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.75rem; }
.card-sale-price { font-weight: 800; font-size: 1.125rem; color: var(--primary); }
.card-original-price { font-size: 0.875rem; opacity: 0.4; }

.card-discount-tag {
    position: absolute;
    top: 0.75rem;
    inset-inline-end: 0.75rem;
    inset-inline-start: auto;
    left: auto;
    right: auto;
    width: fit-content;
    white-space: nowrap;
    background: var(--danger);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    z-index: 10;
}
[dir="rtl"] .card-discount-tag {
    left: 0.75rem !important;
    right: auto !important;
}
[dir="ltr"] .card-discount-tag {
    right: 0.75rem !important;
    left: auto !important;
}
.card-save-badge { position: absolute; bottom: 0.75rem; left: 0.75rem; background: var(--success); color: white; padding: 0.25rem 0.625rem; border-radius: 6px; font-size: 0.7rem; font-weight: 700; }

/* Card Qty Row */
.card-qty-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 0.75rem; }
.card-qty-picker { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--bg-base); }
.card-qty-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 700; transition: var(--transition); }
.card-qty-btn:hover { background: var(--border); }
.card-qty-input { width: 32px; border: none; background: transparent; text-align: center; font-size: 0.875rem; font-weight: 700; font-family: inherit; appearance: textfield; -moz-appearance: textfield; }
.card-qty-input::-webkit-outer-spin-button, .card-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn-add-to-cart { background: var(--primary); color: white; padding: 0.5rem 0.75rem; border-radius: 6px; font-size: 0.8rem; font-weight: 700; flex-grow: 1; transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 0.4rem; }
.btn-add-to-cart:hover { background: #1A3F1A; transform: translateY(-1px); }
.btn-add-to-cart:active { transform: translateY(0); }

/* Testimonials Carousel */
.testimonials-section { background-color: var(--bg-surface); position: relative; }
.carousel-wrapper { overflow: hidden; position: relative; width: 100%; }
.carousel-track { display: flex; transition: transform 0.5s ease-in-out; }
.testimonial-card {
    flex: 0 0 100%;
    padding: 2rem;
    text-align: center;
}
.reviewer-avatar { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 1.5rem; border: 3px solid var(--gold); }
.testimonial-text { font-style: italic; font-size: 1.5rem; margin-bottom: 1.5rem; color: var(--text-main); }

/* Cart Drawer */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.cart-overlay.open { opacity: 1; visibility: visible; }

.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: var(--bg-surface);
    z-index: 2001;
    transition: 0.4s ease-out;
    display: flex;
    flex-direction: column;
}
body.rtl .cart-drawer { right: auto; left: -400px; }
.cart-drawer.open { right: 0; }
body.rtl .cart-drawer.open { left: 0; }

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.cart-item-img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
.cart-item-info { flex: 1; }
.qty-btn { width: 24px; height: 24px; border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; }

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background-color: var(--bg-base);
}

/* Auth Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.modal.open { opacity: 1; visibility: visible; }
.modal-overlay { position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); }
.modal-content {
    position: relative;
    width: 100%;
    max-width: 450px;
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 2.5rem;
    z-index: 3001;
}

.auth-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.auth-tab { flex: 1; padding: 1rem; text-align: center; color: var(--text-muted); cursor: pointer; }
.auth-tab.active { color: var(--primary); border-bottom: 2px solid var(--primary); font-weight: 700; }

.auth-panel { display: none; }
.auth-panel.active { display: block; }

.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.875rem; }
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-base);
    color: var(--text-main);
}
.form-control:focus { outline: none; border-color: var(--primary); }

.captcha-wrapper { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.captcha-canvas { border-radius: 8px; background: #000; }

/* Success Toast */
.success-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    background-color: var(--success);
    color: white;
    padding: 1rem 2rem;
    border-radius: 9999px;
    box-shadow: var(--shadow-lg);
    z-index: 5000;
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.success-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Animation Classes */
.fade-up { opacity: 0; transform: translateY(30px); transition: 0.8s ease-out; }
.fade-up.animate-in { opacity: 1; transform: translateY(0); }

/* RTL Support overrides */
body.font-arabic .hero-title { font-size: 3rem; }
body.rtl { direction: rtl; }
body.rtl .hero-actions, body.rtl .header-actions { flex-direction: row-reverse; }

/* Footer */
footer { background-color: #1A2E1A; color: rgba(255,255,255,0.8); padding: 5rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 3rem; margin-bottom: 4rem; }
.footer-title { color: white; font-size: 1.25rem; margin-bottom: 1.5rem; font-weight: 700; }
.footer-link { display: block; margin-bottom: 0.75rem; transition: var(--transition); }
.footer-link:hover { color: var(--gold); padding-inline-start: 5px; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 2rem; text-align: center; }

/* WhatsApp Float & Widget */
.whatsapp-widget-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    direction: ltr;
}

body.rtl .whatsapp-widget-container,
[dir="rtl"] .whatsapp-widget-container {
    right: auto;
    left: 2rem;
    direction: rtl;
}

.whatsapp-float-btn {
    display: inline-flex;
    align-items: center;
    position: relative;
    text-decoration: none;
    cursor: pointer;
    outline: none;
}

.whatsapp-icon-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45), 0 4px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease, background 0.35s ease;
    z-index: 2;
}

.whatsapp-float-btn:hover .whatsapp-icon-wrapper {
    transform: scale(1.1) rotate(6deg);
    box-shadow: 0 14px 32px rgba(37, 211, 102, 0.6), 0 6px 12px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #2ae06c 0%, #159c8c 100%);
}

.whatsapp-float-btn:active .whatsapp-icon-wrapper {
    transform: scale(0.96);
}

.whatsapp-pulse-ring {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    z-index: 1;
    pointer-events: none;
    animation: wa-pulse 2.2s infinite cubic-bezier(0.24, 0, 0.38, 1);
}

@keyframes wa-pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    60% {
        transform: scale(1.55);
        opacity: 0;
    }
    100% {
        transform: scale(1.55);
        opacity: 0;
    }
}

.whatsapp-svg {
    width: 32px;
    height: 32px;
    fill: #ffffff;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
    transition: transform 0.35s ease;
}

.whatsapp-float-btn:hover .whatsapp-svg {
    transform: scale(1.05);
}

.whatsapp-online-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #22c55e;
    border: 2.5px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.9);
    animation: wa-beacon 2s infinite ease-in-out;
}

body.rtl .whatsapp-online-dot,
[dir="rtl"] .whatsapp-online-dot {
    right: auto;
    left: 2px;
}

@keyframes wa-beacon {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.85;
    }
}

.whatsapp-tooltip {
    position: absolute;
    right: calc(100% + 14px);
    background: rgba(22, 45, 33, 0.95);
    backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 9999px;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(212, 160, 23, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateX(12px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.3s;
    pointer-events: none;
    z-index: 10;
}

.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(22, 45, 33, 0.95);
}

body.rtl .whatsapp-tooltip,
[dir="rtl"] .whatsapp-tooltip {
    right: auto;
    left: calc(100% + 14px);
    transform: translateX(-12px) scale(0.95);
}

body.rtl .whatsapp-tooltip::after,
[dir="rtl"] .whatsapp-tooltip::after {
    right: auto;
    left: -6px;
    border-width: 6px 6px 6px 0;
    border-color: transparent rgba(22, 45, 33, 0.95) transparent transparent;
}

.whatsapp-float-btn:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
}

/* Backward compatibility for .whatsapp-float */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
    z-index: 1000;
    transition: transform 0.3s ease;
}
.whatsapp-float:hover {
    transform: scale(1.1);
}
body.rtl .whatsapp-float { right: auto; left: 2rem; }

/* Responsive */
@media (max-width: 1024px) {
    .hero-title { font-size: 2.5rem; }
}

@media (max-width: 768px) {
    .desktop-nav { display: none; }
    .hero-title { font-size: 2rem; }
    .hero-content { text-align: center; margin: 0 auto; }
}
/* About Page Specifics */
.about-hero {
    padding: 10rem 0 6rem;
    text-align: center;
    background: radial-gradient(circle at center, rgba(44, 95, 45, 0.05) 0%, transparent 70%);
}

.story-section {
    padding: 8rem 0;
    overflow: hidden;
}

.vision-mission-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: start;
}

.vision-card, .mission-card {
    padding: 4rem;
    background: var(--bg-surface);
    border-radius: 2.5rem;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.vision-card:hover, .mission-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.foundation-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.foundation-text {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.value-card {
    background: var(--bg-surface);
    padding: 4rem 2.5rem;
    border-radius: 2rem;
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.value-card:hover {
    transform: translateY(-12px);
    border-color: var(--gold);
    box-shadow: 0 30px 60px -12px rgba(44, 95, 45, 0.15);
}

.value-icon-box {
    width: 5.5rem;
    height: 5.5rem;
    background: var(--bg-base);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1.75rem;
    margin: 0 auto 2.5rem;
    transition: all 0.5s ease;
}

.value-card:hover .value-icon-box {
    background: var(--primary);
    color: white;
    transform: scale(1.1) rotate(5deg);
}

.closing-banner {
    padding: 10rem 0;
    background-color: var(--primary);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.closing-text {
    font-size: 2.5rem;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    max-width: 900px;
    margin: 0 auto 3rem;
    line-height: 1.5;
    position: relative;
    z-index: 10;
}

body.font-arabic .closing-text {
    font-family: 'Amiri', serif;
    font-size: 2.75rem;
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.appeared {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1024px) {
    .vision-mission-grid { grid-template-columns: 1fr; gap: 3rem; }
}

@media (max-width: 768px) {
    .closing-text { font-size: 1.75rem; }
}

/* ============================================================
   MERCHANT FEATURE STYLES
   ============================================================ */

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.status-badge.pending  { background: rgba(234, 179, 8, 0.12);  color: #a16207; border: 1px solid rgba(234,179,8,0.3); }
.status-badge.approved { background: rgba(34, 197, 94, 0.12);  color: #15803d; border: 1px solid rgba(34,197,94,0.3); }
.status-badge.rejected { background: rgba(239, 68, 68, 0.12);  color: #dc2626; border: 1px solid rgba(239,68,68,0.3); }
.status-badge.active   { background: rgba(44,  95, 45, 0.12);  color: #2C5F2D; border: 1px solid rgba(44,95,45,0.3);  }

/* Merchant Multi-step Flow */
.merchant-steps {
    display: flex;
    gap: 0;
    margin-bottom: 2.5rem;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border);
}
.merchant-step-item {
    flex: 1;
    padding: 0.9rem 1rem;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--bg-base);
    color: var(--text-muted);
    position: relative;
    transition: var(--transition);
}
.merchant-step-item.active {
    background: var(--primary);
    color: white;
}
.merchant-step-item.done {
    background: rgba(44, 95, 45, 0.08);
    color: var(--primary);
}
.merchant-step-num {
    display: inline-flex;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    margin-right: 0.4rem;
}
.merchant-step-item.done .merchant-step-num {
    background: var(--primary);
    color: white;
}

/* Merchant Panel Cards */
.merchant-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}
.merchant-panel.active { display: block; }

/* Status Screen (Pending / Rejected) */
.merchant-status-screen {
    text-align: center;
    padding: 5rem 2rem;
}
.merchant-status-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    display: block;
    animation: pulse 2s infinite;
}

/* Merchant Product Table */
.merchant-product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.merchant-product-table th,
.merchant-product-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
body.font-arabic .merchant-product-table th,
body.font-arabic .merchant-product-table td { text-align: right; }
.merchant-product-table thead {
    background: var(--bg-base);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.merchant-product-table tbody tr:hover { background: rgba(0,0,0,0.02); }

/* OTP Input */
.otp-input {
    font-size: 2rem;
    letter-spacing: 0.5em;
    text-align: center;
    font-weight: 700;
    font-family: monospace;
    max-width: 260px;
    margin: 0 auto;
    display: block;
}

/* Merchant Dashboard Sidebar */
.merchant-sidebar {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 2rem 1.5rem;
    position: sticky;
    top: 6rem;
}
.merchant-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
}
.merchant-nav-btn {
    width: 100%;
    text-align: left;
    padding: 0.85rem 1.1rem;
    border-radius: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition);
    color: var(--text-main);
}
body.font-arabic .merchant-nav-btn { text-align: right; }
.merchant-nav-btn:hover { background: var(--bg-base); color: var(--primary); }
.merchant-nav-btn.active { background: var(--primary); color: white; }

/* Add Product Form Panel */
.merchant-form-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 2.5rem;
}

/* Admin tabs for merchant/product approvals */
.admin-tab-new { border-bottom: 4px solid transparent; transition: var(--transition); }
.admin-tab-new.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Rejection note textarea */
.reject-reason-input {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg-base);
    color: var(--text-main);
    font-size: 0.85rem;
    resize: vertical;
    min-height: 60px;
    margin-top: 0.5rem;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@media (max-width: 768px) {
    .merchant-steps { flex-direction: column; }
    .merchant-step-item { border-bottom: 1px solid var(--border); }
    .merchant-product-table { font-size: 0.8rem; }
    .merchant-product-table th, .merchant-product-table td { padding: 0.6rem; }
}

/* ============================================================
   TERMS AGREEMENT CHECKBOX
   ============================================================ */

.terms-agree-box {
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(44, 95, 45, 0.05), rgba(212, 160, 23, 0.03));
    border: 1px solid rgba(44, 95, 45, 0.2);
    border-radius: 10px;
    transition: border-color 0.3s;
}
.terms-agree-box:has(.terms-checkbox:checked) {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(44, 95, 45, 0.08), rgba(212, 160, 23, 0.05));
}
.terms-agree-box.has-error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.04);
    animation: shake 0.4s ease;
}

.terms-agree-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-main);
}

.terms-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--border);
    border-radius: 5px;
    background: var(--bg-surface);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    margin-top: 1px;
    flex-shrink: 0;
}
.terms-checkbox:hover {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.1);
}
.terms-checkbox:checked {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(44, 95, 45, 0.35);
}
.terms-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 6px;
    height: 10px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.terms-link {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
    transition: color 0.2s;
}
.terms-link:hover { color: var(--gold); }

/* Field error */
.field-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.4rem;
    display: block;
    font-weight: 500;
}

.input-error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* ============================================================
   TOAST NOTIFICATIONS & FLOATING UI
   ============================================================ */

.success-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1B381C;
    color: #FFFFFF;
    padding: 1rem 2rem;
    border-radius: 9999px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(212, 160, 23, 0.4);
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.success-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.success-toast span {
    color: var(--gold);
    font-size: 1.25rem;
}

/* Payment Option Card Hover & Selected States */
.payment-option {
    transition: all 0.25s ease;
}
.payment-option:hover {
    border-color: var(--primary);
    background-color: rgba(44, 95, 45, 0.03);
}
.payment-option.selected {
    border-color: var(--primary) !important;
    background-color: rgba(44, 95, 45, 0.06) !important;
    box-shadow: 0 4px 15px rgba(44, 95, 45, 0.12);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: capitalize;
}
.status-badge.active,
.status-badge.approved,
.status-badge.completed,
.status-badge.delivered {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}
.status-badge.pending,
.status-badge.processing {
    background: rgba(212, 160, 23, 0.15);
    color: #B45309;
}
.status-badge.rejected,
.status-badge.cancelled {
    background: rgba(239, 68, 68, 0.12);
    color: #DC2626;
}

/* ==========================================================================
   AI Chatbot Personal Assistant Widget (غصن الزيتون)
   ========================================================================== */
.ai-chatbot-widget {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 1001;
    display: flex;
    align-items: center;
    direction: ltr;
    font-family: inherit;
}

body.rtl .ai-chatbot-widget,
[dir="rtl"] .ai-chatbot-widget {
    left: auto;
    right: 2rem;
    direction: rtl;
}

/* Launcher Button */
.ai-chatbot-launcher {
    position: relative;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1B4D3E 0%, #0D281E 60%, #D4AF37 150%);
    color: #ffffff;
    border: 2px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 8px 24px rgba(27, 77, 62, 0.4), 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease, border-color 0.35s ease;
    z-index: 2;
}

.ai-chatbot-launcher:hover {
    transform: scale(1.1) rotate(5deg);
    border-color: rgba(212, 175, 55, 0.8);
    box-shadow: 0 12px 30px rgba(27, 77, 62, 0.55), 0 0 15px rgba(212, 175, 55, 0.4);
}

.ai-chatbot-launcher:active {
    transform: scale(0.96);
}

.ai-pulse-ring {
    position: absolute;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #1B4D3E;
    z-index: 1;
    pointer-events: none;
    animation: ai-pulse 2.4s infinite cubic-bezier(0.24, 0, 0.38, 1);
}

@keyframes ai-pulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    60% { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}

.ai-beacon-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #10B981;
    border: 2.5px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.9);
    animation: ai-beacon 2s infinite ease-in-out;
}

body.rtl .ai-beacon-dot,
[dir="rtl"] .ai-beacon-dot {
    right: auto;
    left: 2px;
}

@keyframes ai-beacon {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.85; }
}

.ai-chatbot-tooltip {
    position: absolute;
    left: calc(100% + 14px);
    background: rgba(20, 41, 31, 0.95);
    backdrop-filter: blur(10px);
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 9999px;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(212, 175, 55, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.3s;
    pointer-events: none;
    z-index: 10;
}

.ai-chatbot-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -6px;
    transform: translateY(-50%);
    border-width: 6px 6px 6px 0;
    border-style: solid;
    border-color: transparent rgba(20, 41, 31, 0.95) transparent transparent;
}

body.rtl .ai-chatbot-tooltip,
[dir="rtl"] .ai-chatbot-tooltip {
    left: auto;
    right: calc(100% + 14px);
    transform: translateX(10px) scale(0.95);
}

body.rtl .ai-chatbot-tooltip::after,
[dir="rtl"] .ai-chatbot-tooltip::after {
    left: auto;
    right: -6px;
    border-width: 6px 0 6px 6px;
    border-color: transparent transparent transparent rgba(20, 41, 31, 0.95);
}

.ai-chatbot-widget:hover .ai-chatbot-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
}

/* Chat Window */
.ai-chat-window {
    position: fixed;
    bottom: 6.5rem;
    left: 2rem;
    width: 390px;
    max-width: calc(100vw - 32px);
    height: 590px;
    max-height: calc(100vh - 130px);
    background: var(--bg-surface, #ffffff);
    border-radius: 1.5rem;
    border: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom left;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

body.rtl .ai-chat-window,
[dir="rtl"] .ai-chat-window {
    left: auto;
    right: 2rem;
    transform-origin: bottom right;
}

.ai-chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.ai-chat-header {
    background: linear-gradient(135deg, #1B4D3E 0%, #12382C 100%);
    color: #ffffff;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.ai-chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(212, 175, 55, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ai-chat-avatar-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.ai-chat-avatar-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    background: #10B981;
    border: 2px solid #1B4D3E;
    border-radius: 50%;
}

.ai-chat-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
}

.ai-chat-status {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-chat-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-chat-btn-icon {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s, transform 0.2s;
}

.ai-chat-btn-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Messages Area */
.ai-chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    background: var(--bg-base, #FAFAFA);
}

.ai-msg {
    display: flex;
    gap: 0.65rem;
    max-width: 88%;
    animation: ai-msg-fade 0.3s ease forwards;
}

@keyframes ai-msg-fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-msg.bot {
    align-self: flex-start;
}

.ai-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary, #1B4D3E);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.ai-msg-bubble {
    padding: 0.75rem 1rem;
    border-radius: 1.15rem;
    font-size: 0.875rem;
    line-height: 1.5;
    position: relative;
    word-break: break-word;
}

.ai-msg.user .ai-msg-bubble {
    background: linear-gradient(135deg, #1B4D3E 0%, #153D31 100%);
    color: #ffffff;
    border-bottom-right-radius: 0.25rem;
}

body.rtl .ai-msg.user .ai-msg-bubble,
[dir="rtl"] .ai-msg.user .ai-msg-bubble {
    border-bottom-right-radius: 1.15rem;
    border-bottom-left-radius: 0.25rem;
}

.ai-msg.bot .ai-msg-bubble {
    background: var(--bg-surface, #ffffff);
    color: var(--text-base, #1f2937);
    border: 1px solid var(--border, #E5E7EB);
    border-bottom-left-radius: 0.25rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

body.rtl .ai-msg.bot .ai-msg-bubble,
[dir="rtl"] .ai-msg.bot .ai-msg-bubble {
    border-bottom-left-radius: 1.15rem;
    border-bottom-right-radius: 0.25rem;
}

.ai-msg-bubble a {
    color: #D4AF37;
    font-weight: 600;
    text-decoration: underline;
}

.ai-msg-bubble ul, .ai-msg-bubble ol {
    margin: 0.4rem 0;
    padding-inline-start: 1.2rem;
}

.ai-msg-bubble li {
    margin-bottom: 0.25rem;
}

/* Onboarding Card for Guest */
.ai-guest-card {
    background: var(--bg-surface, #ffffff);
    border: 1.5px solid rgba(212, 175, 55, 0.35);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    margin-top: 0.5rem;
}

.ai-guest-card h4 {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--primary, #1B4D3E);
}

.ai-guest-card p {
    font-size: 0.775rem;
    color: var(--text-muted, #6b7280);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.ai-guest-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.825rem;
    border: 1px solid var(--border, #E5E7EB);
    border-radius: 0.5rem;
    background: var(--bg-base, #FAFAFA);
    margin-bottom: 0.5rem;
    color: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.ai-guest-input:focus {
    border-color: var(--primary, #1B4D3E);
}

.ai-guest-submit {
    width: 100%;
    padding: 0.55rem;
    background: linear-gradient(135deg, #1B4D3E 0%, #D4AF37 150%);
    color: white;
    font-size: 0.825rem;
    font-weight: 700;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ai-guest-submit:hover {
    opacity: 0.92;
}

.ai-guest-skip {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 0.4rem;
    font-size: 0.725rem;
    color: var(--text-muted, #6b7280);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

/* Quick Suggestion Chips */
.ai-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.ai-chip {
    background: var(--bg-surface, #ffffff);
    border: 1px solid rgba(27, 77, 62, 0.2);
    color: var(--primary, #1B4D3E);
    padding: 0.4rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.ai-chip:hover {
    background: var(--primary, #1B4D3E);
    color: #ffffff;
    border-color: var(--primary, #1B4D3E);
    transform: translateY(-1px);
}

/* Typing Indicator */
.ai-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.6rem 0.85rem;
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border, #E5E7EB);
    border-radius: 1rem;
    width: fit-content;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.ai-typing-dot {
    width: 6px;
    height: 6px;
    background: var(--primary, #1B4D3E);
    border-radius: 50%;
    animation: ai-bounce 1.4s infinite ease-in-out both;
}

.ai-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes ai-bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input Bar */
.ai-chat-input-container {
    padding: 0.75rem 1rem;
    background: var(--bg-surface, #ffffff);
    border-top: 1px solid var(--border, #E5E7EB);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-chat-input {
    flex: 1;
    background: var(--bg-base, #FAFAFA);
    border: 1px solid var(--border, #E5E7EB);
    border-radius: 9999px;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    color: inherit;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.ai-chat-input:focus {
    border-color: var(--primary, #1B4D3E);
    background: var(--bg-surface, #ffffff);
}

.ai-chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1B4D3E 0%, #12382C 100%);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}

.ai-chat-send-btn:hover {
    transform: scale(1.06);
    background: linear-gradient(135deg, #246552 0%, #1B4D3E 100%);
}

.ai-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Dark Mode Chatbot Adaptations */
html.dark .ai-chat-window,
body.dark .ai-chat-window,
[data-theme="dark"] .ai-chat-window {
    background: #14281E;
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

html.dark .ai-chat-messages,
body.dark .ai-chat-messages,
[data-theme="dark"] .ai-chat-messages {
    background: #0D1C15;
}

html.dark .ai-msg.bot .ai-msg-bubble,
body.dark .ai-msg.bot .ai-msg-bubble,
[data-theme="dark"] .ai-msg.bot .ai-msg-bubble {
    background: #1A3528;
    color: #F3F4F6;
    border-color: rgba(255, 255, 255, 0.1);
}

html.dark .ai-guest-card,
body.dark .ai-guest-card,
[data-theme="dark"] .ai-guest-card {
    background: #183327;
    border-color: rgba(212, 175, 55, 0.5);
}

html.dark .ai-guest-card h4,
body.dark .ai-guest-card h4,
[data-theme="dark"] .ai-guest-card h4 {
    color: #F4E8C1;
}

html.dark .ai-guest-card p,
body.dark .ai-guest-card p,
[data-theme="dark"] .ai-guest-card p {
    color: #9CA3AF;
}

html.dark .ai-guest-input,
body.dark .ai-guest-input,
[data-theme="dark"] .ai-guest-input {
    background: #0F221A;
    border-color: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

html.dark .ai-chip,
body.dark .ai-chip,
[data-theme="dark"] .ai-chip {
    background: #183327;
    color: #E5E7EB;
    border-color: rgba(212, 175, 55, 0.4);
}

html.dark .ai-chip:hover,
body.dark .ai-chip:hover,
[data-theme="dark"] .ai-chip:hover {
    background: #24523E;
    color: #FFFFFF;
    border-color: #D4AF37;
}

html.dark .ai-typing-indicator,
body.dark .ai-typing-indicator,
[data-theme="dark"] .ai-typing-indicator {
    background: #1A3528;
    border-color: rgba(255, 255, 255, 0.1);
}

html.dark .ai-chat-input-container,
body.dark .ai-chat-input-container,
[data-theme="dark"] .ai-chat-input-container {
    background: #14281E;
    border-color: rgba(255, 255, 255, 0.1);
}

html.dark .ai-chat-input,
body.dark .ai-chat-input,
[data-theme="dark"] .ai-chat-input {
    background: #0D1C15;
    border-color: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

/* ============================================================
   ACCOUNT & HEADER USER PILL STYLES
   ============================================================ */
#auth-account-link .action-btn {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    background: rgba(44, 95, 45, 0.08);
    border: 1px solid rgba(44, 95, 45, 0.2);
    border-radius: 9999px;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}
body.dark #auth-account-link .action-btn {
    background: rgba(74, 124, 60, 0.15);
    border-color: rgba(212, 160, 23, 0.3);
    color: #e5e7eb;
}
#auth-account-link .action-btn:hover {
    background: rgba(44, 95, 45, 0.15);
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-1px);
}
#header-user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

.account-header-banner {
    background: linear-gradient(135deg, rgba(44, 95, 45, 0.05) 0%, rgba(212, 160, 23, 0.05) 100%), var(--surface);
    backdrop-filter: blur(12px);
    transition: var(--transition);
}
body.dark .account-header-banner {
    background: linear-gradient(135deg, rgba(44, 95, 45, 0.15) 0%, rgba(212, 160, 23, 0.08) 100%), var(--surface);
    border-color: rgba(255, 255, 255, 0.08);
}

.account-tab-btn {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.account-tab-btn:hover:not(.active) {
    background: rgba(44, 95, 45, 0.06);
    color: var(--primary);
    transform: translateX(3px);
}
[dir="rtl"] .account-tab-btn:hover:not(.active) {
    transform: translateX(-3px);
}
body.dark .account-tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--gold);
}




