/* ============================================================
   EL MAGD - Premium Industrial Automation & Architectural Theme
   Color System: 
   - Light Theme: Warm Off-White (#faf8f5) + Warm Amber Accent (#ea580c)
   - Dark Theme: Pure Black (#000000 / #0a0a0a) + Vivid Industrial Accent (#f97316)
     * All dark greys strictly follow R = G = B (no blue/slate tint).
   ============================================================ */

/* 1. Theme Variables */
:root,
[data-theme="light"] {
    /* Base Surfaces */
    --bg-body: #faf8f5;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f3ee;
    --bg-elevated: #eeece5;
    --bg-stage: #ffffff;
    --bg-navbar: rgba(255, 255, 255, 0.94);
    --bg-navbar-scrolled: rgba(250, 248, 245, 0.98);

    /* Product Image Stage Background (Constant in Light & Dark) */
    --image-bg: #ffffff;

    /* Technical Spec Card Variables (Strictly Neutral R=G=B in both modes) */
    --spec-card-bg: #0a0a0a;
    --spec-card-text: #ffffff;
    --spec-card-label: #b5b5b5;
    --spec-card-border: #222222;
    --spec-card-divider: #222222;
    --spec-card-hover: rgba(255, 255, 255, 0.04);

    /* Borders */
    --border-color: #e4e1d7;
    --border-subtle: #eeece4;
    --border-strong: #d5d1c4;

    /* Typography */
    --text-primary: #141414;
    --text-secondary: #575757;
    --text-muted: #7e7e7e;

    /* Accent & Brand (Warm Amber / Bronze Industrial) */
    --accent: #ea580c;
    --accent-hover: #c2410c;
    --accent-subtle: rgba(234, 88, 12, 0.10);
    --accent-glow: rgba(234, 88, 12, 0.22);
    --accent-contrast: #ffffff;

    /* Compatibility aliases */
    --accent-orange: var(--accent);
    --accent-orange-light: var(--accent-hover);
    --accent-orange-dark: var(--accent-hover);
    --text-primary-theme: var(--text-primary);

    /* State colors */
    --color-success: #15803d;
    --color-danger: #b91c1c;
    --color-warning: #b45309;
    --color-info: #0f766e;

    /* Partner tile background */
    --partner-tile-bg: #ffffff;
    --partner-tile-text: #141414;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 18px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.12), 0 0 16px var(--accent-glow);
    --shadow-dropdown: 0 10px 25px rgba(0, 0, 0, 0.10);

    /* Typography Fonts */
    --font-en-display: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-en-body: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-ar-display: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-ar-body: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --font-current-display: var(--font-en-display);
    --font-current-body: var(--font-en-body);
    --base-line-height: 1.6;

    /* Metrics & Transitions */
    --border-radius: 14px;
    --border-radius-sm: 8px;
    --border-radius-lg: 20px;
    --transition-smooth: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme - Pure Black Only (All greys R=G=B strictly) */
[data-theme="dark"] {
    /* Base Surfaces (R=G=B) */
    --bg-body: #000000;
    --bg-surface: #0d0d0d;
    --bg-card: #121212;
    --bg-card-hover: #181818;
    --bg-elevated: #1f1f1f;
    --bg-stage: #ffffff;
    --bg-navbar: rgba(13, 13, 13, 0.94);
    --bg-navbar-scrolled: rgba(0, 0, 0, 0.98);

    /* Product Image Stage Background (Constant in Light & Dark) */
    --image-bg: #ffffff;

    /* Technical Spec Card Variables (Strictly Neutral R=G=B in both modes) */
    --spec-card-bg: #0a0a0a;
    --spec-card-text: #ffffff;
    --spec-card-label: #b5b5b5;
    --spec-card-border: #222222;
    --spec-card-divider: #222222;
    --spec-card-hover: rgba(255, 255, 255, 0.04);

    /* Borders (R=G=B) */
    --border-color: #222222;
    --border-subtle: #1a1a1a;
    --border-strong: #2e2e2e;

    /* Typography (R=G=B) */
    --text-primary: #ffffff;
    --text-secondary: #b5b5b5;
    --text-muted: #737373;

    /* Accent & Brand */
    --accent: #f97316;
    --accent-hover: #fb923c;
    --accent-subtle: rgba(249, 115, 22, 0.16);
    --accent-glow: rgba(249, 115, 22, 0.32);
    --accent-contrast: #000000;

    /* Partner tile background in dark: Light neutral tile so dark logos remain 100% visible */
    --partner-tile-bg: #f5f5f5;
    --partner-tile-text: #121212;

    /* Shadows (No dark shadow on black background; subtle accent glow instead) */
    --shadow-sm: none;
    --shadow-card: none;
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 18px var(--accent-glow);
    --shadow-dropdown: 0 10px 30px rgba(0, 0, 0, 0.9);
}

/* Fallback for OS dark preference ONLY when no explicit user theme is chosen */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg-body: #000000;
        --bg-surface: #0d0d0d;
        --bg-card: #121212;
        --bg-card-hover: #181818;
        --bg-elevated: #1f1f1f;
        --bg-stage: #ffffff;
        --bg-navbar: rgba(13, 13, 13, 0.94);
        --bg-navbar-scrolled: rgba(0, 0, 0, 0.98);
        --image-bg: #ffffff;
        --spec-card-bg: #0a0a0a;
        --spec-card-text: #ffffff;
        --spec-card-label: #b5b5b5;
        --spec-card-border: #222222;
        --spec-card-divider: #222222;
        --spec-card-hover: rgba(255, 255, 255, 0.04);
        --border-color: #222222;
        --border-subtle: #1a1a1a;
        --border-strong: #2e2e2e;
        --text-primary: #ffffff;
        --text-secondary: #b5b5b5;
        --text-muted: #737373;
        --accent: #f97316;
        --accent-hover: #fb923c;
        --accent-subtle: rgba(249, 115, 22, 0.16);
        --accent-glow: rgba(249, 115, 22, 0.32);
        --accent-contrast: #000000;
        --partner-tile-bg: #f5f5f5;
        --partner-tile-text: #121212;
        --shadow-sm: none;
        --shadow-card: none;
        --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 18px var(--accent-glow);
        --shadow-dropdown: 0 10px 30px rgba(0, 0, 0, 0.9);
    }
}

