:root {
  --black: #0b0b0b;
  --deep-gray: #222;
  --cream: #fbf7f0;
  --muted: #6b6b6b;
  --gold: #c69a45;
  --white: #ffffff;
  --max-width: 1100px;
  --radius: 8px;
  --ff-serif: "Merriweather", serif;
  --ff-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* ==========================================================================
   BASES & SÉCURITÉ MOBILE (SCROLL DROIT ET FLUIDE)
   ========================================================================= */
html, body {
  max-width: 100%;
  overflow-x: hidden; /* Bloque le scroll gauche-droite définitivement */
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  font-family: var(--ff-sans);
  color: var(--deep-gray);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
}

* {
  box-sizing: border-box;
}

/* Header standard (Ordinateur) */
.site-header {
  background: var(--black);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 99999;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
}
.logo { display: flex; align-items: center; gap: 10px; }

/* RETRAIT DU "R" DANS LE LOGO */
.logo-mark {
  display: none !important; /* Masque le carré avec le R */
}

.logo-text { font-weight: 600; letter-spacing: 1px; font-family: var(--ff-serif); }

.main-nav { flex: 1; display: flex; justify-content: center; }
.main-nav ul { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
.main-nav a { color: var(--white); text-decoration: none; font-weight: 500; opacity: .95; }
.cta { display: flex; align-items: center; gap: 12px; }
.btn { display: inline-block; padding: 10px 16px; border-radius: 6px; text-decoration: none; font-weight: 600; }
.btn-gold { background: linear-gradient(180deg, var(--gold), #a87b34); color: var(--black); box-shadow: 0 2px 0 rgba(0,0,0,.12); }

/* Bouton menu hamburger */
.nav-toggle { display: none; background: transparent; border: 0; color: var(--white); font-size: 24px; cursor: pointer; }

/* Sections */
.section { padding: 48px 20px; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 12px; }

/* Dark hero */
.hero {
  position: relative;
  color: var(--white);
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}
.hero .overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.6)); }
.hero-inner { position: relative; text-align: center; max-width: 900px; padding: 48px; }
.hero h1 { font-family: var(--ff-serif); font-size: clamp(26px, 6vw, 44px); margin: 0 0 12px; }
.lead { font-size: 1.05rem; margin-bottom: 18px; color: rgba(255,255,255,.9); }

/* Color Themes */
.light { background: var(--cream); color: var(--deep-gray); }
.dark { background: var(--black); color: var(--white); }
.dark-alt { background: var(--black); color: var(--white); padding-bottom: 64px; padding-top: 64px; }

/* Services */
.section-title { font-family: var(--ff-serif); font-size: 1.6rem; margin: 0 0 10px; }

/* Mise en page globale - CORRECTIF SÉCURITÉ GRILLE COMPLÈTE */
.services-grid, .service-grid, [class*="services-grid"], [class*="service-grid"] {
  grid-template-columns: 1fr !important;
  display: grid !important;
  gap: 20px !important;
  align-items: stretch;
}
.service-card {
  background: transparent;
  border-radius: 10px; padding: 18px; text-align: center;
}
.service-card .icon { font-size: 32px; margin-bottom: 10px; }
.service-card h3 { font-family: var(--ff-serif); margin: 6px 0; }

/* Galleries */
.galleries { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 20px; }
.gallery-card { color: var(--white); text-align: left; }
.frame {
  border: 2px solid rgba(198,154,69,0.9);
  border-radius: 8px; overflow: hidden; height: 160px; background: #111;
}
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-card h4 { margin: 10px 0 0; font-family: var(--ff-serif); font-size: 1rem; }

/* Catalogue produit */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 8px;
}
.catalog-item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--deep-gray);
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.04);
  transition: transform .18s ease, box-shadow .18s ease;
}
.catalog-item:hover { transform: translateY(-6px); box-shadow: 0 10px 18px rgba(0,0,0,0.08); }
.catalog-thumb {
  width: 100%;
  aspect-ratio: 1/1;
  background-size: cover;
  background-position: center;
  display: block;
}
.catalog-meta {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid rgba(0,0,0,0.03);
  font-size: 0.95rem;
}
.catalog-meta strong { font-family: var(--ff-serif); font-size: 1rem; color: var(--deep-gray); }
.catalog-meta span { color: var(--muted); font-size: .88rem; }

/* Two-column layout */
.two-column .columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.testimonial { display: flex; gap: 12px; background: rgba(255,255,255,0.06); padding: 12px; border-radius: 10px; margin-bottom: 12px; }
.testimonial .avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.testimonial .text p { margin: 6px 0 0; color: var(--muted); }

