:root {
    --primary: #6366f1; 
    --primary-hover: #4f46e5;
    --secondary: #ec4899; 
    --bg-base: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.7);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-light: rgba(255, 255, 255, 0.5);
    --shadow-soft: 0 10px 40px -10px rgba(0,0,0,0.08);
    --shadow-hover: 0 20px 40px -10px rgba(99,102,241,0.15);
    --radius-lg: 24px;
    --radius-md: 16px;
    --transition-fluid: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-base: #0f172a; --bg-surface: rgba(30, 41, 59, 0.7);
        --text-main: #f8fafc; --text-muted: #94a3b8;
        --border-light: rgba(255, 255, 255, 0.1);
        --shadow-soft: 0 10px 40px -10px rgba(0,0,0,0.5);
    }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background-color: var(--bg-base); color: var(--text-main); transition: font-family 0.3s ease; overflow-x: hidden; }
body.lang-en { font-family: 'Plus Jakarta Sans', sans-serif; }
body.lang-ar { font-family: 'Cairo', sans-serif; }
.container { max-width: 1300px; margin: 0 auto; padding: 0 2rem; }

/* Utilities */
.hidden { display: none !important; opacity: 0; pointer-events: none; }
.fade-in { animation: fadeIn 0.6s var(--transition-fluid) forwards; }
.slide-up { animation: slideUp 0.8s var(--transition-fluid) forwards; }
.glass { background: var(--bg-surface); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--border-light); z-index: 100; position: relative;}
.bento-card { background: var(--bg-surface); border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow-soft); border: 1px solid var(--border-light); backdrop-filter: blur(10px); }
.badge { background: var(--text-main); color: var(--bg-base); padding: 0.25rem 0.75rem; border-radius: 99px; font-size: 0.75rem; font-weight: 700; }
.badge.secondary { background: var(--secondary); color: white; }
.badge.success { background: #10b981; color: white; }
.gradient-text { background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.text-sm { font-size: 0.85rem; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); } 70% { box-shadow: 0 0 0 15px rgba(99, 102, 241, 0); } 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); } }
.pulse-anim { animation: pulse 2s infinite; }

/* Buttons & Inputs */
button { font-family: inherit; cursor: pointer; border: none; background: none; outline: none; transition: var(--transition-fluid); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; padding: 0.75rem 1.5rem; border-radius: var(--radius-md); font-weight: 700; box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3); display: inline-flex; align-items: center; justify-content: center;}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4); }
.btn-large { padding: 1rem 2.5rem; font-size: 1.1rem; border-radius: 99px; }
.btn-block { width: 100%; }
.btn-outline { border: 2px solid var(--text-main); color: var(--text-main); padding: 0.5rem 1.25rem; border-radius: 99px; font-weight: 600; }
.btn-outline:hover { background: var(--text-main); color: var(--bg-base); }
.btn-text { color: var(--primary); font-weight: 700; text-decoration: none; }
.btn-text-small { color: var(--text-muted); font-weight: 600; font-size: 0.85rem;}
.btn-text-small:hover { color: var(--primary); }
.clean-select { background: transparent; border: none; color: var(--text-muted); font-family: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; outline: none;}

/* --- Top Bar & Header Navigation --- */
.top-bar-micro { padding: 0.5rem 0; border-bottom: 1px solid var(--border-light); font-size: 0.85rem; }
.micro-bar-content { display: flex; justify-content: space-between; align-items: center; }
.social-links-mini { display: flex; gap: 1rem; color: var(--text-muted); }
.social-links-mini a { color: inherit; transition: var(--transition-fluid); }
.social-links-mini a:hover { color: var(--primary); transform: translateY(-2px);}
.promo-text { font-weight: 600; color: var(--text-main); }
.lang-currency { display: flex; gap: 1rem; align-items: center; }

