:root {
    /* Light Mode Tokens */
    --bg: #F6FAFF;
    --surface: #FFFFFF;
    --text: #0B1630;
    --primary: #004a99; 
    --primary-light: #4CC9F0;
    --border: #D8E7FF;
    --card-shadow: 0 10px 30px rgba(27, 102, 255, 0.08);
    --radius: 12px;
    
    /* Global Elements */
    --wa-green: #25D366;
    
    /* Logo Specific Light Mode */
    --logo-title: #004a99;
    --logo-subtitle: #333333;

    /* Form Specifics */
    --input-bg: #e8f0fe;
    --input-text: #333333;
}

[data-theme="dark"] {
    /* Dark Mode Tokens */
    --bg: #0B1224;
    --surface: #161F33;
    --text: #F6FAFF;
    --primary: #4D8BFF;
    --border: #2D3A56;

    /* Logo Specific Dark Mode */
    --logo-title: #FFFFFF;
    --logo-subtitle: #A0AEC0;

    /* Form Specifics */
    --input-bg: #1D2D50;
    --input-text: #FFFFFF;
}

/* --- Component Loading Fix --- */
.component-hidden {
    display: none !important;
}

/* Specific Fix for Header Nav Links in Dark Mode (English & Arabic) */
[data-theme="dark"] .nav-link,
[data-theme="dark"] .nav-item .nav-link,
[data-theme="dark"] .nav-links a {
    color: #F6FAFF !important;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    color: var(--primary-light) !important;
    background: rgba(255, 255, 255, 0.05);
}

/* Specific Overrides for Arabic Dark Mode Contrast */
[dir="rtl"][data-theme="dark"] .policy-section,
[dir="rtl"][data-theme="dark"] .complaint-form-container,
[dir="rtl"][data-theme="dark"] .pdf-viewer-container {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
}

[dir="rtl"][data-theme="dark"] .policy-section h3 {
    background: rgba(77, 139, 255, 0.1) !important;
    color: var(--primary-light) !important;
    border-right: 4px solid var(--primary-light) !important;
}

[dir="rtl"][data-theme="dark"] .form-group label {
    color: var(--text) !important;
}

[dir="rtl"][data-theme="dark"] .policy-section p,
[dir="rtl"][data-theme="dark"] .policy-section li {
    color: var(--text) !important;
    opacity: 0.9;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    background-color: var(--bg); 
    color: var(--text); 
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    transition: background 0.3s, color 0.3s;
    line-height: 1.6;
    overflow-x: hidden;
}

.container { width: 92%; max-width: 1280px; margin: auto; }

/* --- Preloader (Site Loading Animation) --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--surface);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loader-logo {
    height: 80px;
    width: auto;
    animation: logoEntrance 1s ease-out forwards, logoPulse 2s infinite ease-in-out 1s;
}

.loader-line {
    width: 120px;
    height: 3px;
    background: var(--border);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.loader-line::after {
    content: '';
    position: absolute;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary);
    animation: loadingBar 1.5s infinite linear;
}

.preloader-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* --- Header & Navigation --- */
.main-header { 
    background: var(--surface); 
    padding: 12px 0; 
    border-bottom: 1px solid var(--border);
    position: sticky; 
    top: 0; 
    z-index: 1000;
    transition: background 0.3s, border 0.3s;
    height: 80px; 
}

#header-placeholder {
    min-height: 80px;
    width: 100%;
    background: var(--surface);
}

#footer-placeholder {
    min-height: 450px; 
    width: 100%;
}

.nav-wrapper { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    gap: 15px; 
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.4 !important;
}

.brand-text span {
    font-size: 1.1rem !important; 
    white-space: nowrap;
}

.brand-text span:first-child {
    color: var(--logo-subtitle) !important;
    transition: color 0.3s ease;
    font-weight: 700;
}

.brand-text span:last-child {
    color: var(--logo-subtitle) !important;
    transition: color 0.3s ease;
    font-weight: 600;
    margin-top: 0 !important; 
}

[data-theme="dark"] .logo img {
    filter: brightness(1.2);
}

.desktop-nav {
    flex-grow: 1; 
    display: flex;
    justify-content: center;
}

