/* ==========================================================================
   1. VARIABLES GLOBALES (Nouvelle Palette)
   ========================================================================== */
:root {
    --cream: #E2D1C2;
    --sand: #D4BBAC;
    --light-brown: #98755B;
    --nut-brown: #5C3422;
    --dark-chocolate: #442913;
}

/* ==========================================================================
   2. GLOBAL, RESET & OPTIMISATION DES PERFORMANCES
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: #EADCCF;
    color: #876245;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Sélection de texte aux couleurs de la charte */
::selection {
    background-color: rgba(152, 117, 91, 0.3);
    color: #442913;
}

::-moz-selection {
    background-color: rgba(152, 117, 91, 0.3);
    color: #442913;
}

/* Suppression définitive des filtres SVG et textures lourdes qui faisaient ramer le PC */
.grain,
.paper-overlay {
    display: none !important;
}

/* Désactivation définitive du curseur personnalisé JavaScript buggé */
#cursor {
    display: none !important;
}

/* ==========================================================================
   2.1 ACCESSIBILITÉ - Focus visible pour navigation clavier
   ========================================================================== */
:focus-visible {
    outline: 3px solid var(--light-brown);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Skip link amélioré */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 10000;
}

.skip-link:focus {
    position: fixed;
    top: 1rem;
    left: 1rem;
    background: var(--nut-brown);
    color: var(--cream);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-family: "DM Sans", sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(68, 41, 19, 0.2);
    outline: 3px solid var(--light-brown);
    outline-offset: 2px;
    width: auto;
    height: auto;
}


/* ==========================================================================
   3. LES BOUTONS CTA & LES ELEMENTS INTERACTIFS
   ========================================================================== */
.cta,
.btn,
.button,
button:not(#menu-toggle):not(.pswp__button),
input[type="submit"],
[class*="btn"],
[class*="cta"] {
    background-color: var(--nut-brown) !important;
    color: var(--cream) !important;
    border: 1px solid var(--dark-chocolate) !important;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer !important;
    display: inline-block;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* Effet au survol (Hover) des boutons CTA */
.cta:hover,
.btn:hover,
.button:hover,
button:not(#menu-toggle):not(.pswp__button):hover,
input[type="submit"]:hover,
[class*="btn"]:hover,
[class*="cta"]:hover {
    background-color: var(--dark-chocolate) !important;
    color: var(--cream) !important;
    border-color: var(--nut-brown) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(68, 41, 19, 0.2);
}

/* État focus pour accessibilité */
.cta:focus-visible,
.btn:focus-visible,
.button:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible {
    outline: 3px solid var(--light-brown) !important;
    outline-offset: 2px;
}

/* État disabled */
button:disabled,
input[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
    transform: none !important;
}


/* ==========================================================================
   4. LE FOOTER (PIED DE PAGE)
   ========================================================================== */
footer,
.footer,
#footer,
[class*="footer"] {
    background-color: var(--dark-chocolate) !important;
    /* Fond Marron Foncé */
    color: var(--cream) !important;
}

/* Liens à l'intérieur du footer */
footer a,
.footer a,
#footer a {
    color: var(--sand) !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover,
.footer a:hover,
#footer a:hover {
    color: var(--cream) !important;
}


/* ==========================================================================
   5. EFFETS LIQUID GLASS & COMPOSANTS DE NAVIGATION
   ========================================================================== */
.liquid-glass {
    background: rgba(226, 209, 194, 0.45);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid var(--light-brown);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05), inset 0 0 15px rgba(255, 255, 255, 0.3);
    /* Optimisation GPU */
    will-change: transform;
    transform: translateZ(0);
}

/* Barre de navigation lors du défilement */
#header.scrolled {
    background: rgba(212, 187, 172, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--light-brown);
    padding: 1rem 0;
    box-shadow: 0 4px 15px rgba(68, 41, 19, 0.08);
}

/* Champs de formulaires */
.input-liquid {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid var(--light-brown);
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--dark-chocolate);
}

.input-liquid:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.6);
    border-color: var(--nut-brown);
    box-shadow: 0 0 0 4px rgba(92, 52, 34, 0.15);
}

/* Validation des champs */
.input-liquid:not(:placeholder-shown):invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.input-liquid:not(:placeholder-shown):valid {
    border-color: #16a34a;
}


/* ==========================================================================
   6. MENUS DEROULANTS PERSONNALISÉS (Dropdowns)
   ========================================================================== */
.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer !important;
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(226, 209, 194, 0.95);
    /* Fond Cream */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--light-brown);
    border-radius: 1rem;
    padding: 0.5rem;
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 100;
    box-shadow: 0 10px 30px rgba(68, 41, 19, 0.1);
    max-height: 300px;
    overflow-y: auto;
}

.custom-select-container.active .custom-select-options {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 0.75rem 1rem;
    font-family: "Cormorant Garamond", serif;
    font-size: 1.1rem;
    color: var(--dark-chocolate);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer !important;
}

.custom-option:hover,
.custom-option.selected {
    background: rgba(152, 117, 91, 0.15);
    /* Light Brown transparent */
    color: var(--nut-brown);
}

/* Barre de défilement des menus déroulants */
.custom-select-options::-webkit-scrollbar {
    width: 4px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: transparent;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: rgba(152, 117, 91, 0.5);
    border-radius: 10px;
}


/* ==========================================================================
   7. ANIMATIONS, LIGHTBOX & COOKIES
   ========================================================================== */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Optimisation des blobs animés - réduction de la charge GPU */
.animate-blob {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.cursor-zoom-in {
    cursor: zoom-in;
}

/* Lightbox Photo */
.pswp {
    --pswp-bg: rgba(68, 41, 19, 0.95);
    --pswp-placeholder-bg: var(--cream);
    z-index: 10000;
}

.pswp__button--arrow--prev,
.pswp__button--arrow--next,
.pswp__button--close,
.pswp__button--zoom {
    color: var(--light-brown) !important;
}

.pswp__img {
    object-fit: contain !important;
}

/* Bandeau Cookie RGPD */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    will-change: transform, opacity;
}

#cookie-banner.visible {
    transform: translateY(0);
    opacity: 1;
}

#cookie-banner.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.cookie-banner-inner {
    background: rgba(226, 209, 194, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--light-brown);
    box-shadow: 0 -10px 40px rgba(68, 41, 19, 0.1);
    padding: 1.25rem 1.5rem;
}

@media (min-width: 768px) {
    .cookie-banner-inner {
        padding: 1.5rem 2rem;
    }
}


/* ==========================================================================
   8. ACCESSIBILITÉ & RESPONSIVE
   ========================================================================== */

/* Réduction des animations pour les utilisateurs qui préfèrent moins de mouvement */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .animate-blob {
        animation: none !important;
    }
}

@media (max-width: 640px) {
    .container {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .container p,
    .container h1,
    .container h2,
    .container h3 {
        max-width: 100%;
        overflow-wrap: break-word;
        word-break: break-word;
    }
}

/* ==========================================================================
   9. OPTIMISATIONS PERFORMANCE DESKTOP
   ========================================================================== */

/* Header fixe optimisé */
#header {
    will-change: transform, background;
    transform: translateZ(0);
}

/* Images optimisées */
img {
    content-visibility: auto;
}

/* Footer uniforme */
footer a,
.footer a,
#footer a {
    transition: color 0.2s ease;
}

footer a:hover,
.footer a:hover,
#footer a:hover {
    color: var(--cream) !important;
}