.site-header { position: sticky; top: 0; padding: 1rem 0; }
.header-main { display: flex; justify-content: space-between; align-items: center; }
.branding { display: flex; align-items: center; gap: 0.5rem; font-size: 1.5rem; font-weight: 800; cursor: pointer; }

/* Main Nav */
.main-nav { display: none; } /* Hidden on mobile by default */
@media (min-width: 900px) {
    .main-nav { display: block; flex: 1; margin: 0 3rem; }
    .nav-list { list-style: none; display: flex; gap: 2rem; justify-content: center; margin: 0; padding: 0; }
    .nav-item { position: relative; }
    .nav-item > a { text-decoration: none; color: var(--text-main); font-weight: 600; display: flex; align-items: center; gap: 0.25rem; padding: 0.5rem 0; transition: color 0.2s;}
    .nav-item > a:hover { color: var(--primary); }
    
    /* Mega Menu Dropdown */
    .mega-menu { position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; visibility: hidden; transition: var(--transition-fluid); width: max-content; display: flex; gap: 3rem; padding: 2rem; border-radius: var(--radius-md); }
    .nav-item.has-dropdown:hover .mega-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(10px); }
    .mega-column h4 { margin-bottom: 1rem; color: var(--primary); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px;}
    .mega-column a { display: block; text-decoration: none; color: var(--text-muted); margin-bottom: 0.75rem; font-weight: 500; transition: color 0.2s; }
    .mega-column a:hover { color: var(--text-main); }
}

/* --- Hero Mesh --- */
.hero-mesh { height: 60vh; min-height: 450px; display: flex; align-items: center; justify-content: center; text-align: center; background-color: #ff9a9e; background-image: radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%); border-radius: 0 0 var(--radius-lg) var(--radius-lg); color: white; margin-bottom: 4rem; padding: 0 2rem; }
.hero-content { max-width: 700px; }
.display-title { font-size: clamp(3rem, 6vw, 5rem); font-weight: 800; line-height: 1.1; margin-bottom: 1.5rem; letter-spacing: -0.03em; }
.hero-content p { font-size: 1.25rem; margin-bottom: 2.5rem; opacity: 0.9; }

/* --- Categories Carousel --- */
.categories-section { margin-bottom: 5rem; }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2rem; }
.section-header h2 { font-size: 2rem; font-weight: 800; }
.category-carousel .slide-wrap { padding: 1rem; }
.cat-card { padding: 2rem 1rem; text-align: center; cursor: pointer; transition: var(--transition-fluid); display: flex; flex-direction: column; align-items: center; gap: 1rem; border-radius: var(--radius-md);}
.cat-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-hover); border-color: rgba(99,102,241,0.3);}
.cat-icon { font-size: 3rem; background: rgba(99,102,241,0.1); width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 0.5rem;}
.cat-card h3 { font-size: 1.1rem; font-weight: 700; }

/* --- Layout & Filters --- */
.layout-grid { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; margin-bottom: 6rem; align-items: start;}
.filter-group { margin-bottom: 2rem; }
.filter-group h4 { margin-bottom: 1rem; font-size: 1.1rem; }
.custom-checkboxes label { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.8rem; cursor: pointer; color: var(--text-muted); transition: var(--transition-fluid); }
.custom-checkboxes label:hover { color: var(--text-main); }
.custom-checkboxes input { display: none; }
.cb-box { width: 20px; height: 20px; border: 2px solid var(--text-muted); border-radius: 6px; display: inline-block; position: relative; transition: var(--transition-fluid); }
.custom-checkboxes input:checked + .cb-box { background: var(--primary); border-color: var(--primary); }
.custom-checkboxes input:checked + .cb-box::after { content: ''; position: absolute; left: 5px; top: 2px; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.modern-range { -webkit-appearance: none; width: 100%; height: 6px; background: rgba(128,128,128,0.2); border-radius: 99px; outline: none; margin-top: 1rem; }
.modern-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--primary); cursor: pointer; transition: transform 0.2s; box-shadow: 0 2px 10px rgba(99,102,241,0.5); }
.modern-range::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* --- Product Grid --- */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.glass-pill { background: var(--bg-surface); padding: 0.75rem 1.5rem; border-radius: 99px; backdrop-filter: blur(10px); box-shadow: var(--shadow-soft); border: 1px solid var(--border-light); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2rem; }