/* Contact form */
.contact-form { display: flex; flex-direction: column; gap: 10px; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
  font-family: var(--ff-sans);
}
.contact-form textarea { resize: vertical; }
.form-actions { text-align: right; margin-top: 8px; }
.form-msg { color: var(--muted); font-size: .95rem; margin-top: 8px; }

/* WhatsApp quick button */
.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg,#25D366,#1DA851);
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.whatsapp-btn svg { filter: drop-shadow(0 1px 0 rgba(0,0,0,0.12)); }

/* Equipment selector & preview styling */
#equipmentSelect {
  min-height: 120px;
  background: var(--white);
  color: var(--deep-gray);
}
#equipmentPreview {
  white-space: pre-wrap;
  background: rgba(255,255,255,0.04);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.04);
  margin-top: 6px;
  font-size: .95rem;
  color: var(--muted);
}

/* Footer */
.site-footer { background: var(--deep-gray); color: var(--cream); padding: 18px 20px; margin-top: 24px; }
.footer-inner { max-width: var(--max-width); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.socials .social { margin-left: 8px; color: var(--cream); text-decoration: none; padding: 6px 8px; border-radius: 6px; background: transparent; border: 1px solid rgba(255,255,255,0.06); }

/* Chat widget */
#rConceptChat { position: fixed; right: 18px; bottom: 18px; z-index: 9999; font-family: var(--ff-sans); }
#rConceptToggle {
  width: 56px; height: 56px; border-radius: 50%; border: 0; background: linear-gradient(180deg,#2f8fef,#0066cc); color: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(0,0,0,0.2); cursor: pointer; position: relative;
}
#rConceptToggle .badge { position: absolute; left: 6px; top: 6px; background: var(--gold); color: var(--black); font-weight: 700; border-radius: 8px; padding: 2px 6px; font-size: 12px; }
#rConceptPanel {
  width: 320px; max-width: calc(100vw - 48px); height: 420px; border-radius: 12px; overflow: hidden; background: linear-gradient(180deg,#0b1220,#071026); color: var(--white); box-shadow: 0 20px 40px rgba(2,6,23,0.6); position: fixed; right: 18px; bottom: 86px; display: flex; flex-direction: column; transform: translateY(8px); opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
#rConceptPanel[aria-hidden="false"] { opacity: 1; pointer-events: auto; transform: translateY(0); }
.rc-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: linear-gradient(90deg,rgba(255,255,255,0.03),transparent); border-bottom: 1px solid rgba(255,255,255,0.03); }
.rc-header strong { font-family: var(--ff-serif); }

/* ZONE DU SCROLL MOBILE DU CHAT */
.rc-messages {
  flex: 1;
  overflow-y: auto; /* Force le scroll vertical uniquement */
  -webkit-overflow-scrolling: touch; /* Effet élastique natif iOS/Android */
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rc-messages .msg { max-width: 86%; padding: 8px 10px; border-radius: 8px; font-size: 0.95rem; }
.rc-messages .user { align-self: flex-end; background: rgba(255,255,255,0.08); color: var(--white); }
.rc-messages .bot { align-self: flex-start; background: rgba(255,255,255,0.03); color: var(--white); border: 1px solid rgba(255,255,255,0.03); }
.rc-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid rgba(255,255,255,0.03); }

.rc-form input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.02);
  color: var(--white);
  font-size: 16px !important;
}
.rc-form button { padding: 8px 10px; border-radius: 8px; border: 0; background: var(--gold); color: var(--black); font-weight: 700; }
.rc-footer { font-size: 12px; padding: 8px 10px; color: var(--muted); background: linear-gradient(90deg,transparent,rgba(255,255,255,0.01)); }

/* Testimonials */
#testimonialsList { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: start; }
#testimonialsList .testimonial { opacity: 0; transform: translateY(6px); transition: opacity .9s ease, transform .9s ease; min-height: 100px; }
#testimonialsList .testimonial.visible { opacity: 1; transform: translateY(0); }
#testimonialsList .testimonial { background: linear-gradient(180deg,rgba(255,255,255,0.03),rgba(255,255,255,0.01)); padding: 12px; border-radius: 10px; }
#testimonialsList .testimonial .avatar { width: 48px; height: 48px; }

