/* =========================================================
   COMMON — design tokens, reset, base, header, footer
   LIGHT PAGE · DARK HEADER/FOOTER
   ========================================================= */

/* ---------- 1. Design Tokens ---------- */
:root {
    --emerald-deep: #0a1e16;
    --emerald-dark: #0f2b20;
    --emerald-primary: #1a5c3e;
    --emerald-bright: #238551;
    --emerald-glow: rgba(26, 92, 62, 0.6);
    --emerald-light: #2d9c6a;

    --champagne-dark: #8b7355;
    --champagne-primary: #a68964;
    --champagne-bright: #bfa580;
    --champagne-glow: rgba(166, 137, 100, 0.3);

    --gold-metallic: #9e8038;
    --gold-subtle: #7a6028;
    --gold-deep: #5e4820;
    --brass: #7d6635;
    --bronze: #6e5530;

    /* Dark surfaces (header / footer / overlays) */
    --glass-bg: rgba(15, 43, 32, 0.45);
    --glass-border: rgba(226, 199, 155, 0.2);
    --glass-border-light: rgba(226, 199, 155, 0.35);

    --glass-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.5);
    --glass-blur: blur(12px);

    /* Text on dark surfaces */
    --text-on-dark: #f5f0e8;
    --text-on-dark-2: rgba(245, 240, 232, 0.75);
    --text-on-dark-3: rgba(245, 240, 232, 0.55);
    --text-gold: var(--champagne-primary);

    /* Dark surfaces */
    --bg-dark: #050a08;

    /* Light page surfaces */
    --bg-light: #f5f0e8;
    --bg-light-2: #efe7d8;
    --bg-light-3: #ffffff;

    /* Text on light surfaces */
    --ink-1: #0a1e16;
    --ink-2: rgba(15, 43, 32, 0.78);
    --ink-3: rgba(15, 43, 32, 0.55);
    --ink-line: rgba(26, 92, 62, 0.14);
    --ink-line-soft: rgba(26, 92, 62, 0.08);

    --bg-cinematic:
        radial-gradient(
            ellipse at 20% 30%,
            #0f2b20 0%,
            #050a08 100%
        );

    --bg-card: rgba(10, 30, 22, 0.65);

    --gradient-gold:
        linear-gradient(
            135deg,
            var(--champagne-primary) 0%,
            var(--gold-metallic) 50%,
            var(--champagne-bright) 100%
        );

    --gradient-gold-dark:
        linear-gradient(
            135deg,
            var(--champagne-dark) 0%,
            var(--gold-subtle) 100%
        );

    --gradient-emerald:
        linear-gradient(
            135deg,
            var(--emerald-primary) 0%,
            var(--emerald-light) 100%
        );

    --gradient-glass:
        linear-gradient(
            135deg,
            rgba(15, 43, 32, 0.6) 0%,
            rgba(26, 92, 62, 0.25) 100%
        );

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-2xl: 40px;
    --radius-full: 9999px;

    --shadow-sm: 0 4px 12px rgba(10, 30, 22, 0.08);
    --shadow-md: 0 8px 24px rgba(10, 30, 22, 0.1);
    --shadow-lg: 0 25px 45px -12px rgba(10, 30, 22, 0.18);

    --shadow-glow:
        0 0 30px rgba(226, 199, 155, 0.15);

    --shadow-emerald-glow:
        0 0 40px rgba(26, 92, 62, 0.3);

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    --wireframe-opacity: 0.06;

    --border-glow:
        0 0 20px rgba(226, 199, 155, 0.2);

    /* Layout */
    --container-max: 1200px;
    --container-pad: 24px;
    --header-h: 76px;
}