.nav-links { 
    display: flex; 
    list-style: none; 
    gap: 2px; 
    align-items: center;
}

.nav-item { 
    position: relative; 
    padding: 10px 0; 
    display: inline-block;
}

/* --- Fixed Font Sizes for Header Consistency --- */
.nav-link { 
    text-decoration: none; 
    color: var(--text); 
    font-weight: 600; 
    font-size: 0.95rem !important; 
    padding: 8px 12px; 
    border-radius: 8px;
    transition: all 0.3s ease; 
    white-space: nowrap; 
}

.nav-link:hover, .nav-link.active { 
    color: var(--primary); 
    background: rgba(27, 102, 255, 0.08);
}

.arrow { font-size: 0.65rem; margin-left: 2px; display: inline-block; transition: transform 0.3s; }

/* --- Submenu --- */
.submenu {
    position: absolute;
    top: 100%;
    left: 0; 
    width: 230px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px); 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100;
    backdrop-filter: blur(12px);
}

.has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.has-submenu:hover .arrow { transform: rotate(180deg); }

.submenu a, .submenu-btn {
    display: block; width: 100%; padding: 10px 15px; text-align: left;
    text-decoration: none; color: var(--text); background: transparent;
    border: none; border-radius: 8px; font-family: inherit; font-size: 0.9rem !important;
    cursor: pointer; transition: 0.2s;
}

.submenu a:hover, .submenu-btn:hover { background: var(--primary); color: white !important; }

/* --- Hero Section --- */
.hero {
    padding: 100px 0 80px; 
    text-align: center;
    background: linear-gradient(to bottom, var(--surface), var(--bg));
}
.hero h1 { font-size: 2.8rem; margin-bottom: 20px; font-weight: 800; line-height: 1.2; }
.hero h1 span { color: var(--primary); }
.hero-subtitle { font-size: 1.2rem; opacity: 0.9; margin-bottom: 30px; }

.hero-welcome-box {
    max-width: 850px;
    margin: 0 auto 40px auto;
    background: var(--surface);
    padding: 35px;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
}

.hero-welcome-box h2 {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.btn-primary, .btn-secondary { padding: 14px 30px; border-radius: 8px; font-weight: 700; cursor: pointer; transition: 0.3s; font-size: 1rem; }
.btn-primary { background: var(--primary); color: white; border: none; margin: 0 5px; }
.btn-secondary { background: transparent; color: var(--primary); border: 2px solid var(--primary); margin: 0 5px; }

/* --- Infinite Product Slider --- */
.product-slideshow-container { padding: 80px 0; background: var(--bg); overflow: hidden; }
.section-title { text-align: center; margin-bottom: 40px; color: var(--text); font-size: 2.2rem; font-weight: 800; }

.infinite-slider { 
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s ease-out, opacity 0.3s ease;
    opacity: 0;
    overflow: hidden;
}

.infinite-slider.active { 
    grid-template-rows: 1fr;
    opacity: 1;
}

.infinite-track-wrapper { min-height: 0; }
.infinite-track { 
    display: flex; 
    width: max-content; 
    gap: 30px; 
    padding: 20px 0;
    animation: scrollSlides 40s linear infinite; 
}
.infinite-track:hover { animation-play-state: paused; }

@keyframes scrollSlides {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-330px * 5)); } 
}

/* Core Product Card Styling */
.product-card {
    position: relative;
    min-width: 300px;
    height: 380px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-shadow: var(--card-shadow);
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
    overflow: hidden;
}

.product-card:hover { transform: translateY(-5px); border-color: var(--primary); }

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
}

.product-card:hover .product-overlay { opacity: 1; transform: translateY(0); }
.product-overlay h4 { font-size: 1.5rem; margin-bottom: 10px; color: #FFFFFF; }
.product-overlay .tags { font-size: 0.85rem; font-weight: 700; margin-bottom: 15px; color: #D8E7FF; }
.product-overlay p { font-size: 0.95rem; line-height: 1.6; color: rgba(255, 255, 255, 0.9); }

.product-icon-large { font-size: 5.5rem; margin-bottom: 20px; filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1)); }
.product-card h3 { font-size: 1.5rem; color: var(--primary); margin-bottom: 12px; font-weight: 700; }

