/* CSS Reset & Custom Properties */
:root {
    --color-bg: #FAF9F6;
    --color-text: #2C3E2D;
    --color-text-light: #5A6D5B;
    --color-accent: #D4AF37;
    --color-accent-hover: #b5952f;
    --color-white: #FFFFFF;
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.1; margin-bottom: 1rem; }
h2 { font-size: clamp(2rem, 3.5vw, 3rem); margin-bottom: 1rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    border-radius: 2px;
    transition: var(--transition-smooth);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
}

.btn-outline:hover {
    background: var(--color-accent);
    color: var(--color-white);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: var(--transition-smooth);
    background: transparent;
}

.navbar.scrolled {
    background: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 5%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-svg {
    height: 44px;
    width: auto;
    display: block;
    transition: var(--transition-smooth);
}

.navbar.scrolled .logo-svg {
    height: 34px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-accent);
    transition: var(--transition-smooth);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cart-btn {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    color: var(--color-text);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--color-accent);
    color: var(--color-white);
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--color-text);
    transition: var(--transition-smooth);
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 5%;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.05);
    animation: slowZoom 20s ease-in-out infinite alternate;
}

@keyframes slowZoom {
    0% { transform: scale(1.05); }
    100% { transform: scale(1.15); }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(250, 249, 246, 0.9) 0%, rgba(250, 249, 246, 0.4) 50%, rgba(250, 249, 246, 0.1) 100%);
}

.hero-content {
    max-width: 600px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s forwards 0.5s;
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

.subtitle {
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--color-accent);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: block;
}

.hero p {
    margin-bottom: 2rem;
    color: var(--color-text-light);
    font-size: 1.1rem;
}

/* Products Section */
.products-section {
    padding: 8rem 5%;
    background: var(--color-white);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header p {
    color: var(--color-text-light);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    background: var(--color-bg);
    border-radius: 4px;
    overflow: hidden;
    transition: var(--transition-smooth);
    position: relative;
    group: card;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.05);
}

.product-image-container {
    height: 350px;
    overflow: hidden;
    position: relative;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

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

.product-info {
    padding: 2rem 1.5rem;
    text-align: center;
}

.product-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.product-price {
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
}

.add-to-cart {
    opacity: 0;
    transform: translateY(10px);
    width: 100%;
}

.product-card:hover .add-to-cart {
    opacity: 1;
    transform: translateY(0);
}

/* About Section */
.about-section {
    padding: 8rem 5%;
    background-color: var(--color-text);
    color: var(--color-bg);
    text-align: center;
}

.about-content {
    max-width: 700px;
    margin: 0 auto;
}

.about-content h2 {
    color: var(--color-accent);
}

.about-content p {
    font-size: 1.1rem;
    color: #e0e0e0;
}

/* Footer */
footer {
    background: #1A251B;
    color: var(--color-bg);
    padding: 5rem 5% 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto 3rem;
}

.footer-brand p {
    color: #a0a0a0;
    margin-top: 1rem;
}

.footer-links ul {
    list-style: none;
    margin-top: 1rem;
}

.footer-links a {
    color: #a0a0a0;
    text-decoration: none;
    transition: var(--transition-smooth);
    line-height: 2;
}

.footer-links a:hover {
    color: var(--color-accent);
}

.footer-contact p {
    color: #a0a0a0;
    margin-top: 1rem;
}

/* Social Media Links */
.social-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #a0a0a0;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.social-link:hover {
    transform: translateY(-3px);
}

.social-instagram:hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: #fff;
}

.social-facebook:hover {
    background: #1877F2;
    color: #fff;
}

.social-x:hover {
    background: #000;
    color: #fff;
}

.social-whatsapp:hover {
    background: #25D366;
    color: #fff;
}

/* Floating WhatsApp Button */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 999;
    text-decoration: none;
    transition: var(--transition-smooth);
    animation: whatsappPulse 2s infinite;
}

.whatsapp-float:hover {
    background: #1EBE57;
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.55);
    animation: none;
}

.whatsapp-tooltip {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #2C3E2D;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: var(--font-body);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #2C3E2D;
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
}

