/*
Theme Name: WeddingMat Ultimate
Author: Kilian
Description: Version 10.0 - Master File (Design Luxe + Custom Booking + Lightbox + Fix Accueil).
Version: 10.0
*/

/* =========================================
   1. VARIABLES & CONFIGURATION
   ========================================= */
:root {
    /* Palette "Gold & Slate" */
    --primary: #c4a474;       /* Or Champagne */
    --primary-light: #e5dcc5;
    --primary-dark: #a68a5e;
    --secondary: #1e293b;     /* Bleu nuit très sombre (Slate 800) */
    
    --text-main: #334155;     /* Gris soutenu */
    --text-light: #64748b;    /* Gris doux */
    --bg-body: #f8fafc;       /* Blanc bleuté moderne */
    --white: #ffffff;
    
    /* Typographie */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
    
    /* UI Kit */
    --radius: 12px;
    --radius-pill: 50px;
    --shadow-soft: 0 5px 20px rgba(0,0,0,0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-gold: 0 10px 30px -5px rgba(196, 164, 116, 0.4);
    
    --container: 1280px;
    --header-height: 90px;
}

/* =========================================
   2. BASE & RESET (FINITIONS LUXE)
   ========================================= */
html { scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-body);
    margin: 0;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased; /* Rendu net sur Mac */
}

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--secondary); margin-top: 0; line-height: 1.2; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 25px; }

/* --- DÉTAILS PRO --- */
/* Sélection du texte en doré */
::selection { background: var(--primary); color: var(--white); }

/* Scrollbar personnalisée */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* =========================================
   3. PRELOADER
   ========================================= */
#preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-body); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}
.loader-text { 
    font-family: var(--font-heading); font-size: 2rem; color: var(--primary); 
    letter-spacing: 2px; text-transform: uppercase;
}
/* JS ajoute la classe .loaded pour cacher le loader */
body.loaded #preloader { opacity: 0; visibility: hidden; }

/* =========================================
   4. HEADER "GLASSMORPHISM"
   ========================================= */
.site-header {
    position: fixed; width: 100%; top: 0; z-index: 1000;
    padding: 20px 0; transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    /* Fond semi-transparent par défaut pour lisibilité */
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(5px);
    box-shadow: var(--shadow-soft);
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    padding: 10px 0;
    box-shadow: var(--shadow-hover);
}

.header-container { display: flex; justify-content: space-between; align-items: center; }

.site-title a { 
    font-size: 1.8rem; font-weight: 800; color: var(--secondary); 
    text-transform: uppercase; letter-spacing: -0.5px; 
}

.main-nav ul { list-style: none; display: flex; gap: 40px; margin: 0; padding: 0; }
.main-nav a { 
    font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--secondary); position: relative; padding: 5px 0;
}
.main-nav a:hover { color: var(--primary); }

/* Animation soulignement menu */
.main-nav a::before {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
    background: var(--primary); transition: width 0.3s ease;
}
.main-nav a:hover::before { width: 100%; }

/* =========================================
   5. HERO SECTION (FIX ACCUEIL)
   ========================================= */
.hero {
    /* Fond de secours Bleu Nuit IMPORTANT si l'image saute */
    background-color: var(--secondary);
    background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), 
                      url('https://images.unsplash.com/photo-1519225421980-715cb0201b28?auto=format&fit=crop&w=1920&q=80');
    background-size: cover; background-position: center; background-attachment: fixed;
    
    height: 85vh; display: flex; align-items: center; justify-content: center;
    text-align: center; position: relative;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 50% 100%, 0 90%);
    
    margin-bottom: 6rem;
    margin-top: -90px; /* Remonte sous le header */
    padding-top: 90px;
}

.hero h2 { 
    font-size: 4.5rem; color: var(--white); margin-bottom: 1.5rem; 
    text-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: fadeInUp 1s ease-out; 
}
.hero p { 
    font-size: 1.4rem; font-weight: 300; margin-bottom: 3rem; 
    color: #f1f1f1; opacity: 0.95; animation: fadeInUp 1.2s ease-out; 
}

/* =========================================
   6. CATALOGUE & UI COMPONENTS
   ========================================= */