/* 2. Global Resets & Typography */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-body);
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-current-body);
    line-height: var(--base-line-height);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Arabic / RTL Typography Switch */
html[dir="rtl"],
html[lang="ar"],
:lang(ar) {
    --font-current-display: var(--font-ar-display);
    --font-current-body: var(--font-ar-body);
    --base-line-height: 1.7;
}

html[dir="rtl"] body {
    font-family: var(--font-ar-body);
    line-height: 1.7;
    text-align: start;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-family: var(--font-current-display);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 {
    font-family: var(--font-ar-display);
    letter-spacing: normal;
    font-weight: 800;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition-smooth);
}

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

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 3. Navigation & Top Bar */
.top-bar-custom {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.82rem;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
}

.top-bar-container {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.top-bar-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0;
}

.top-bar-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0 0.85rem;
    line-height: 1.2;
    transition: var(--transition-smooth);
}

.top-bar-item:hover {
    color: var(--accent);
}

/* Elegant CSS separator respecting RTL/LTR */
.top-bar-item + .top-bar-item {
    border-inline-start: 1px solid var(--border-color);
}

.top-bar-phone span[dir="ltr"] {
    white-space: nowrap;
    display: inline-block;
}

@media (max-width: 1199.98px) {
    .top-bar-promo {
        display: none !important;
    }
    .top-bar-container {
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    .top-bar-facebook,
    .top-bar-email {
        display: none !important;
    }
    .top-bar-container {
        justify-content: center;
    }
    .top-bar-item {
        padding: 0 0.5rem;
        font-size: 0.78rem;
    }
}

.navbar-custom {
    background: var(--bg-navbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1040;
    transition: var(--transition-smooth);
}

.navbar-custom.scrolled {
    background: var(--bg-navbar-scrolled);
    box-shadow: var(--shadow-sm);
    padding: 0.55rem 0;
}

.navbar-brand-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
}

.navbar-brand-text {
    font-family: var(--font-en-display);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 0.05em;
    color: var(--text-primary) !important;
}

.navbar-brand-title {
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.nav-link-custom {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.45rem 0.65rem !important;
    border-radius: var(--border-radius-sm);
    white-space: nowrap;
    transition: var(--transition-smooth);
}

.nav-link-custom:hover,
.nav-link-custom.active {
    color: var(--accent) !important;
    background-color: var(--accent-subtle);
}

@media (min-width: 992px) and (max-width: 1320px) {
    .nav-link-custom {
        font-size: 0.80rem;
        padding: 0.32rem 0.42rem !important;
        white-space: nowrap;
    }
    .navbar-nav {
        gap: 0.1rem !important;
    }
}

@media (max-width: 991.98px) {
    .nav-link-custom {
        padding: 0.6rem 0.85rem !important;
        white-space: normal;
    }
}

/* Theme Toggle Button (Sun/Moon) */
.theme-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.05rem;
    transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.05);
}