@keyframes whatsappPulse {
    0% { box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(37, 211, 102, 0.6); }
    100% { box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4); }
}

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

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--color-bg);
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        gap: 1.5rem;
        box-shadow: 0 10px 10px rgba(0,0,0,0.05);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: var(--transition-smooth);
    }

    .nav-links.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    .menu-toggle {
        display: flex;
    }
    
    .hero-overlay {
        background: linear-gradient(to top, rgba(250, 249, 246, 0.9) 0%, rgba(250, 249, 246, 0.7) 100%);
    }

    .add-to-cart {
        opacity: 1;
        transform: none;
    }

    .whatsapp-float {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 52px;
        height: 52px;
    }

    .social-links {
        justify-content: center;
    }
}

/* Cart Sidebar */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--color-bg);
    z-index: 1002;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cart-sidebar.active {
    right: 0;
}

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

.cart-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-cart {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--color-text);
}

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

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.cart-item-select {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.cart-item-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.qty-btn {
    background: var(--color-white);
    border: 1px solid rgba(0,0,0,0.2);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 2px;
}

.qty-display {
    font-size: 0.9rem;
    min-width: 20px;
    text-align: center;
}

.remove-item {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: underline;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    background: var(--color-white);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.checkout-btn {
    width: 100%;
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.empty-cart-msg {
    text-align: center;
    color: var(--color-text-light);
    margin-top: 2rem;
}

/* Order Confirmation Modal */
.order-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2001;
    display: none;
}

.order-modal-overlay.active {
    display: block;
}

.order-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-bg);
    padding: 2.5rem;
    border-radius: 8px;
    z-index: 2002;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: none;
    text-align: center;
}

.order-modal.active {
    display: block;
}

.order-modal h2 {
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.order-summary {
    margin: 1.5rem 0;
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.order-summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.order-total {
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

/* Order Contact Fields */
.order-contact-fields {
    text-align: left;
    margin-bottom: 1rem;
}

.order-field {
    margin-bottom: 0.75rem;
}

.order-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text);
    margin-bottom: 0.3rem;
}

.order-field input,
.order-field textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    resize: vertical;
}

.order-field input:focus,
.order-field textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.order-field input::placeholder,
.order-field textarea::placeholder {
    color: #aaa;
}

/* Order Modal Action Buttons */
.order-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-whatsapp {
    background-color: #25D366;
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.btn-whatsapp:hover {
    background-color: #1EBE57;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Language Switcher Styling */
.lang-switch {
    display: inline-flex;
    align-items: center;
    background: rgba(44, 62, 45, 0.08);
    border: 1px solid rgba(44, 62, 45, 0.15);
    border-radius: 30px;
    padding: 3px;
    gap: 2px;
}

.navbar.scrolled .lang-switch {
    background: rgba(44, 62, 45, 0.05);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--color-text);
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 20px;
    transition: var(--transition-smooth);
    font-family: var(--font-body);
    line-height: 1;
}

.lang-btn:hover {
    color: var(--color-accent-hover);
}

.lang-btn.active {
    background: var(--color-text);
    color: var(--color-white);
}



/* Logical spacing for WhatsApp button icon in modal */
.wa-btn-icon {
    vertical-align: middle;
    margin-inline-end: 8px;
}

/* RTL Layout and Typography Overrides */
body[dir="rtl"] {
    --font-heading: 'Noto Sans Arabic', sans-serif;
    --font-body: 'Noto Sans Arabic', sans-serif;
}



body[dir="rtl"] .cart-sidebar {
    right: auto;
    left: -400px;
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    transition: left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

body[dir="rtl"] .cart-sidebar.active {
    left: 0;
    right: auto;
}

body[dir="rtl"] .whatsapp-float {
    left: auto;
    right: 2rem;
}

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

body[dir="rtl"] .whatsapp-tooltip::after {
    right: auto;
    left: 100%;
    border-right-color: transparent;
    border-left-color: #2C3E2D;
}

body[dir="rtl"] .hero-overlay {
    background: linear-gradient(to left, rgba(250, 249, 246, 0.9) 0%, rgba(250, 249, 246, 0.4) 50%, rgba(250, 249, 246, 0.1) 100%);
}


/* =============================================
   AI CHAT WIDGET
   ============================================= */

/* Outer container — anchors everything to bottom-right */
.chat-widget {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

/* ------- Greeting Popover ------- */
.chat-greeting-popover {
    position: absolute;
    bottom: 80px; /* Above the toggle button */
    right: 0;
    width: max-content;
    max-width: 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 16px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transform-origin: bottom right;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.chat-greeting-popover.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chat-greeting-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #f1f1f1;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    transition: background 0.2s ease;
}
.chat-greeting-close:hover {
    background: #e2e2e2;
}

.chat-greeting-msg {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 12px;
    padding-right: 20px; /* space for close btn */
}

.chat-greeting-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.chat-greeting-chip {
    background: transparent;
    border: 1px solid #10b981;
    color: #10b981;
    border-radius: 16px;
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-end;
}
.chat-greeting-chip:hover {
    background: #10b981;
    color: #fff;
}

/* Hide popover when chat is open */
.chat-widget.open .chat-greeting-popover {
    display: none !important;
}

/* ------- Toggle Button ------- */
.chat-toggle-btn {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #D4AF37 0%, #b5952f 100%);
    color: #fff;
    box-shadow:
        0 4px 20px rgba(212, 175, 55, 0.45),
        0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: chat-pulse 2.8s ease-in-out 1s 3;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow:
        0 6px 28px rgba(212, 175, 55, 0.55),
        0 3px 12px rgba(0, 0, 0, 0.2);
}

.chat-toggle-btn:active {
    transform: scale(0.95);
}

@keyframes chat-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(212,175,55,0.45), 0 2px 8px rgba(0,0,0,0.15); }
    50% { box-shadow: 0 4px 32px rgba(212,175,55,0.75), 0 0 0 12px rgba(212,175,55,0.12); }
}

/* Icon switching */
.chat-toggle-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.chat-icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.7);
}