/* ---------- 2. Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

img,
svg,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

a:active,
button:active,
.btn:active {
    outline: none;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

h1, h2, h3, h4, h5, h6, p {
    margin: 0;
}

/* ---------- 3. Base (LIGHT PAGE) ---------- */
body {
    font-family: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-weight: 400;
    line-height: 1.7;
    color: var(--ink-1);
    background-color: #fbf8f2;
    background-image:
        radial-gradient(
            ellipse 80% 70% at 85% -10%,
            rgba(26, 92, 62, 0.08) 0%,
            rgba(26, 92, 62, 0) 65%
        ),
        radial-gradient(
            ellipse 90% 80% at 50% 120%,
            #efe6d4 0%,
            #fbf8f2 55%
        );
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Strong film grain (fixed, animated) ---- */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.22;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'>\
<filter id='n'>\
<feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/>\
</filter>\
<rect width='100%' height='100%' filter='url(%23n)'/>\
</svg>");
    background-size: 240px 240px;
    animation: noise-shift 0.9s steps(5) infinite;
    will-change: background-position;
}

@keyframes noise-shift {
    0%   { background-position: 0 0; }
    20%  { background-position: -60px 30px; }
    40%  { background-position: 40px -50px; }
    60%  { background-position: -30px 60px; }
    80%  { background-position: 70px -20px; }
    100% { background-position: 0 0; }
}

body.no-scroll {
    overflow: hidden;
}

h1, h2, h3, h4 {
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--ink-1);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

p {
    color: var(--ink-2);
}

::selection {
    background: var(--champagne-primary);
    color: var(--bg-dark);
}

:focus-visible {
    outline: 2px solid var(--emerald-primary);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ---------- 4. Container & utilities ---------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.text-gold { color: var(--champagne-dark); }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

/* ---------- 5. Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-base),
        background var(--transition-base),
        border-color var(--transition-base),
        color var(--transition-base);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: translateY(1px); }

/* Primary — gold gradient (works on light and dark) */
.btn-primary {
    background: var(--gradient-gold);
    color: #1a1206;
    box-shadow:
        0 10px 24px -10px rgba(166, 137, 100, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 16px 32px -12px rgba(166, 137, 100, 0.7),
        0 0 0 1px rgba(226, 199, 155, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* Secondary — light outline, for use on light backgrounds */
.btn-secondary {
    background: #ffffff;
    color: var(--emerald-deep);
    border-color: var(--ink-line);
    box-shadow: 0 2px 8px -4px rgba(10, 30, 22, 0.1);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    border-color: var(--emerald-primary);
    color: var(--emerald-primary);
    box-shadow:
        0 12px 26px -14px rgba(26, 92, 62, 0.4),
        0 4px 10px -6px rgba(10, 30, 22, 0.08);
}

/* Secondary variant for dark surfaces (header/footer/overlays) */
.btn-secondary--dark {
    background: var(--glass-bg);
    color: var(--text-on-dark);
    border-color: var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.btn-secondary--dark:hover {
    transform: translateY(-2px);
    border-color: var(--glass-border-light);
    background: rgba(26, 92, 62, 0.35);
    color: var(--text-on-dark);
    box-shadow: var(--shadow-emerald-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--ink-2);
    border-color: transparent;
    padding: 10px 16px;
}

.btn-ghost:hover {
    color: var(--ink-1);
    background: rgba(26, 92, 62, 0.06);
}

/* Outlined button for dark header (login) */
.btn-outline-dark {
    background: transparent;
    color: var(--text-on-dark);
    border: 1.5px solid var(--glass-border);
    padding: 10px 20px;
}

.btn-outline-dark:hover {
    border-color: var(--glass-border-light);
    background: rgba(226, 199, 155, 0.06);
    color: var(--text-on-dark);
    transform: translateY(-1px);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.05rem;
}

/* =========================================================
   HEADER (dark, on light page)
   ========================================================= */
.site-header {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: 1000;
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: rgba(5, 10, 8, 0.6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition:
        background var(--transition-base),
        border-color var(--transition-base),
        box-shadow var(--transition-base);
}

.site-header.is-scrolled {
    background: rgba(5, 10, 8, 0.88);
    border-bottom-color: var(--glass-border);
    box-shadow: 0 10px 30px -20px rgba(0, 0, 0, 0.9);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
}

/* Brand — logo image + stacked text (light on dark header) */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    transition: opacity var(--transition-fast);
}

.brand:hover { opacity: 0.85; }

.brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
    transform: scale(1.5);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.brand-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-on-dark);
    letter-spacing: -0.01em;
}

.brand-tag {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-gold);
    letter-spacing: 0.02em;
}

/* Right group: nav + CTA */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    position: relative;
    padding: 10px 14px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-on-dark-2);
    border-radius: var(--radius-md);
    transition: color var(--transition-fast), background var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-on-dark);
    background: rgba(226, 199, 155, 0.06);
}