.sr-only { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.footer-socials a:hover { color: var(--gold) !important; transform: scale(1.1); }
.footer-socials a { transition: all 0.2s ease-in-out; }


/* ==========================================================================
   TOUS LES CORRECTIFS RESPONSIVE ET SMARTPHONE UNIFIÉS (MAX-WIDTH: 900px)
   ========================================================================= */
@media (max-width: 900px) {
  /* Mise en page globale */
  .services-grid { grid-template-columns: 1fr; align-items: stretch; }
  .galleries { grid-template-columns: 1fr; grid-auto-rows: 1fr; }
  .two-column .columns { grid-template-columns: 1fr; gap: 18px; }
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
  #testimonialsList { grid-template-columns: repeat(2, 1fr); }
  .hero { min-height: 50vh; padding: 20px; }
  #rConceptPanel { right: 12px; left: 12px; width: auto; bottom: 80px; height: 55vh !important; }
  #rConceptToggle { right: 12px; bottom: 12px; }

  /* HEADER RESPONSIVE AVEC CTA SUR DEUX LIGNES */
  .header-inner {
    padding: 12px;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px 6px !important;
  }
  
  /* 1. Bouton Hamburger tout à gauche */
  .nav-toggle {
    display: inline-block !important;
    order: 1 !important;
    z-index: 1000001 !important;
    font-size: 26px !important;
    padding: 4px;
    margin-right: 4px;
  }
  
  /* 2. Titre du logo au milieu */
  .logo {
    order: 2 !important;
    flex: 1 1 auto !important;
  }
  
  .logo-text {
    font-size: 1.1rem !important;
    white-space: nowrap;
  }

  /* 3. Emplacement logo tout en haut à droite */
  .logo img, .logo-right-img, .header-inner > img {
    order: 3 !important;
    max-height: 32px !important;
    width: auto !important;
    display: block !important;
    margin-left: auto;
  }

  /* 4. Les boutons CTA passent proprement sur la ligne 2 */
  .cta { 
    display: flex !important; 
    order: 4 !important;
    width: 100% !important;
    gap: 8px !important;
    margin-top: 2px;
  }
  
  /* Équilibrage des deux boutons à 50/50 */
  .cta .btn {
    flex: 1 !important;
    text-align: center !important;
    padding: 10px 4px !important;
    font-size: 0.85rem !important;
    white-space: nowrap;
    border-radius: 6px;
  }

  /* DESIGN DU MENU DÉROULANT MOBILE (GRIS ET BLANC) */
  .site-header .main-nav {
    display: none; 
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--deep-gray) !important;
    z-index: 999999 !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border-bottom: 3px solid var(--gold);
  }

  /* Quand le JavaScript ajoute la classe .open */
  .site-header.open .main-nav,
  .site-header .main-nav.open {
    display: block !important;
  }

  /* Transformation de la liste en vertical */
  .site-header .main-nav ul {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 30px 0 !important;
    margin: 0 !important;
    gap: 15px !important;
    list-style: none !important;
  }
  
  .site-header .main-nav ul li {
    width: 100%;
    text-align: center;
  }

  /* Liens en blanc pur */
  .site-header .main-nav ul li a {
    font-size: 1.2rem !important;
    color: var(--white) !important;
    text-decoration: none !important;
    display: block !important;
    padding: 10px 0 !important;
    font-weight: 500 !important;
    opacity: 1 !important;
  }
  
  .site-header .main-nav ul li a:active {
    background-color: rgba(255, 255, 255, 0.08);
  }

  /* SÉCURITÉ CLICS FORMULAIRE */
  #contactSection, section {
    position: relative;
    clear: both;
  }
  #contactForm {
    position: relative;
    z-index: 999 !important;
    margin-top: 20px;
  }
  #contactForm input, 
  #contactForm select, 
  #contactForm textarea,
  #contactForm button {
    pointer-events: auto !important;
    font-size: 16px !important;
    padding: 14px 12px !important;
    position: relative;
    z-index: 1000 !important;
  }
  #contactForm input,
  #contactForm select,
  #contactForm textarea {
    background-color: #ffffff !important;
    color: #000000 !important;
  }
  #equipmentSelect {
    position: relative;
    z-index: 1010 !important;
    cursor: pointer;
    -webkit-appearance: none;
  }

  /* AJUSTEMENT RESPONSIVE BOUTON TÉLÉCHARGEMENT PDF */
  main .btn-gold[download] {
    display: flex !important;
    width: 100% !important;
    justify-content: center;
    align-items: center;
    padding: 14px 16px !important;
    font-size: 1rem !important;
  }
}

@media (max-width: 520px) {
  .catalog-grid { grid-template-columns: 1fr; }
  #testimonialsList { grid-template-columns: 1fr; }
  
  /* Adaptabilité parfaite du bandeau cookie sur petits écrans */
  #cookie-banner {
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    padding: 15px !important;
  }
}