.chat-icon-chat {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.chat-widget.open .chat-icon-chat {
    opacity: 0;
    transform: rotate(90deg) scale(0.7);
}

.chat-widget.open .chat-icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Unread badge */
.chat-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FAF9F6;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
    animation: badge-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 1.2s both;
}

.chat-badge.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

@keyframes badge-pop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* ------- Chat Window ------- */
.chat-window {
    width: 360px;
    max-height: 0;
    overflow: hidden;
    border-radius: 18px;
    background: #ffffff;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.18),
        0 8px 24px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    transform-origin: bottom right;
    transition:
        max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.3s ease,
        transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.chat-widget.open .chat-window {
    max-height: 540px;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ------- Header ------- */
.chat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.125rem;
    background: linear-gradient(135deg, #2C3E2D 0%, #3d5c3e 100%);
    border-radius: 18px 18px 0 0;
    flex-shrink: 0;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    border: 2px solid rgba(212,175,55,0.6);
}

.chat-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.chat-name {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffffff;
    letter-spacing: 0.2px;
}

.chat-status {
    font-family: var(--font-body);
    font-size: 0.72rem;
    color: #a8ddb5;
    letter-spacing: 0.3px;
}

.chat-close-btn {
    background: rgba(255,255,255,0.12);
    border: none;
    color: rgba(255,255,255,0.85);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.chat-close-btn:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* ------- Message Thread ------- */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-height: 260px;
    max-height: 320px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(44,62,45,0.18);
    border-radius: 99px;
}

/* Message row wrappers */
.chat-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
    animation: msg-slide-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.chat-msg-row.user-row {
    flex-direction: row-reverse;
}

@keyframes msg-slide-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Bubbles */
.chat-bubble {
    max-width: 82%;
    padding: 0.65rem 0.9rem;
    border-radius: 16px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.bot-bubble {
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.user-bubble {
    background: linear-gradient(135deg, #D4AF37 0%, #c9a22d 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    text-align: left;
}

/* Tiny avatar dot for bot */
.bot-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2C3E2D;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
    align-self: flex-end;
}

/* ------- Typing Indicator ------- */
.chat-typing {
    padding: 0 1rem 0.5rem;
    display: none;
}

.chat-typing.visible {
    display: block;
    animation: msg-slide-in 0.25s ease both;
}

.typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem 0.9rem;
}

.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40%            { transform: translateY(-6px); opacity: 1; }
}

/* ------- Input Area ------- */
.chat-input-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.875rem;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    background: #ffffff;
}

.chat-input {
    flex: 1;
    border: 1.5px solid #e5e7eb;
    border-radius: 24px;
    padding: 0.55rem 1rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text);
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.12);
    background: #ffffff;
}