.nav-link.is-active {
    color: var(--text-on-dark);
}

.nav-link.is-active::after {
    content: "";
    position: absolute;
    inset-block-end: 4px;
    inset-inline: 14px;
    height: 2px;
    border-radius: 2px;
    background: var(--gradient-gold);
    box-shadow: 0 0 12px var(--champagne-glow);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-on-dark);
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.nav-toggle:hover {
    border-color: var(--glass-border-light);
    background: rgba(26, 92, 62, 0.3);
}

.nav-toggle i { font-size: 1.05rem; }

/* ---------- Mobile menu (dark panel over light page) ---------- */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 1100;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear var(--transition-base);
}

.mobile-menu.is-open {
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.mobile-menu__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 6, 5, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.mobile-menu.is-open .mobile-menu__backdrop { opacity: 1; }

.mobile-menu__panel {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(280px, 78vw);
    background:
        linear-gradient(180deg, rgba(15, 43, 32, 0.98) 0%, rgba(5, 10, 8, 0.98) 100%);
    border-inline-start: 1px solid var(--glass-border);
    box-shadow: -30px 0 60px -20px rgba(0, 0, 0, 0.8);
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transform: translateX(100%);
    transition: transform var(--transition-base);
    overflow-y: auto;
}

[dir="rtl"] .mobile-menu__panel { transform: translateX(-100%); }

.mobile-menu.is-open .mobile-menu__panel { transform: translateX(0); }

.mobile-menu__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 12px;
}

.mobile-menu__close {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    color: var(--text-on-dark);
    display: grid;
    place-items: center;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.mobile-menu__close:hover {
    border-color: var(--glass-border-light);
    background: rgba(26, 92, 62, 0.3);
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav .nav-link {
    padding: 12px 14px;
    font-size: 0.98rem;
    border-radius: var(--radius-md);
    color: var(--text-on-dark-2);
}

.mobile-nav .nav-link:hover {
    color: var(--text-on-dark);
}

.mobile-nav .nav-link.is-active {
    background: rgba(26, 92, 62, 0.35);
    color: var(--text-on-dark);
}

.mobile-nav .nav-link.is-active::after { display: none; }

.mobile-menu__cta {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-menu__cta .btn { width: 100%; }

/* =========================================================
   FOOTER (dark, on light page)
   ========================================================= */
.site-footer {
    position: relative;
    background:
        linear-gradient(180deg, #0a1e16 0%, #050a08 100%);
    color: var(--text-on-dark);
    border-top: 1px solid rgba(226, 199, 155, 0.18);
}

.site-footer::before {
    content: "";
    position: absolute;
    inset-block-start: -1px;
    inset-inline: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--champagne-primary), transparent);
    opacity: 0.5;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
    gap: 48px;
    padding: 72px 0 40px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

.footer-logo {
    width: 128px;
    height: 128px;
    object-fit: contain;
    transform-origin: right center;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
    transform: scale(1.5);
    margin-top: -30px;
    margin-right: -20px;
}

.footer-desc {
    font-size: 0.92rem;
    color: var(--text-on-dark-3);
    line-height: 1.8;
    max-width: 38ch;
}

.footer-title {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-gold);
    margin-bottom: 18px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    font-size: 0.92rem;
    color: var(--text-on-dark-2);
    width: fit-content;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-on-dark);
    transform: translateX(-4px);
}

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

.footer-social {
    display: flex;
    gap: 10px;
}

.social-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-on-dark-2);
    display: grid;
    place-items: center;
    transition:
        color var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast),
        transform var(--transition-fast);
}