.product-card { background: var(--bg-surface); border-radius: var(--radius-md); padding: 1.5rem; text-align: center; border: 1px solid var(--border-light); transition: var(--transition-fluid); display: flex; flex-direction: column; gap: 1rem; }
.product-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-hover); border-color: rgba(99, 102, 241, 0.3); }
.img-placeholder { width: 100%; aspect-ratio: 4/3; background: rgba(128,128,128,0.1); border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden;}
.img-placeholder img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.product-card:hover .img-placeholder img { transform: scale(1.05); }
.product-card h3 { font-size: 1.2rem; font-weight: 700; }
.product-card .price { font-size: 1.5rem; font-weight: 800; color: var(--text-main); }
.product-actions { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.compare-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text-muted); cursor: pointer; }

/* --- Client Area & Auth --- */
.client-area-section { padding: 4rem 0; min-height: 70vh; display: flex; justify-content: center; }
.auth-container { width: 100%; max-width: 450px; }
.auth-card h2 { margin-bottom: 2rem; text-align: center; font-size: 2rem; }
.auth-toggle-text { text-align: center; margin-top: 2rem; color: var(--text-muted); }
.auth-toggle-text a { color: var(--primary); text-decoration: none; font-weight: 700; }
.modern-input { position: relative; margin-bottom: 2rem; }
.modern-input input { width: 100%; padding: 1rem; background: rgba(128,128,128,0.05); border: 2px solid transparent; border-radius: 12px; color: var(--text-main); font-family: inherit; font-size: 1rem; transition: var(--transition-fluid); }
.modern-input input:focus { border-color: var(--primary); outline: none; background: transparent; }
.modern-input label { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); transition: var(--transition-fluid); pointer-events: none; }
.modern-input input:focus ~ label, .modern-input input:not(:placeholder-shown) ~ label { top: -0.5rem; left: 0.5rem; font-size: 0.8rem; font-weight: 700; color: var(--primary); background: var(--bg-base); padding: 0 0.5rem; border-radius: 4px; }

.dashboard-container { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; width: 100%; align-items: start;}
.user-avatar-placeholder { width: 80px; height: 80px; background: linear-gradient(135deg, var(--primary), var(--secondary)); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; margin-bottom: 1rem; }
.dashboard-nav { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 2rem; }
.dashboard-nav a { text-decoration: none; color: var(--text-muted); padding: 0.75rem 1rem; border-radius: 12px; font-weight: 600; transition: var(--transition-fluid); }
.dashboard-nav a:hover, .dashboard-nav a.active { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.order-header { display: flex; justify-content: space-between; margin-bottom: 1rem; }

/* --- Multi-Column Footer --- */
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 3rem; margin-bottom: 3rem; }
.brand-col p { color: var(--text-muted); margin: 1.5rem 0; line-height: 1.6; }
.footer-col h4 { font-size: 1.2rem; margin-bottom: 1.5rem; color: var(--text-main); font-weight: 800;}
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 0.75rem; }
.footer-col ul li a { text-decoration: none; color: var(--text-muted); transition: color 0.2s; font-weight: 500;}
.footer-col ul li a:hover { color: var(--primary); }
.social-links { display: flex; gap: 1rem; }
.social-icon { width: 40px; height: 40px; border-radius: 50%; background: rgba(128,128,128,0.1); display: flex; align-items: center; justify-content: center; color: var(--text-main); transition: var(--transition-fluid); }
.social-icon:hover { background: var(--primary); color: white; transform: translateY(-3px); }
.newsletter-col p { color: var(--text-muted); margin-bottom: 1rem; }
.newsletter-input { display: flex; gap: 0.5rem; }
.newsletter-input input { flex: 1; padding: 0.75rem 1rem; border-radius: var(--radius-md); border: 1px solid var(--border-light); background: rgba(128,128,128,0.05); color: var(--text-main); outline: none; }
.footer-bottom { border-top: 1px solid var(--border-light); padding-top: 2rem; display: flex; justify-content: space-between; color: var(--text-muted); font-size: 0.9rem; }
.legal-links a { color: inherit; text-decoration: none; margin-left: 1.5rem; }
.legal-links a:hover { color: var(--primary); }