/* Bouton Standard */
.btn {
    display: inline-block; padding: 15px 35px; background: var(--primary); color: var(--white);
    font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-size: 0.9rem;
    border-radius: var(--radius-pill); box-shadow: var(--shadow-gold);
    border: 2px solid var(--primary); cursor: pointer; transition: all 0.3s;
}
.btn:hover {
    background: transparent; color: var(--white); border-color: var(--white);
    transform: translateY(-5px);
}

/* Filtres Catégories */
.category-filter { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; margin-bottom: 50px; }
.btn-filter {
    padding: 10px 25px; border: 1px solid #e2e8f0; border-radius: 30px;
    font-size: 0.9rem; font-weight: 600; color: var(--text-light);
    background: var(--white); transition: all 0.3s;
}
.btn-filter:hover { 
    background: var(--primary); color: var(--white); border-color: var(--primary); transform: translateY(-2px); 
}

/* Grille & Cartes */
.materiel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 40px; padding-bottom: 8rem; }
.section-title { text-align: center; font-size: 3rem; margin: 0 0 4rem; position: relative; color: var(--secondary); }

.card {
    background: var(--white); border-radius: var(--radius); overflow: hidden; position: relative;
    box-shadow: var(--shadow-soft); transition: all 0.4s ease;
}
.card:hover { transform: translateY(-15px); box-shadow: var(--shadow-hover); }

.card-img-wrapper { height: 280px; overflow: hidden; display: block; position: relative; }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s ease; }
.card:hover .card-img { transform: scale(1.1); }

.card-body { padding: 30px; text-align: center; }
.card-title { font-size: 1.3rem; margin-bottom: 10px; font-weight: 700; }
.card-price { 
    color: var(--primary); font-weight: 600; margin-bottom: 20px; display: inline-block; 
    padding: 5px 15px; background: var(--bg-body); border-radius: 20px; font-size: 0.95rem;
}
.btn-link { 
    font-size: 0.8rem; font-weight: 700; text-transform: uppercase; color: var(--secondary); 
    letter-spacing: 1.5px; border-bottom: 2px solid transparent; 
}
.btn-link:hover { color: var(--primary); border-color: var(--primary); }

/* =========================================
   7. PAGE PRODUIT (SPLIT LAYOUT)
   ========================================= */
.product-layout {
    display: grid; grid-template-columns: 1.2fr 1fr; /* Image + large */
    gap: 60px; margin-top: 140px; margin-bottom: 80px; align-items: start;
}

/* --- Colonne Gauche : Galerie --- */
.product-gallery-wrapper { position: relative; }

.main-image {
    background: var(--white); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-soft); margin-bottom: 20px; 
    height: 500px; position: relative; cursor: zoom-in; /* Curseur Loupe */
}
.main-image img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.3s; }

/* Icône Loupe */
.zoom-icon {
    position: absolute; bottom: 15px; right: 15px;
    background: rgba(255, 255, 255, 0.9); padding: 5px 15px;
    border-radius: 20px; font-size: 0.8rem; font-weight: bold;
    color: var(--secondary); pointer-events: none; /* Ne bloque pas le clic */
}

/* Miniatures */
.gallery-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.thumb-img {
    width: 100%; height: 90px; object-fit: cover; border-radius: 8px; cursor: pointer;
    border: 2px solid transparent; transition: 0.3s; box-shadow: var(--shadow-soft);
}
.thumb-img:hover { border-color: var(--primary); transform: translateY(-3px); opacity: 0.8; }

/* --- Colonne Droite : Infos --- */
.product-info-wrapper {
    position: sticky; top: 120px; /* Colle au scroll */
    background: var(--white); padding: 50px; border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.product-title { font-size: 2.5rem; line-height: 1.1; margin-bottom: 15px; }
.product-price { 
    font-size: 2rem; color: var(--primary); font-family: var(--font-heading); 
    font-weight: bold; margin-bottom: 30px; border-bottom: 1px solid #eee; padding-bottom: 20px;
}
.product-description { margin-bottom: 40px; color: var(--text-main); font-size: 1rem; line-height: 1.8; text-align: justify; }
.product-description h3 { font-size: 1.1rem; text-transform: uppercase; margin-bottom: 15px; letter-spacing: 1px; }

/* =========================================
   8. RÉSERVATION CUSTOM & FLATPICKR
   ========================================= */
.booking-widget {
    background: var(--bg-body); padding: 30px; border-radius: var(--radius);
    border: 1px solid #e2e8f0; position: relative;
}
/* Barre dorée décorative */
.booking-widget::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: var(--primary); border-radius: 12px 12px 0 0; }
.booking-widget h3 { margin-bottom: 25px; font-size: 1.3rem; text-align: center; }