.chat-input::placeholder {
    color: #9ca3af;
}

.chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #D4AF37 0%, #b5952f 100%);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(212,175,55,0.3);
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 14px rgba(212,175,55,0.45);
}

.chat-send-btn:active {
    transform: scale(0.93);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

/* ------- Footer / WhatsApp CTA ------- */
.chat-footer {
    padding: 0.6rem 0.875rem 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
    border-radius: 0 0 18px 18px;
    flex-shrink: 0;
}

.chat-human-tip {
    font-size: 0.68rem;
    color: #6b7280;
    text-align: center;
    font-family: var(--font-body);
}

.chat-whatsapp-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-body);
    font-size: 0.76rem;
    font-weight: 500;
    color: #25D366;
    text-decoration: none;
    padding: 0.35rem 0.875rem;
    border-radius: 20px;
    border: 1.5px solid rgba(37,211,102,0.3);
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    letter-spacing: 0.2px;
}

.chat-whatsapp-cta:hover {
    background: rgba(37,211,102,0.12);
    border-color: rgba(37,211,102,0.55);
    transform: translateY(-1px);
}

.chat-whatsapp-cta svg {
    flex-shrink: 0;
}

/* ------- Quick Reply Chips ------- */
.chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0 1rem 0.5rem;
}

.chat-chip {
    font-family: var(--font-body);
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    border: 1.5px solid var(--color-accent);
    background: rgba(212,175,55,0.07);
    color: var(--color-accent-hover);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
    animation: msg-slide-in 0.3s ease both;
}

.chat-chip:hover {
    background: var(--color-accent);
    color: #fff;
    transform: translateY(-1px);
}

/* ------- RTL Adjustments ------- */
body[dir="rtl"] .chat-widget {
    right: auto;
    left: 1.75rem;
    align-items: flex-start;
}

body[dir="rtl"] .chat-greeting-popover {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}
body[dir="rtl"] .chat-greeting-close {
    right: auto;
    left: 8px;
}
body[dir="rtl"] .chat-greeting-msg {
    padding-right: 0;
    padding-left: 20px;
}
body[dir="rtl"] .chat-greeting-options {
    align-items: flex-start;
}
body[dir="rtl"] .chat-greeting-chip {
    align-self: flex-start;
}

body[dir="rtl"] .user-row {
    flex-direction: row;
}

body[dir="rtl"] .user-bubble {
    border-bottom-right-radius: 16px;
    border-bottom-left-radius: 4px;
}

body[dir="rtl"] .bot-bubble {
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 4px;
}

/* ------- Mobile ------- */
@media (max-width: 480px) {
    .chat-widget {
        bottom: 1rem;
        right: 1rem;
    }

    .chat-window {
        width: calc(100vw - 2rem);
        max-width: 360px;
    }

    .chat-widget.open .chat-window {
        max-height: 480px;
    }

    .chat-messages {
        max-height: 280px;
    }
}

/* ------- API Key Setup Bubble ------- */
.chat-setup-bubble {
    max-width: 96% !important;
    width: 100%;
    box-sizing: border-box;
}

#chat-key-input:focus {
    border-color: var(--color-accent) !important;
    box-shadow: 0 0 0 2px rgba(212,175,55,0.15);
}

#chat-key-save:hover {
    opacity: 0.88;
}

/* ===================================
   AI Search Section
   =================================== */
.ai-search-section {
    background: #f0ece3;
    border-top: 1px solid rgba(44, 62, 45, 0.08);
    border-bottom: 1px solid rgba(44, 62, 45, 0.08);
    padding: 48px 24px;
}

.ai-search-inner {
    max-width: 760px;
    margin: 0 auto;
}