/* --- Tabs --- */
.tabs-header { 
    margin-bottom: 40px; display: inline-flex; background: var(--surface); 
    padding: 5px; border-radius: 50px; border: 1px solid var(--border); 
}

.tab-btn { 
    border: 2px solid transparent; padding: 12px 35px; border-radius: 50px; cursor: pointer; 
    background: transparent; color: var(--text); font-weight: 700; transition: 0.3s; 
    font-size: 1rem;
}
.tab-btn.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 15px rgba(0, 74, 153, 0.3); }

/* --- Main Footer --- */
.main-footer {
    background: var(--surface);
    color: var(--text);
    padding: 60px 0 20px;
    margin-top: 0;
    border-top: 1px solid var(--border);
    transition: background 0.3s, color 0.3s;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 30px;
    margin-bottom: 40px;
}

.footer-contact-info { display: flex; flex-direction: column; gap: 10px; }
.info-item { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.info-item a { color: var(--text); text-decoration: none; transition: 0.3s; }
.info-item a:hover { color: var(--primary); }

.footer-brand { display: flex; align-items: center; gap: 15px; }
.footer-logo { height: 50px; transition: filter 0.3s; }
[data-theme="dark"] .footer-logo { filter: brightness(1.2); }

.footer-brand-text { 
    display: flex; 
    flex-direction: column; 
    line-height: 1.4 !important; 
    text-align: left; 
}
.footer-brand-text .ar { 
    font-weight: 700; 
    font-size: 1.1rem !important; 
    color: var(--logo-title); 
}
.footer-brand-text .en { 
    font-size: 1.1rem !important; 
    color: var(--logo-subtitle); 
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 { font-size: 1.2rem; margin-bottom: 20px; color: var(--primary); }
.footer-column ul { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.footer-column ul li a { 
    color: var(--text); text-decoration: none; opacity: 0.8; transition: 0.3s; font-size: 0.95rem;
}
.footer-column ul li a:hover { opacity: 1; color: var(--primary); padding-left: 5px; }

/* Social Links */
.social-links { display: flex; gap: 15px; }
.social-icon {
    width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    border-radius: 6px; color: white; text-decoration: none; font-weight: bold; transition: 0.3s;
}
.social-icon.x { background: #000000; }
.social-icon.ig { background: #E4405F; }
.social-icon.fb { background: #1877F2; }
.social-icon.wa { background: var(--wa-green); }
.social-icon:hover { transform: translateY(-3px); filter: brightness(1.1); }

/* Newsletter Form */
.newsletter-form { display: flex; flex-direction: column; gap: 12px; }
.newsletter-form input {
    padding: 14px 15px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); width: 100%; outline: none;
}
.btn-submit {
    background: var(--primary); color: white; border: none; padding: 12px 25px;
    font-weight: 700; border-radius: 6px; cursor: pointer; width: fit-content; transition: 0.3s;
}
.btn-submit:hover { opacity: 0.9; transform: scale(1.02); }

.footer-bottom {
    text-align: center; padding-top: 20px; border-top: 1px solid var(--border);
    font-size: 0.85rem; opacity: 0.7;
}

/* --- WhatsApp Chatbot --- */
.whatsapp-chatbot {
    position: fixed; bottom: 30px; right: 30px; z-index: 2000;
    display: flex; align-items: center; gap: 12px; text-decoration: none;
}
.whatsapp-chatbot img {
    width: 60px; height: 60px; filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2)); transition: 0.3s;
}
.chat-bubble {
    background: var(--surface); color: var(--text); padding: 10px 18px; border-radius: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1); font-size: 0.9rem; font-weight: 600;
    opacity: 0; transform: translateX(15px); transition: 0.3s; white-space: nowrap;
    border: 1px solid var(--border);
}
.whatsapp-chatbot:hover .chat-bubble { opacity: 1; transform: translateX(0); }
.whatsapp-chatbot:hover img { transform: scale(1.1) rotate(5deg); }

/* --- Controls --- */
.header-controls { display: flex; align-items: center; gap: 8px; }
.control-btn { 
    background: transparent; border: 1px solid var(--border); width: 40px; height: 40px;
    border-radius: 50%; cursor: pointer; color: var(--text); transition: 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.control-btn:hover { background: var(--bg); border-color: var(--primary); }

.lang-btn { 
    text-decoration: none; color: var(--primary); font-weight: 700; border: 1px solid var(--primary);
    padding: 7px 18px; border-radius: 20px; font-size: 0.9rem; transition: 0.2s;
}
.lang-btn:hover { background: var(--primary); color: white; }

/* --- RTL Adjustments --- */
[dir="rtl"] .nav-wrapper {
    justify-content: flex-start !important;
}

[dir="rtl"] .header-controls {
    margin-right: auto !important; 
    margin-left: 0 !important;
}

[dir="rtl"] .submenu { 
    left: auto; 
    right: 0; 
    transform: translateY(10px); 
}

[dir="rtl"] .submenu a, [dir="rtl"] .submenu-btn { text-align: right; }
[dir="rtl"] .arrow { margin-left: 0; margin-right: 4px; }
[dir="rtl"] .product-overlay { text-align: right; }
[dir="rtl"] .footer-brand-text { text-align: right; }
[dir="rtl"] .footer-column ul li a:hover { padding-left: 0; padding-right: 5px; }

[dir="rtl"] .whatsapp-chatbot { right: auto; left: 30px; flex-direction: row-reverse; }
[dir="rtl"] .chat-bubble { transform: translateX(-15px); }
[dir="rtl"] .whatsapp-chatbot:hover .chat-bubble { transform: translateX(0); }

[dir="rtl"] .infinite-track { animation: scrollSlidesRTL 40s linear infinite; }

@keyframes scrollSlidesRTL {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(330px * 5)); }
}

/* --- Animations --- */
@keyframes logoEntrance {
    from { opacity: 0; transform: scale(0.8); filter: blur(10px); }
    to { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes loadingBar {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- NEW PAGE FIXES (Careers, Complaints, Financials) --- */

.complaint-form-container, .policy-section, .pdf-viewer-container {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--card-shadow);
    transition: background 0.3s, color 0.3s, border 0.3s;
}

.form-title, .policy-section h2, .policy-section h3 {
    color: var(--primary) !important;
}

.input-field {
    background-color: var(--input-bg) !important;
    color: var(--input-text) !important;
    border: 1px solid var(--border) !important;
}

.input-field::placeholder {
    opacity: 0.6;
    color: var(--text);
}

.vm-card {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--card-shadow) !important;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease !important;
}

.vm-card h3 {
    color: var(--primary) !important;
}

.vm-section {
    background: var(--bg);
}

/* --- TRUST BAR & INTERACTIVE WIDGET ADDITIONS --- */

.trust-bar {
    padding: 25px 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

[data-theme="dark"] .trust-bar {
    background: var(--surface);
    border-color: var(--border);
}

.trust-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    opacity: 0.8;
}

.trust-logo-item {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
}

.trust-logo-item span {
    font-size: 1.6rem;
}

.help-widget-container {
    padding: 100px 0;
}

.help-card {
    background: var(--surface);
    border-radius: 30px;
    padding: 50px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
}

.help-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.option-btn {
    padding: 25px 15px;
    border-radius: 20px;
    border: 2px solid transparent;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 600;
}

.option-btn:hover {
    border-color: var(--primary);
    transform: translateY(-8px);
}

#suggestion-result {
    margin-top: 35px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

@media (max-width: 992px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-top { flex-direction: column; gap: 20px; text-align: center; }
    .footer-brand-text { text-align: center; }
    [dir="rtl"] .footer-brand-text { text-align: center; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.1rem; }
    .hero-welcome-box { padding: 20px; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-column ul { grid-template-columns: 1fr; }
    .trust-logos { gap: 20px; flex-direction: column; }
    .help-card { padding: 30px 20px; }
}

.country-code {
    flex: 0 0 160px !important; 
    cursor: pointer;
}

.country-code option {
    background: var(--surface);
    color: var(--text);
    padding: 10px;
}