/* Formulaire */
.custom-booking-form .form-group { margin-bottom: 20px; }
.custom-booking-form label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 0.9rem; color: var(--secondary); }

.custom-booking-form input {
    width: 100%; padding: 15px; border: 1px solid #ddd; border-radius: 8px;
    font-family: var(--font-body); font-size: 1rem; transition: 0.3s;
}
.custom-booking-form input:focus {
    border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(196, 164, 116, 0.1);
}

.btn-booking {
    width: 100%; margin-top: 10px; background: var(--secondary); color: #fff;
    border: none; font-size: 1rem; padding: 15px; border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.3s;
}
.btn-booking:hover { background: var(--primary); }
.btn-booking:disabled { opacity: 0.7; cursor: wait; }

/* --- CUSTOMISATION FLATPICKR (Le Calendrier) --- */
.flatpickr-calendar {
    border-radius: 12px !important; border: none !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1) !important;
    font-family: var(--font-body) !important;
}
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange {
    background: var(--primary) !important; border-color: var(--primary) !important;
}
.flatpickr-day.disabled { background: #f1f5f9 !important; color: #cbd5e1 !important; }

/* =========================================
   9. LIGHTBOX (MODAL ZOOM)
   ========================================= */
.modal {
    display: none; /* Caché par défaut */
    position: fixed; z-index: 99999;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.95); /* Fond très sombre */
    align-items: center; justify-content: center;
    animation: fadeIn 0.3s;
}

.modal-content {
    max-width: 90%; max-height: 90vh;
    border-radius: 5px; box-shadow: 0 0 50px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s;
}

.close-modal {
    position: absolute; top: 30px; right: 40px;
    color: #f1f1f1; font-size: 50px; font-weight: bold; cursor: pointer; transition: 0.3s;
}
.close-modal:hover { color: var(--primary); }

/* =========================================
   10. FOOTER
   ========================================= */
footer { background: var(--secondary); color: var(--white); padding: 100px 0 40px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 60px; margin-bottom: 60px; }
.footer-col h3 { margin-bottom: 20px; font-size: 1.5rem; }
.footer-col h4 { color: var(--primary); margin-bottom: 20px; font-size: 1.1rem; text-transform: uppercase; }
.footer-col a:hover { color: var(--primary); padding-left: 5px; }
.copyright { text-align: center; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 30px; opacity: 0.6; font-size: 0.9rem; }

/* =========================================
   11. ANIMATIONS & RESPONSIVE
   ========================================= */
/* Fade In basique */
.fade-in-section { 
    opacity: 1 !important; 
    transform: none !important; 
    transition: none !important; 
}
/* La classe .visible est ajoutée par le JS */
.fade-in-section.visible { opacity: 1; transform: translateY(0); }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes zoomIn { from {transform:scale(0.8); opacity:0} to {transform:scale(1); opacity:1} }
@keyframes fadeIn { from {opacity:0} to {opacity:1} }

/* --- MOBILE (<900px) --- */
@media (max-width: 900px) {
    .site-header { background: var(--white); box-shadow: var(--shadow-soft); padding: 15px 0; }
    .site-title a { color: var(--secondary); }
    .header-container { flex-direction: column; gap: 15px; }
    .main-nav ul { flex-wrap: wrap; justify-content: center; gap: 15px; }
    
    .hero { height: 60vh; clip-path: none; margin-top: 0; padding-top: 0; }
    .hero h2 { font-size: 2.5rem; }
    
    .product-layout { grid-template-columns: 1fr; gap: 40px; margin-top: 100px; }
    .product-info-wrapper { position: static; padding: 30px; }
    .main-image { height: 350px; }
    
    /* On cache le preloader plus vite sur mobile pour éviter qu'il bloque */
    #preloader { display: none; }
}