/* --- Compare Drawer --- */
.compare-drawer { position: fixed; bottom: 0; left: 0; width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; z-index: 9999; transform: translateY(100%); transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); max-height: 85vh; display: flex; flex-direction: column; border-bottom: none;}
.compare-drawer.active { transform: translateY(0); }
.drawer-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 2rem; border-bottom: 1px solid var(--border-light); }
.btn-close { font-size: 2.5rem; line-height: 1; color: var(--text-muted); }
.btn-close:hover { color: var(--secondary); transform: rotate(90deg); }
.drawer-body { padding: 2rem; overflow-y: auto; }
.compare-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 800px; }
.compare-table th, .compare-table td { padding: 1.5rem; text-align: center; border-bottom: 1px solid var(--border-light); }
.compare-table th:first-child { text-align: left; font-weight: 800; color: var(--text-muted); }
html[dir="rtl"] .compare-table th:first-child { text-align: right; }
.btn-remove-compare { color: var(--secondary); font-size: 0.85rem; font-weight: 700; cursor: pointer; margin-top: 1rem; display: inline-block; }

/* --- FAB --- */
.fab { position: fixed; bottom: 2rem; right: 2rem; width: 56px; height: 56px; border-radius: 50%; background: var(--text-main); color: var(--bg-base); display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 25px rgba(0,0,0,0.2); z-index: 9000; transition: var(--transition-fluid); opacity: 1; transform: translateY(0) scale(1); }
.fab:hover { transform: translateY(-5px) scale(1.05); }
.fab.hidden { opacity: 0; transform: translateY(20px) scale(0.8); pointer-events: none; }
html[dir="rtl"] .fab { right: auto; left: 2rem; }

/* Responsive adjustments */
@media (max-width: 900px) {
    .layout-grid, .dashboard-container { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .promo-text { display: none; }
}
@media (max-width: 600px) {
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}
/* =========================================
   BUG FIXES: CAROUSEL & RTL GRID ALIGNMENT
   ========================================= */

/* 1. Prevent Grid Blowout */
.layout-grid { min-width: 0; }
.product-display { min-width: 0; width: 100%; }

/* 2. Modern 2026 Carousel Dots (Hides the 1,2,3 numbers) */
.slick-dots { 
    display: flex !important; 
    justify-content: center; 
    align-items: center; 
    list-style: none; 
    padding: 0; 
    margin-top: 3rem; 
    gap: 12px; 
    width: 100%; 
}
.slick-dots li { margin: 0; width: auto; height: auto; }
.slick-dots button { 
    font-size: 0; 
    line-height: 0; 
    width: 12px; 
    height: 12px; 
    padding: 0; 
    cursor: pointer; 
    color: transparent; 
    border: none; 
    outline: none; 
    background: var(--border-light); 
    border-radius: 50%; 
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
/* Active Dot Glow */
.slick-dots li.slick-active button { 
    background: var(--primary); 
    transform: scale(1.5); 
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}
/* Force hide default slick pseudo-elements */
.slick-dots li button:before { display: none !important; }

/* 3. Fix FAB button overlap in Arabic Mode */
html[dir="rtl"] .fab { 
    right: auto; 
    left: 2rem; 
    bottom: 6rem; /* Pushes it up so it doesn't hide behind the compare drawer */
}