.ai-search-badge {
    display: inline-flex;
    align-items: center;
    color: #8B6914;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 5px 12px;
    border-radius: 20px;
}

.ai-search-form {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.ai-search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.ai-search-icon {
    position: absolute;
    left: 16px;
    color: var(--color-text-light);
    pointer-events: none;
}

.ai-search-input {
    width: 100%;
    background: #fff;
    border: 1.5px solid rgba(44, 62, 45, 0.2);
    border-radius: 10px;
    padding: 14px 44px 14px 48px;
    color: var(--color-text);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.ai-search-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.ai-search-input::placeholder {
    color: #9aaa9b;
}

.ai-search-clear {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
}

.ai-search-clear:hover {
    color: var(--color-text);
}

.ai-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-text);
    color: var(--color-accent);
    border: none;
    border-radius: 10px;
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(44, 62, 45, 0.2);
}

.ai-search-btn:hover:not(:disabled) {
    background: #1a2b1b;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(44, 62, 45, 0.3);
}

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

.ai-search-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    color: var(--color-text-light);
    font-size: 0.9rem;
    font-family: var(--font-body);
}

.ai-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(44, 62, 45, 0.15);
    border-top-color: var(--color-text);
    border-radius: 50%;
    animation: ai-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes ai-spin {
    to { transform: rotate(360deg); }
}

.ai-search-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(220, 38, 38, 0.07);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 10px;
    color: #b91c1c;
    font-size: 0.9rem;
    font-family: var(--font-body);
}

.ai-search-result {
    margin-top: 20px;
    background: #fff;
    border: 1.5px solid rgba(212, 175, 55, 0.35);
    border-radius: 14px;
    overflow: hidden;
    animation: ai-fade-up 0.3s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

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

.ai-search-result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(212, 175, 55, 0.08);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    color: #8B6914;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: var(--font-body);
}

.ai-search-result-body {
    padding: 18px 20px;
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.75;
    font-family: var(--font-body);
}

.ai-search-result-body p {
    margin: 4px 0;
}

.ai-search-result-body p:empty {
    display: none;
}

@media (max-width: 600px) {
    .ai-search-form {
        flex-direction: column;
    }
    .ai-search-btn {
        justify-content: center;
    }
}

/* --- Store Layout (Sidebar + Main) --- */
.store-layout {
    display: flex;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: flex-start;
}

.store-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.store-main {
    flex-grow: 1;
    min-width: 0;
}

.store-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.mobile-filter-btn {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
}

.store-sort {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.store-sort label {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.sort-select {
    padding: 0.5rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    background: #fff;
    color: var(--color-text);
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
    max-width: 100%;
}

/* --- Filter Groups --- */
.filter-group {
    margin-bottom: 2rem;
}

.filter-group h4 {
    margin-bottom: 1rem;
    font-size: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 0.5rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text-light);
    cursor: pointer;
}

.checkbox-label input {
    accent-color: var(--color-accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.price-inputs input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.9rem;
}

.filter-apply-btn {
    width: 100%;
    padding: 0.5rem;
}

.filter-header-mobile {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

/* Responsive adjustments for Store Layout */
@media (max-width: 900px) {
    .store-layout {
        flex-direction: column;
    }

    .store-sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100vh;
        z-index: 999;
        background: #fff;
        overflow-y: auto;
        border-radius: 0;
        transition: left 0.3s ease;
    }

    .store-sidebar.open {
        left: 0;
    }

    .filter-overlay.open {
        display: block;
    }

    .filter-header-mobile {
        display: flex;
    }

    .mobile-filter-btn {
        display: flex;
    }

    .store-sort {
        margin-left: 0;
    }
}

/* --- FAQ Section --- */
.faq-section {
    padding: 6rem 5%;
    background: var(--color-bg);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text);
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.faq-question:hover {
    color: var(--color-accent);
}

.faq-toggle-icon {
    font-size: 1.5rem;
    color: var(--color-accent);
    transition: transform 0.3s ease;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    color: var(--color-text-light);
    line-height: 1.6;
    padding-right: 2rem;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    margin-top: 1rem;
}

.faq-item.active .faq-toggle-icon {
    transform: rotate(45deg);
}