.theme-toggle-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-subtle);
    border-color: var(--accent);
}

/* Sun/Moon visibility depending on data-theme */
:root .theme-icon-light,
[data-theme="light"] .theme-icon-light { display: none; }
:root .theme-icon-dark,
[data-theme="light"] .theme-icon-dark  { display: inline-block; }

[data-theme="dark"] .theme-icon-light { display: inline-block; }
[data-theme="dark"] .theme-icon-dark  { display: none; }

/* Language Switcher Button (2 letters EN/AR, height 38px, min-width 44px) */
.lang-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    min-width: 44px;
    padding: 0 0.65rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font-en-display);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: var(--transition-smooth);
    user-select: none;
}

.lang-switch-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.lang-switch-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-subtle);
    border-color: var(--accent);
}

/* 4. Unified Card System (14px/20px radius, 1px border, surface bg, hover effects) */
.dark-card,
.category-card,
.feature-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    overflow: hidden;
}

.dark-card:hover,
.product-card:hover,
.category-card:hover,
.feature-box:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
}

/* Product Cards (egmining reference: 20px radius, clean overflow, soft shadow, no heavy borders) */
.product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-thumb-wrap {
    position: relative;
    background: var(--image-bg, #ffffff) !important;
    background-color: var(--image-bg, #ffffff) !important;
    border-bottom: 1px solid var(--border-subtle);
    padding: 1.25rem;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Product Image Stage (Constant clean white in both Light & Dark modes) */
.product-thumb-stage {
    background: var(--image-bg, #ffffff) !important;
    background-color: var(--image-bg, #ffffff) !important;
}

.product-thumb {
    max-height: 85%;
    max-width: 85%;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.product-card:hover .product-thumb {
    transform: scale(1.04);
}

.warranty-badge-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary) !important;
}

/* Small Spec Card for Product Cards */
.spec-card-sm {
    border-radius: 14px !important;
    padding: 0.75rem 0.85rem !important;
    box-shadow: none !important;
    margin-bottom: 0.85rem !important;
}

.spec-card-sm .spec-row-item {
    padding: 0.35rem 0.4rem !important;
    font-size: 0.82rem;
}

.spec-card-sm .spec-item-key {
    font-size: 0.82rem !important;
}

.spec-card-sm .spec-item-value {
    font-size: 0.85rem !important;
}

/* Product Detail Large Image Card (egmining reference: 20px radius, soft shadow, no heavy borders, clean overflow) */
.product-large-card {
    background-color: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

[data-theme="dark"] .product-large-card {
    border-color: #222222;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.product-large-stage {
    background: var(--image-bg, #ffffff) !important;
    background-color: var(--image-bg, #ffffff) !important;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    aspect-ratio: 4 / 3;
    min-height: 280px;
    max-height: 340px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-large-stage img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-large-card:hover .product-large-stage img {
    transform: scale(1.03);
}

.product-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-title a {
    color: var(--text-primary);
}

.product-title a:hover {
    color: var(--accent);
}

.product-specs-pill {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.spec-chip {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    display: inline-block;
}

.spec-chip strong {
    color: var(--text-primary);
}

/* Badges (Crisp and legible on constant white #ffffff background) */
.brand-badge {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
    background: #ea580c;
    color: #ffffff !important;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 3;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.origin-badge {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #d5d1c4;
    color: #141414 !important;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 3;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Category Cards */
.category-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.category-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-card:hover img {
    transform: scale(1.05);
}

.category-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.category-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

/* Partner / Client Tiles (Clear & high contrast in both themes) */
.partner-tile {
    background: var(--partner-tile-bg) !important;
    color: var(--partner-tile-text) !important;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.partner-tile:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow-card);
}

.partner-tile img {
    max-width: 90%;
    max-height: 52px;
    object-fit: contain;
}

.partner-tile .fw-bold,
.partner-tile span,
.partner-tile div {
    color: var(--partner-tile-text) !important;
}

/* V2 tile contrast exception */
.brand-v2-tile {
    background: #141414 !important;
    border: 1px solid #2e2e2e !important;
}

/* Feature Boxes */
.feature-box {
    padding: 1.75rem;
    height: 100%;
}

.feature-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: var(--border-radius-sm);
    background: var(--accent-subtle);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.feature-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* 5. Buttons (Unified heights, radius, states & focus rings) */
.btn {
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.65rem 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    min-height: 36px;
}

.btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 1.05rem;
    min-height: 50px;
}

/* Primary Button */
.btn-primary-orange,
.btn-primary-custom {
    background-color: var(--accent);
    color: var(--accent-contrast) !important;
    border-color: var(--accent);
}

.btn-primary-orange:hover,
.btn-primary-custom:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--accent-contrast) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

.btn-primary-orange:active,
.btn-primary-custom:active {
    transform: translateY(0);
}

/* Outline Button */
.btn-outline-orange {
    background-color: transparent;
    color: var(--accent) !important;
    border-color: var(--accent);
}

.btn-outline-orange:hover {
    background-color: var(--accent);
    color: var(--accent-contrast) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

/* Secondary / Dark Button */
.btn-secondary-dark,
.btn-secondary-custom {
    background-color: var(--bg-elevated);
    color: var(--text-primary) !important;
    border-color: var(--border-color);
}

.btn-secondary-dark:hover,
.btn-secondary-custom:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent) !important;
    transform: translateY(-2px);
}

/* 6. Form Controls & Modal System */
.form-label-custom {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.form-control,
.form-select,
.form-control-dark,
.form-select-dark {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.65rem 0.95rem;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-control:focus,
.form-select:focus,
.form-control-dark:focus,
.form-select-dark:focus {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
    outline: none;
}

.form-control::placeholder,
.form-control-dark::placeholder {
    color: var(--text-muted);
}

/* Modals */
.modal-content,
.modal-content-dark {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-dropdown);
}

.modal-header,
.modal-header-dark {
    border-bottom: 1px solid var(--border-subtle);
    padding: 1.25rem 1.5rem;
}

.modal-footer,
.modal-footer-dark {
    border-top: 1px solid var(--border-subtle);
    padding: 1rem 1.5rem;
}

/* 7. Tables & Data Display (Bilingual & Themed) */
.specs-table-modern,
.table-custom {
    width: 100%;
    color: var(--text-primary);
    border-collapse: collapse;
}

.specs-table-modern th,
.table-custom th {
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.65rem 0.5rem;
    text-align: start;
}

.specs-table-modern td,
.table-custom td {
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.65rem 0.5rem;
}

/* Admin Tables (Responsive & Theme Adaptive) */
.table-admin {
    width: 100%;
    color: var(--text-primary);
    background-color: var(--bg-card);
    border-collapse: collapse;
}

.table-admin th {
    background-color: var(--bg-elevated);
    color: var(--text-secondary);
    font-weight: 700;
    padding: 0.85rem;
    border-bottom: 2px solid var(--border-color);
    text-align: start;
}

.table-admin td {
    padding: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.table-admin tr:hover td {
    background-color: var(--bg-card-hover);
}

/* 8. Sections & Utility Blocks */
.section-padding {
    padding: 5rem 0;
}

@media (max-width: 768px) {
    .section-padding {
        padding: 3rem 0;
    }
}

.section-tag {
    display: inline-block;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.section-heading {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .section-heading {
        font-size: 1.7rem;
    }
}

.surface-subtle-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.product-stage-box {
    background: var(--image-bg, #ffffff) !important;
    background-color: var(--image-bg, #ffffff) !important;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* ============================================================
   Key Equipment / Certified Technical Specifications (.spec-card)
   Visual Reference: egmining.com dark card
   - Fixed pure black #0a0a0a background in BOTH light & dark modes
   - 20px radius, soft shadow, zero Bootstrap table bleed
   - Accent colored title, #222 divider, #b5b5b5 labels, bold white values
   - Strict R=G=B neutral greys (no blue/slate tint)
   - Logical properties for full RTL & LTR support
   ============================================================ */
.spec-card {
    background-color: var(--spec-card-bg, #0a0a0a) !important;
    background: var(--spec-card-bg, #0a0a0a) !important;
    color: var(--spec-card-text, #ffffff) !important;
    border-radius: 20px;
    border: 1px solid var(--spec-card-border, #222222);
    padding: 1.75rem;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
    position: relative;
    overflow: hidden;
}

.spec-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--spec-card-divider, #222222);
}

.spec-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent) !important;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.spec-card-title i {
    color: var(--accent) !important;
    font-size: 1.15rem;
}

.spec-badge-catalog {
    background: #141414;
    border: 1px solid #2e2e2e;
    color: #b5b5b5;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* Specification Rows List (Clean, modern key-value layout) */
.spec-rows-list {
    display: flex;
    flex-direction: column;
}

.spec-row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0.65rem;
    border-bottom: 1px solid var(--spec-card-divider, #222222);
    border-radius: 6px;
    transition: background-color 0.18s ease;
}

.spec-row-item:last-child {
    border-bottom: none;
}

.spec-row-item:hover {
    background-color: var(--spec-card-hover, rgba(255, 255, 255, 0.04));
}

.spec-item-key {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--spec-card-label, #b5b5b5) !important;
    font-size: 0.92rem;
    font-weight: 500;
}

.spec-icon-box {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 6px;
    background: #171717;
    border: 1px solid #282828;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
}

.spec-item-value {
    color: var(--spec-card-text, #ffffff) !important;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: end;
    font-feature-settings: "tnum";
}

/* Zero Bootstrap table bleed-through if a table is used inside .spec-card */
.spec-card table,
.spec-card .table,
.spec-card .specs-table-modern {
    --bs-table-bg: transparent !important;
    --bs-table-color: var(--spec-card-text, #ffffff) !important;
    --bs-table-border-color: var(--spec-card-divider, #222222) !important;
    --bs-table-striped-bg: transparent !important;
    --bs-table-hover-bg: var(--spec-card-hover, rgba(255, 255, 255, 0.04)) !important;
    background-color: transparent !important;
    color: var(--spec-card-text, #ffffff) !important;
    margin-bottom: 0;
    border-collapse: collapse;
    width: 100%;
}

.spec-card table tr,
.spec-card .table tr {
    background-color: transparent !important;
    border-bottom: 1px solid var(--spec-card-divider, #222222) !important;
    transition: background-color 0.18s ease;
}

.spec-card table tr:last-child,
.spec-card .table tr:last-child {
    border-bottom: none !important;
}

.spec-card table tr:hover,
.spec-card .table tr:hover {
    background-color: var(--spec-card-hover, rgba(255, 255, 255, 0.04)) !important;
}

.spec-card table th,
.spec-card .table th {
    color: var(--spec-card-label, #b5b5b5) !important;
    background-color: transparent !important;
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.85rem 0.65rem;
    border-bottom: none !important;
    text-align: start;
}

.spec-card table td,
.spec-card .table td {
    color: var(--spec-card-text, #ffffff) !important;
    background-color: transparent !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.85rem 0.65rem;
    border-bottom: none !important;
    text-align: end;
}

/* Hero Section */
.hero-section {
    background-color: var(--bg-body);
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 4rem 0;
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.1rem;
    }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 720px;
}

.hero-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    background: var(--accent-subtle);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
}

/* Quick Stats Bar */
.stats-bar {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 2.25rem 0;
}

.stat-item {
    padding: 0.5rem;
}

.stat-number {
    font-size: 2.3rem;
    font-weight: 900;
    color: var(--accent);
    font-family: var(--font-en-display);
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.stat-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* CTA Banner Wrapper */
.cta-banner-wrapper {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 3rem 2.5rem;
}

/* Floating Actions (WhatsApp & Phone) */
.floating-actions {
    position: fixed;
    bottom: 25px;
    inset-inline-end: 25px;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.floating-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.floating-whatsapp {
    background-color: #25d366;
}

.floating-call {
    background-color: var(--accent);
}

/* Footer */
.footer-custom {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding-top: 4rem;
    margin-top: auto;
}

.footer-title {
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.footer-links a:hover {
    color: var(--accent);
    transform: translateX(3px);
}

html[dir="rtl"] .footer-links a:hover {
    transform: translateX(-3px);
}

.footer-bottom {
    background-color: var(--bg-body);
    border-top: 1px solid var(--border-subtle);
    padding: 1.5rem 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* 9. RTL Logical Rules & Icon Flips */
html[dir="rtl"] .rtl-flip {
    transform: scaleX(-1);
}

html[dir="rtl"] .bi-chevron-right::before {
    content: "\f284"; /* chevron-left */
}

html[dir="rtl"] .bi-arrow-right::before {
    content: "\f12f"; /* arrow-left */
}

/* 10. Bootstrap Overrides for Theming */
.bg-dark {
    background-color: var(--bg-surface) !important;
}

.text-white {
    color: var(--text-primary) !important;
}

.text-dark {
    color: var(--text-primary) !important;
}

.border-dark {
    border-color: var(--border-color) !important;
}

.border-secondary {
    border-color: var(--border-subtle) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.btn-close {
    filter: invert(var(--btn-close-invert, 0));
}

[data-theme="dark"] {
    --btn-close-invert: 1;
}

/* Admin Sidebar Styling */
.admin-sidebar {
    background-color: var(--bg-surface);
    border-inline-end: 1px solid var(--border-color);
    min-height: calc(100vh - 65px);
}

.admin-nav-link {
    color: var(--text-secondary);
    padding: 0.65rem 0.95rem;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.admin-nav-link:hover,
.admin-nav-link.active {
    background-color: var(--accent-subtle);
    color: var(--accent);
}

.admin-nav-link.active {
    font-weight: 700;
}