/* ===========================
   VARIABLES & BASE STYLES
   =========================== */
:root {
    --primary-green: #2C5F2D;
    --primary-dark: #1a3a1b;
    --primary-light: #3d7a3e;
    --gold: #D4AF37;
    --gold-light: #E5C158;
    --gold-dark: #B8941F;
    --cream: #F5F3EE;
    --cream-dark: #E8E5DC;
    --white: #FFFFFF;
    --black: #0A0A0A;
    --text-primary: #1A1A1A;
    --text-secondary: #4A4A4A;
    --text-light: #707070;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Crimson Pro', serif;
    color: var(--text-primary);
    background: var(--cream);
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Almarai', sans-serif;
    font-weight: 700;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===========================
   NAVIGATION - RESPONSIVE FIRST
   =========================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 30px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.navbar.scrolled {
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo Responsive */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Almarai', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-green);
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 1001;
}

.nav-logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    width: 50px;
    height: 50px;
    overflow: hidden;
    border-radius: 10%;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-text {
    background: linear-gradient(135deg, var(--primary-green), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

/* Menu Toggle Button */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    transition: all 0.3s ease;
}

.menu-toggle span {
    width: 28px;
    height: 3px;
    background: var(--primary-green);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translateY(10px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-10px);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.05rem;
    position: relative;
    transition: color 0.3s ease;
    font-family: 'Almarai', sans-serif;
    padding: 0.5rem 0;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-green);
}

/* ===========================
   RESPONSIVE BREAKPOINTS
   =========================== */

/* Tablettes et petits écrans (max-width: 1024px) */
@media (max-width: 1024px) {
    html {
        font-size: 15px;
    }

    .container,
    .container-wide {
        padding: 0 1.5rem;
    }

    .nav-container {
        padding: 1rem 1.5rem;
    }

    .nav-menu {
        gap: 2rem;
    }

    .nav-link {
        font-size: 1rem;
    }
}

/* Tablettes portrait (max-width: 900px) */
@media (max-width: 900px) {
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 280px;
        background: var(--white);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 6rem 2rem 2rem 2rem;
        gap: 1.5rem;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-link {
        width: 100%;
        padding: 0.75rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--cream);
    }

    .nav-link::before {
        left: 0;
        transform: translateX(0);
    }

    .logo-icon {
        width: 45px;
        height: 45px;
    }

    .logo-text {
        font-size: 1.15rem;
    }
}

/* Mobiles (max-width: 768px) */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .container,
    .container-wide {
        padding: 0 1rem;
    }

    .nav-container {
        padding: 0.875rem 1rem;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
    }

    .logo-text {
        font-size: 1rem;
    }

    .nav-menu {
        width: 260px;
        padding: 5rem 1.5rem 2rem 1.5rem;
    }

    .nav-link {
        font-size: 1rem;
    }
}

/* Petits mobiles (max-width: 480px) */
@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    .container,
    .container-wide {
        padding: 0 0.875rem;
    }

    .nav-container {
        padding: 0.75rem 0.875rem;
    }

    .nav-logo {
        gap: 0.5rem;
    }

    .logo-icon {
        width: 35px;
        height: 35px;
    }

    .logo-text {
        font-size: 0.9rem;
    }

    .menu-toggle span {
        width: 24px;
        height: 2.5px;
    }

    .nav-menu {
        width: 100%;
        max-width: 280px;
    }
}

/* Très petits mobiles (max-width: 360px) */
@media (max-width: 360px) {
    .nav-logo {
        gap: 0.4rem;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    .logo-text {
        font-size: 0.85rem;
    }

    .menu-toggle {
        padding: 6px;
    }

    .menu-toggle span {
        width: 22px;
    }
}

/* ===========================
   OVERLAY POUR MOBILE MENU
   =========================== */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 900px) {
    body.menu-open {
        overflow: hidden;
    }
}

/* ===========================
   AMÉLIORATIONS TACTILES
   =========================== */
@media (hover: none) and (pointer: coarse) {
    .nav-link {
        padding: 1rem 0;
        -webkit-tap-highlight-color: transparent;
    }

    .menu-toggle {
        padding: 12px;
        -webkit-tap-highlight-color: transparent;
    }

    .logo-icon {
        -webkit-tap-highlight-color: transparent;
    }
}

/* ===========================
   ANIMATIONS D'ENTRÉE
   =========================== */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.nav-menu.active {
    animation: slideInFromRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-menu.active .nav-link {
    animation: fadeInUp 0.5s ease-out backwards;
}

.nav-menu.active .nav-link:nth-child(1) { animation-delay: 0.1s; }
.nav-menu.active .nav-link:nth-child(2) { animation-delay: 0.15s; }
.nav-menu.active .nav-link:nth-child(3) { animation-delay: 0.2s; }
.nav-menu.active .nav-link:nth-child(4) { animation-delay: 0.25s; }
.nav-menu.active .nav-link:nth-child(5) { animation-delay: 0.3s; }
.nav-menu.active .nav-link:nth-child(6) { animation-delay: 0.35s; }

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

/* ===========================
   ACCESSIBILITÉ
   =========================== */
.nav-link:focus-visible,
.menu-toggle:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===========================
   UTILITAIRES RESPONSIVE
   =========================== */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }

    .show-mobile {
        display: block;
    }
}