.social-btn:hover {
    color: var(--champagne-bright);
    border-color: var(--glass-border-light);
    background: rgba(26, 92, 62, 0.3);
    transform: translateY(-3px);
}

.social-btn i { font-size: 1.05rem; }

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 0;
    border-top: 1px solid rgba(226, 199, 155, 0.1);
    font-size: 0.85rem;
    color: var(--text-on-dark-3);
}

.footer-bottom .dot {
    color: var(--champagne-primary);
    margin-inline: 6px;
}

/* =========================================================
   WHATSAPP FLOAT (bottom-left)
   ========================================================= */
.whatsapp-float {
    position: fixed;
    inset-block-end: 24px;
    inset-inline-end: 24px;
    z-index: 900;
    width: 58px;
    height: 58px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: #ffffff;
    display: grid;
    place-items: center;
    box-shadow:
        0 12px 28px -8px rgba(18, 140, 126, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-base);
    -webkit-tap-highlight-color: transparent;
}

.whatsapp-float i { font-size: 1.6rem; }

.whatsapp-float:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        0 18px 36px -10px rgba(18, 140, 126, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.whatsapp-float::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    border: 2px solid rgba(37, 211, 102, 0.45);
    animation: whatsapp-pulse 2.4s ease-out infinite;
    pointer-events: none;
}

@keyframes whatsapp-pulse {
    0%   { transform: scale(0.9); opacity: 0.7; }
    70%  { transform: scale(1.25); opacity: 0; }
    100% { transform: scale(1.25); opacity: 0; }
}

/* =========================================================
   PHONE (≤ 560px)
   ========================================================= */
@media (max-width: 560px) {
    :root {
        --container-pad: 20px;
        --header-h: 68px;
    }

    /* Hide desktop nav + CTA + login, show hamburger */
    .nav { display: none; }
    .header-right .btn-primary { display: none; }
    .header-right .btn-outline-dark { display: none; }
    .nav-toggle { display: inline-flex; }

    /* Brand */
    .brand-logo { width: 38px; height: 38px; }

    /* Footer — single column, centered */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 56px 0 32px;
        text-align: center;
    }

    .footer-brand {
        grid-column: 1 / -1;
        align-items: center;
        text-align: center;
    }

    .footer-logo {
        transform: scale(1.3);
        transform-origin: center;
        margin: 0 auto;
    }

    .footer-desc {
        margin-inline: auto;
        text-align: center;
    }

    /* Center every footer column's content */
    .footer-grid > div {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-links {
        align-items: center;
    }

    .footer-links a {
        width: auto;
    }

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

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    /* WhatsApp float */
    .whatsapp-float {
        width: 52px;
        height: 52px;
        inset-block-end: 18px;
        inset-inline-end: 18px;
    }

    .whatsapp-float i { font-size: 1.4rem; }
}

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

    html { scroll-behavior: auto; }

    .whatsapp-float::after { animation: none; }
    body::before { animation: none; }
}

/* =========================================================
   SCROLLBAR — brand styled
   ========================================================= */

/* Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--champagne-primary) rgba(10, 30, 22, 0.08);
}

/* WebKit (Chrome, Edge, Safari, Opera) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 30, 22, 0.06);
    border-inline-start: 1px solid rgba(26, 92, 62, 0.08);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        var(--champagne-primary) 0%,
        var(--gold-metallic) 100%
    );
    border-radius: var(--radius-full);
    border: 3px solid transparent;
    background-clip: padding-box;
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        var(--champagne-bright) 0%,
        var(--champagne-primary) 100%
    );
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:active {
    background: linear-gradient(
        180deg,
        var(--gold-metallic) 0%,
        var(--gold-subtle) 100%
    );
    background-clip: padding-box;
}

::-webkit-scrollbar-corner {
    background: transparent;
}