@charset "utf-8";

/* Import des polices personnalisées */
@font-face {
  font-family: 'Quicksand-Regular';
  src: url('../fonts/Quicksand-Regular.otf');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'big_noodle_titling';
  src: url('../fonts/big_noodle_titling.ttf');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Clien_logo';
  src: url('../fonts/Karstar_Free.ttf');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'AlegreyaSansSC-Light';
  src: url('../fonts/AlegreyaSansSC-Light.ttf');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Calligraffiti';
  src: url('../fonts/Calligraffiti.ttf');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Réinitialisation des styles */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Variables CSS pour les couleurs */
:root {
  --primary-color: #32568e; /* Vert foncé principal */
  --secondary-color: #819cc6; /* Vert clair pour les fonds */
  --accent-color: #ff9800; /* Orange pour les badges et mises en avant */
  --dark-color: #333; /* Couleur foncée pour texte et fonds */
  --light-color: #fff; /* Couleur claire pour texte sur fond foncé */
  --grey-light: #f9f9f9; /* Gris très clair pour les fonds alternés */
  --grey-medium: #eaeaea; /* Gris moyen pour les bordures */
  --grey-dark: #666; /* Gris foncé pour les textes secondaires */
  --font-primary: 'Quicksand-Regular', Arial, sans-serif;
  --font-title: 'AlegreyaSansSC-Light', sans-serif;
  --font-logo: 'Calligraffiti', serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--dark-color);
  background-color: var(--light-color);
  font-size: 1rem;
}

/* Conteneur principal */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.5em;
  line-height: 1.2;
}

p {
  margin-bottom: 1em;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

ul, ol {
  list-style-position: inside;
  margin-bottom: 1em;
}

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

.marginTop1rem{
  margin-top: 2rem;
}

/* En-tête - MODIFIÉ */
header {
  position: static; /* Changé de sticky à static */
  z-index: 1000;
}

.top-header {
  background-color: var(--primary-color);
  color: var(--light-color);
  padding: 8px 0;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1010;
}

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

.contact-top {
  font-weight: bold;
  background-color: #FFF;
  color: #32568e;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  transition: .25s ease-in-out;
}

.contact-top:hover {
  background-color: #ff9800;
  transition: .25s ease-in-out;
}

.contact-top a {
  color: #32568e;
  text-decoration: none;
}

.retour-haut img {
  max-width: 35px;
}

.retour-haut {
  color: var(--light-color);
  font-size: 0.8rem;
  text-decoration: none;
}

.main-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  margin-top: 110px;
  position: relative; /* Une seule déclaration position */
  min-height: 400px;
  background-image: url('../images/creation-de-toiture-chalon-sur-saone-71100.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* Modification du main-header pour prendre toute la largeur de l'écran */
.main-header.container {
  max-width: 100%;
  width: 100%;
  padding: 60px 0 30px 0;
  min-height: 50vh;
  flex-direction: column;
}
/* Conteneur pour centraliser le logo et les infos */
.header-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
/* Nous créons un container intérieur pour maintenir le contenu centré à 1200px */
.main-header-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}
/* Ajustement des éléments à l'intérieur du header pour les placer au-dessus de l'overlay */
.main-header .container,
.logo-container,
.header-info {
  position: relative;
  z-index: 2;
}
/* Modification de la couleur du texte pour améliorer la lisibilité sur l'image de fond */
.header-info h1,
.header-info .slogan {
  color: var(--light-color);
}
/* Ajout d'un overlay pour améliorer la lisibilité du texte sur l'image */
.main-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1;
}
.header-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}
/* Version réduite du header lors du scroll */
header.scrolled .main-header {
  padding: 10px 0;
}

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

/* Logo en position absolue */
.logo-container {
  position: relative;
  max-width: 180px;
  margin: 0 auto 30px auto;
  z-index: 2;
}

.logo-container img {
  width: 100%;
  height: auto;
  display: block;
}

header.scrolled .logo-container {
  max-width: 60px;
}

/* Header info occupe tout l'espace disponible et est centré */
.header-info {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.header-info h1 {
  font-family: 'big_noodle_titling';
  letter-spacing: 0.2rem;
  color: var(--light-color);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  margin-bottom: 10px;
  font-size: 4rem;
  width: 100%;
  text-align: center;
}

.slogan {
  font-family: var(--font-title);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary-color);
  margin-bottom: 10px;
  font-size: 1.1rem;
}
.header-info .slogan {
  color: var(--light-color);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  margin-bottom: 15px;
  font-size: 1.2rem;
  width: 100%;
  text-align: center;
}
.badge {
  display: inline-block;
  background-color: var(--accent-color);
  color: var(--light-color);
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
  font-size: 1.1rem;
}
.header-info .badge {
  color: var(--light-color);
  background-color: var(--accent-color);
  padding: 8px 20px;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: bold;
  display: inline-block;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  text-align: center;
}
.site-name .propre { color: #32568e; }
.site-name .toiture { color: #ff9800; }

/* Navigation - MODIFIÉ */
nav {
  flex: 1 0 100%;
  position: fixed;
  top: 41px;
  left: 0;
  width: 100%;
  background-color: var(--light-color);
  z-index: 1005;
  margin-top: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--grey-medium);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 30px;
  margin: 0;
}

nav ul li a {
  color: var(--dark-color);
  font-weight: bold;
  padding: 5px 0;
  position: relative;
}

nav ul li a:hover {
  color: var(--primary-color);
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

nav ul li a:hover::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
  z-index: 1020; /* MODIFIÉ - S'assurer que le bouton reste au-dessus */
}

.menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--dark-color);
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Styles pour le menu déroulant */
.dropdown {
  position: relative;
}

/* Style uniforme pour tous les éléments de liste */
nav ul li, nav ul li.dropdown {
  display: flex;
  align-items: center;
}

/* Style uniforme pour tous les liens */
nav ul li a, nav ul li.dropdown a.dropdown-toggle {
  display: inline-block;
  color: var(--dark-color);
  font-weight: bold;
  padding: 5px 0;
  position: relative;
}

nav ul li a:hover, nav ul li.dropdown a.dropdown-toggle:hover {
  color: var(--primary-color);
}

/* Animation du soulignement au survol pour tous les liens */
nav ul li a::after, nav ul li.dropdown a.dropdown-toggle::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

nav ul li a:hover::after, nav ul li.dropdown a.dropdown-toggle:hover::after {
  width: 100%;
}

/* Petite icône de flèche */
.dropdown-icon {
  font-size: 0.7rem;
  margin-left: 5px;
  position: relative;
  top: -1px; /* Ajustement vertical fin */
  transition: transform 0.3s;
}

/* Rotation de la flèche quand le menu est ouvert */
.dropdown.active .dropdown-icon {
  transform: rotate(180deg);
}

/* Styles du conteneur du menu déroulant */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background-color: var(--light-color);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  padding: 10px 0;
  margin-top: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1050;
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

/* État actif du menu déroulant */
.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Éléments de liste dans le menu */
.dropdown-menu li {
  margin: 0;
  width: 100%;
}

/* Liens dans le menu déroulant */
.dropdown-menu a {
  padding: 8px 15px;
  display: block;
  width: 100%;
  white-space: nowrap;
  color: var(--dark-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  font-weight: normal;
}

/* État au survol des liens du menu */
.dropdown-menu a:hover {
  background-color: var(--grey-light);
  color: var(--primary-color);
}

/* Section commune */
section {
  padding: 50px 0;
}
section p{
  text-align: justify;
}
section li{
  text-align: justify;
}
.section-title {
  font-family: var(--font-title);
  text-align: center;
  margin-bottom: 30px;
  color: var(--primary-color);
  position: relative;
  padding-bottom: 15px;
  text-transform: uppercase;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background-color: var(--primary-color);
}

/* Section Introduction */
#introduction {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--primary-color);
}

#introduction h2 {
  font-family: var(--font-title);
  font-size: 1.3rem;
  max-width: 800px;
  margin: 0 auto 30px;
  line-height: 1.4;
  color: var(--primary-color);
  text-transform: uppercase;
}

.intro-text {
  max-width: 800px;
  margin: 0 auto 20px;
  font-weight: bold;
}

/* Section Services */
#services {
  background-color: var(--grey-light);
}

.service-images {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
}

/* NOUVELLE STRUCTURE FLEXBOX UNIQUEMENT */
.desktop-view {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.desktop-view .img-primary {
  flex: 1 0 300px;
  min-height: 400px; /* Ajustez selon vos besoins */
}

.desktop-view .img-primary img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.desktop-view .img-secondary {
  flex: 1 0 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.desktop-view .img-secondary-top {
  flex: 1;
  height: 195px; /* Ajustez selon vos besoins */
}

.desktop-view .img-secondary-top img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.desktop-view .img-secondary-bottom {
  flex: 1;
  height: 195px; /* Ajustez selon vos besoins */
}

.desktop-view .img-secondary-bottom img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.service-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.service-description {
  text-align: justify;
  max-width: 800px;
  margin: 0 auto 30px;
}

.service-highlights {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-top: 30px;
}

.service-highlights p {
  flex: 1 0 calc(33.33% - 40px);
  max-width: calc(33.33% - 40px);
  padding: 15px 10px;
  background-color: var(--primary-color);
  color: var(--light-color);
  border-radius: 5px;
  text-align: center;
  font-weight: bold;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60px;
  -webkit-box-sizing: border-box; /* Ajouter pour Safari */
  box-sizing: border-box; /* Assurer compatibilité */
}

/* Section Déroulement */
.steps-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-top: 40px;
}

.step {
  flex: 1 0 200px;
  max-width: 250px;
  text-align: center;
  padding: 20px;
  border-bottom: 3px solid var(--primary-color);
  background-color: var(--grey-light);
  border-radius: 5px;
  transition: transform 0.3s ease;
}

.step:hover {
  transform: translateY(-5px);
}

.step h3 {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.cta-button {
  display: inline-block;
  background-color: var(--dark-color);
  color: var(--light-color);
  padding: 12px 25px;
  border-radius: 30px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.cta-button:hover {
  background-color: var(--accent-color);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Section Rachat */
#rachat {
  background-color: var(--secondary-color);
  color: var(--light-color);
}
#rachat .section-title {
  color: var(--light-color);
}

#rachat .section-title::after {
  background-color: var(--light-color);
}

/* Section Recyclage */
/* Section Démarches */
#recyclage {
  background-color: var(--grey-light);;
}

#recyclage .section-title::after {
  background-color: var(--primary-color);
}

#recyclage a {
  color: var(--light-color);
}

#recyclage .cta-button {
  background-color: var(--dark-color);
}
#zones {
  text-align: center;
}

.zones-description {
  max-width: 800px;
  margin: 0 auto 30px;
}

.zones-info {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px;
}

.zones-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}

.zone-badge {
  background-color: var(--secondary-color);
  color: var(--light-color);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: bold;
  flex: 0 1 auto;
  /* Empêche les badges de s'étirer */
  white-space: nowrap;
  /* Évite les retours à la ligne dans les badges */
}

.zones-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--primary-color);
  font-weight: bold;
  text-decoration: underline;
  transition: color 0.3s ease;
}

/* Pages d'erreur */
#error-page {
  padding: 80px 0;
  background-color: var(--grey-light);
}

.error-content {
  text-align: center;
  background-color: var(--light-color);
  padding: 50px 30px;
  border-radius: 8px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
  max-width: 800px;
  margin: 0 auto;
}

.error-code {
  font-size: 8rem;
  font-weight: bold;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 20px;
  font-family: var(--font-title);
}

.error-content h2 {
  font-family: var(--font-title);
  color: var(--dark-color);
  margin-bottom: 20px;
}

.error-content p {
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.error-content a {
  color: var(--primary-color);
  font-weight: bold;
  transition: color 0.3s ease;
}

.error-content a:hover {
  color: var(--dark-color);
  text-decoration: underline;
}

.suggestions, .error-contact {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--grey-medium);
  text-align: left;
}

.suggestions h3, .error-contact h3 {
  margin-bottom: 15px;
  color: var(--primary-color);
}

.suggestions ul, .error-contact ul {
  list-style: none;
  padding-left: 0;
}

.suggestions ul li, .error-contact ul li {
  margin-bottom: 10px;
  padding-left: 20px;
  position: relative;
}

.suggestions ul li:before, .error-contact ul li:before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--primary-color);
}

/* Page Zones Détaillées */
#zones-detail {
  background-color: var(--grey-light);
}

.zones-description {
  text-align: justify;
  max-width: 800px;
  margin: 0 auto 40px;
}

.zones-regions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
}

.zone-region {
  flex: 1 0 200px;
  max-width: 300px;
  background-color: var(--secondary-color);
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  color: var(--light-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.zone-region h3 {
  margin-bottom: 10px;
  color: var(--light-color);
}

.zone-region a {
  display: inline-block;
  background-color: var(--light-color);
  color: var(--primary-color);
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
  transition: all 0.3s ease;
}

.zone-region a:hover {
  background-color: var(--dark-color);
  color: var(--light-color);
}

.department-info h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
}

.departments-list {
  margin-top: 50px;
}

.department-block {
  padding: 30px;
  background-color: var(--light-color);
  border-radius: 8px;
  margin-bottom: 30px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.department-block:hover {
  transform: translateY(-5px);
}

.department-block.active {
  border-left: 5px solid var(--primary-color);
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.department-block h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-family: var(--font-title);
}

.department-block ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 10px 30px;
  margin-top: 15px;
}

.department-block ul li {
  flex: 0 0 calc(33.333% - 20px);
  position: relative;
  padding-left: 15px;
}

.department-block ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary-color);
}

.contact-zones {
  text-align: center;
  padding: 30px;
  background-color: var(--secondary-color);
  color: var(--light-color);
  border-radius: 8px;
  margin-top: 50px;
}

.contact-zones h3 {
  margin-bottom: 15px;
  font-family: var(--font-title);
}

.contact-zones .cta-button {
  margin-top: 20px;
}

/* Page Mentions Légales */
#mentions-legales {
  background-color: var(--grey-light);
}

.legal-content {
  background-color: var(--light-color);
  padding: 30px;
  border-radius: 8px;
  margin-bottom: 40px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.legal-content h3 {
  color: var(--primary-color);
  margin: 25px 0 15px;
  font-family: var(--font-title);
}

.legal-content h3:first-of-type {
  margin-top: 0;
}

.legal-content p {
  margin-bottom: 15px;
}

.legal-content address {
  font-style: normal;
  margin-bottom: 20px;
  padding: 15px;
  background-color: var(--grey-light);
  border-radius: 5px;
  line-height: 1.8;
}

.zones-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.zone {
  flex: 1 0 200px;
  max-width: 250px;
  padding: 20px;
  background-color: var(--grey-light);
  border-radius: 5px;
  transition: transform 0.3s ease;
}

.zone:hover {
  transform: translateY(-5px);
}

.zone h3 {
  color: var(--primary-color);
  margin-bottom: 10px;
}

/* Section Démarches */
#demarches {
  background-color: var(--grey-light);
}

#demarches .section-title::after {
  background-color: var(--primary-color);
}

.demarches-content {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  align-items: center;
}

.demarches-content img {
  flex: 1 0 400px;
  max-width: 500px;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.demarches-text {
  flex: 1 0 400px;
}

.demarches-text h3 {
  font-family: var(--font-title);
  margin: 20px 0 15px;
  color: var(--primary-color);
}

.demarches-text ul {
  list-style-type: disc;
  margin-left: 20px;
}

.demarches-text ul li {
  margin-bottom: 10px;
}

/* Section Contact */
#contact {
  background-color: var(--grey-light);
}

.contact-content {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.contact-info {
  flex: 1 0 300px;
}

.contact-info h3 {
  color: var(--primary-color);
  margin-bottom: 20px;
}

.contact-details {
  margin-top: 20px;
  padding: 20px;
  background-color: var(--light-color);
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.contact-details p {
  margin-bottom: 10px;
}

.contact-form {
  width: 100%;
  max-width: 100%;
}

.form-group {
  width: 100%;
  box-sizing: border-box;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
  padding: 12px; /* Hauteur fixe pour les inputs */
  border: 1px solid var(--grey-medium);
  border-radius: 5px;
  background-color: var(--light-color);
  font-family: var(--font-primary);
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.2);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: #dc3545;
  background-color: rgba(220, 53, 69, 0.05);
}

.form-group input.error:focus,
.form-group select.error:focus,
.form-group textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.form-group.checkbox input {
  width: auto;
  margin-top: 4px;
}

.form-group.checkbox label {
  flex: 1;
  font-weight: normal;
  font-size: 0.9rem;
  margin: 0;
}

.form-submit {
  text-align: center;
  margin-top: 30px;
}

/* Alertes pour le formulaire */
.alert {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 5px;
  text-align: center;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Pied de page - version simplifiée */
footer {
  background-color: var(--dark-color);
  color: var(--light-color);
  padding: 15px 0;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 15px;
}

.footer-contact {
  flex: 1;
}

.footer-contact h3 {
  font-family: var(--font-title);
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--secondary-color);
  font-size: 1.1rem;
}

.footer-contact p {
  margin: 5px 0;
  font-size: 0.9rem;
}

/* Section footer-middle supprimée */
/* Classes .certifications et .certification-item supprimées */

.footer-bottom {
  padding-top: 10px;
  font-size: 0.8rem;
}

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

.legal-links {
  display: flex;
  list-style: none;
  gap: 15px;
}

.legal-links a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s ease;
}

.legal-links a:hover {
  color: var(--light-color);
}

/* Animations */
.animate-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-section.in-view {
  opacity: 1;
  transform: translateY(0);
}

.step, .zone, .service-highlights p {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.step.in-view, .zone.in-view, .service-highlights p.in-view {
  opacity: 1;
  transform: translateY(0);
}
.step.in-view p{
  text-align: center;
}
/* Décalage des animations pour effet cascade */
.step:nth-child(2), .zone:nth-child(2), .service-highlights p:nth-child(2) {
  transition-delay: 0.1s;
}

.step:nth-child(3), .zone:nth-child(3), .service-highlights p:nth-child(3) {
  transition-delay: 0.2s;
}

.step:nth-child(4), .zone:nth-child(4), .service-highlights p:nth-child(4) {
  transition-delay: 0.3s;
}

/* Ajout des styles pour le slider */
/* Style de base pour desktop et mobile */
.mobile-view {
  display: none;
}

/* Styles pour le slider */
.img-slider {
  flex: 1 0 100%;
}

.slider-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.slider-wrapper {
  display: flex;
  transition: transform 0.5s ease;
  min-height: 250px;
}

.slide {
  flex: 0 0 100%;
  width: 100%;
}

.slide img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 5px;
  max-width: 100%; /* Assurer la compatibilité avec Safari */
}

/* Styles spécifiques pour l'image du centre VHU */
.slide:last-child {
  background-color: white; /* Fond blanc */
  display: flex;
  justify-content: center;
  align-items: center;
  height: 250px; /* Hauteur fixe identique aux autres slides */
}

.slide:last-child img {
  object-fit: contain;
  height: auto;
  max-height: 220px;
  width: auto;
  max-width: 90%;
}

.slider-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.05);
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--grey-medium);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.dot.active {
  background-color: var(--primary-color);
}

.prev-slide, .next-slide {
  background-color: var(--primary-color);
  color: var(--light-color);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.prev-slide:hover, .next-slide:hover {
  background-color: var(--accent-color);
}

/* Styles harmonisés pour gérer l'espacement des ancres */

/**
 /* Styles pour gérer l'espacement des ancres */

/* Règle pour mobile (par défaut) */
section#demarches,
section#rachat,
section#recyclage,
section#zones {
  scroll-margin-top: 40px !important;
}

section#demarches::before,
section#rachat::before,
section#recyclage::before,
section#zones::before {
  content: "";
  display: block;
  height: 0;
  margin-top: -40px;
  padding-top: 40px;
  visibility: hidden;
  pointer-events: none;
}

/* Transition douce pour les changements */
section[id]::before {
  transition: margin-top 0.3s ease, padding-top 0.3s ease;
}

section[id] {
  transition: scroll-margin-top 0.3s ease;
}
section:first-of-type.animate-section {
    opacity: 1;
    transform: translateY(0);
}

/* Conteneur de la carte Google Maps */
.map-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    height: 0;
}

/* Rendre l'iframe responsive */
.map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/*page realisations*/
/* Section Réalisations */
#realisations {
    background-color: var(--grey-light);
    padding: 50px 0;
}

.section-description {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
}

.gallery-container {
    margin: 30px 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-frame {
    border-radius: 8px;
    padding: 10px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.gallery-frame img {
    cursor: pointer;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.gallery-frame img:hover {
    opacity: 0.9;
}

.gallery-caption {
    margin-top: 10px;
    text-align: center;
    font-weight: bold;
    color: var(--primary-color);
}

.gallery-info {
    text-align: center;
    margin-top: 40px;
}

.gallery-info p {
    max-width: 600px;
    margin: 0 auto 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1100;
    padding: 20px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    background-color: transparent;
    margin: auto;
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border: 5px solid var(--light-color);
    border-radius: 5px;
}

.modal-caption {
    color: var(--light-color);
    margin-top: 15px;
    text-align: center;
    font-size: 1.2rem;
    width: 100%;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--light-color);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1110;
}

.modal-prev, .modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--light-color);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 1110;
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-prev:hover, .modal-next:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* ------------------------------------------------ */
/* MEDIA QUERIES - Regroupés par taille d'écran */
/* ------------------------------------------------ */

/* Écrans larges et ordinateurs de bureau */
@media (min-width: 769px) {
  section#demarches,
  section#rachat,
  section#recyclage,
  section#zones {
    scroll-margin-top: 95px !important;
  }
  
  section#demarches::before,
  section#rachat::before,
  section#recyclage::before,
  section#zones::before {
    margin-top: -95px;
    padding-top: 95px;
  }
}

/* Écrans moyens (tablettes) */
@media (min-width: 769px) and (max-width: 992px) {
  .dropdown-menu {
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
  }
  
  .dropdown.active .dropdown-menu {
    transform: translateX(-50%) translateY(0);
  }
}

/* Grands écrans aux petits écrans (992px et moins) */
@media (max-width: 992px) {
  .header-info h1 {
    font-size: 3rem;
  }
  
  .step, .zone {
    flex: 0 0 calc(50% - 15px);
    max-width: calc(50% - 15px);
  }
  
  .service-highlights p {
    flex: 1 0 calc(33.33% - 20px);
    max-width: calc(33.33% - 20px);
  }

  /* Réalisations */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablettes et mobiles (768px et moins) */
@media (max-width: 768px) {
  /* Navigation sur mobile */
  nav {
    height: 0; /* Supprime l'espace vertical */
    background-color: transparent; /* Rend le fond transparent */
    box-shadow: none; /* Supprime l'ombre */
    border-bottom: none; /* Supprime la bordure */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    overflow: visible; /* Pour que le menu toggle reste visible */
  }
  
  /* Masquer le menu par défaut sur mobile */
  nav ul {
    display: none; /* Initialement masqué */
    flex-direction: column;
    width: 100%;
    text-align: center;
    padding: 20px 0;
    background-color: var(--light-color);
    position: fixed;
    top: 41px; /* Juste en dessous de la barre supérieure */
    left: 0;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
    border-top: 1px solid var(--grey-medium);
  }
  
  /* Afficher le menu uniquement lorsqu'actif */
  nav ul.active {
    display: flex;
    animation: fadeIn 0.3s ease;
  }
  
.main-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  margin-top: 110px;
  position: relative; /* Une seule déclaration position */
  min-height: 400px;
  background-image: url('../images/creation-de-toiture-chalon-sur-saone-71100.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
  
  .header-wrapper {
    flex-direction: column; /* Forcer la disposition en colonne */
    align-items: center;
    width: 100%;
    order: -1; /* Assurer que le wrapper apparaît en premier */
  }
  
  .main-header.container {
    min-height: 45vh;
    padding: 40px 0 20px 0;
    flex-direction: column; /* S'assurer que la disposition est en colonne */
    margin-top: 36px;
  }
  
  .header-info h1 {
    font-size: 2.7rem;
  }
  
  .header-info .slogan {
    font-size: 1rem;
  }
  
  .menu-toggle {
    display: flex;
    position: fixed;
    top: 10px;
    right: 20px;
    z-index: 1100;
  }
  
  /* Position du dropdown parent */
  nav ul li.dropdown {
    display: flex;
    flex-direction: column; /* Afficher en colonne pour que le menu soit sous le lien */
    align-items: center;
    width: 100%;
  }
  
  /* Le lien "Nos services" prend toute la largeur */
  nav ul li.dropdown a.dropdown-toggle {
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
  }
  
  /* Style du menu sur mobile */
  .dropdown-menu {
    position: static;
    width: 100%;
    min-width: 100%;
    box-shadow: none;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 0;
    padding: 0;
    margin: 0;
    opacity: 1;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transform: none;
    transition: max-height 0.3s ease;
  }
  
  /* État actif du menu sur mobile */
  .dropdown.active .dropdown-menu {
    visibility: visible;
    max-height: 300px;
    padding: 5px 0;
    margin-top: 5px;
  }
  
  /* Items du menu déroulant */
  .dropdown-menu li {
    width: 100%;
  }
  
  .dropdown-menu a {
    padding: 8px 30px;
    text-align: center;
    width: 100%;
  }
  
  /* Centrer les éléments sur mobile */
  nav ul li {
    justify-content: center;
    margin: 10px 0;
  }
  
  /* Sur mobile, adapter le style des liens */
  nav ul li a {
    text-align: center;
  }
  
  /* Gérer l'affichage du menu déroulant quand le menu principal est ouvert */
  nav ul.active .dropdown-menu {
    display: none;
  }
  
  nav ul.active .dropdown.active .dropdown-menu {
    display: flex;
  }
  
  /* Désactiver l'animation de soulignement sur mobile */
  nav ul li a::after, nav ul li.dropdown a.dropdown-toggle::after {
    display: none;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  /* Masquer le bouton "retour-haut" lorsque le menu mobile est affiché */
  #retour-haut {
    display: none;
  }
  
  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
  
  .logo-container {
    max-width: 150px;
    margin: 0 auto 20px auto;
    display: block;
    order: -1; /* S'assurer que le logo est avant le texte */
  }
  
  
  .header-info {
    width: 100%;
    text-align: center;
    order: 0; /* S'assurer que les infos sont après le logo */
  }
  
  .main-header nav {
    width: 100%;
    margin-top: 20px;
    order: 1; /* S'assurer que la navigation est en dernier */
  }
  
  .demarches-content {
    flex-direction: column;
  }
  
  .step, .zone {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .service-highlights p {
    flex: 1 0 100%;
    max-width: 100%;
  }
  
  .footer-bottom .container {
    flex-direction: column;
    gap: 10px;
  }
  
  .legal-links {
    margin-top: 5px;
  }

  /* Ajustements pour les réalisations */
  .gallery-frame {
    height: 200px;
  }
  
  .demarches-content img {
    flex: 1 0 100%;
    max-width: 100%;
    height: auto !important; /* Force la hauteur à s'adapter à la largeur */
    max-height: 400px; /* Limite la hauteur maximale */
    object-fit: cover; /* Assure que l'image couvre bien l'espace */
    aspect-ratio: 4/3; /* Maintient un ratio d'aspect constant */
  }
}

/* Tablettes de petite taille et mobiles (660px et moins) */
@media (max-width: 660px) {
  .mobile-view {
    display: block;
  }
  
  .desktop-view {
    display: none;
  }
}

/* Petits écrans mobiles (576px et moins) */
@media (max-width: 576px) {
  .service-highlights {
    flex-direction: column;
    align-items: center;
  }
  
  .service-highlights p {
    width: 100%;
  }
  
  #introduction h2 {
    font-size: 1.1rem;
  }
  
  .main-header {
    min-height: 250px;
    padding: 40px 0;
  }
  
  .logo-container {
    max-width: 80px;
    margin-bottom: 0px;
  }
  
  .header-info h1 {
    font-size: 2.4rem;
  }
  
  .header-info .slogan {
    font-size: 0.8rem;
  }
  
  .header-info .badge {
    font-size: 0.7rem;
    padding: 2px 8px;
  }
  
  .top-header .container {
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }
  
  .contact-top {
    font-size: 1rem;
  }
  
  .demarches-content img {
    flex: 1 0 100%; /* Permet à l'image de prendre 100% de la largeur */
    max-width: 100%; /* Limite la largeur maximale à 100% du conteneur */
  }
  
  /* Ajustement des marges pour les sections sur mobile */
  .demarches-content {
    margin: 0 10px;
  }
  
  /* Ajuster l'espacement entre l'image et le texte */
  .demarches-text {
    margin-top: 20px;
  }
  
  .main-header.container {
    min-height: 40vh;
    padding: 30px 0 20px 0;
  }
  
  .logo-container {
    max-width: 120px;
    margin-bottom: 15px;
  }
  
  .header-info h1 {
    font-size: 2.4rem;
  }
  
  .header-info .slogan {
    font-size: 0.9rem;
  }
  
  .header-info .badge {
    font-size: 0.8rem;
    padding: 6px 15px;
  }

  /* Réalisations */
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .gallery-frame {
    height: 220px;
  }
  
  .modal-prev, .modal-next {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}

/* Très petits écrans mobiles (517px et moins) */
@media (max-width: 517px) {
  .zone-badge {
    flex-basis: calc(100% - 10px);
    /* Un badge par ligne pour les très petits écrans */
    max-width: 100%;
  }
}

/* Très petits écrans mobiles (smartphones compacts) (360px et moins) */
@media (max-width: 360px) {
  .logo-container {
    max-width: 115px;
  }
  
  .header-info h1 {
    font-size: 2.4rem;
  }
  
  .header-info .slogan {
    font-size: 0.7rem;
  }
  
  .header-info .badge {
    font-size: 0.6rem;
    padding: 2px 6px;
  }
  
  .menu-toggle {
    transform: scale(0.9);
    top: 10px;
    right: 10px;
  }
  
  .zone-region {
    flex: 0 0 100%;
  }
  
  .contact-content {
    flex-direction: column;
    gap: 15px;
  }
  
  .contact-info, 
  .contact-form {
    flex: 1 0 100%;
    width: 100%;
    max-width: 100%;
  }
  
  .form-group {
    margin-bottom: 15px;
  }
  
  .form-group label {
    font-size: 0.9rem;
  }
  
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 8px;
    font-size: 0.9rem;
  }
  
  .form-group.checkbox {
    align-items: flex-start;
  }
  
  .form-group.checkbox label {
    font-size: 0.8rem;
  }
  
  /* Correction pour le container */
  .container {
    padding: 0 10px;
  }
  
  /* Ajustement pour la carte Google Maps */
  .map-container {
    padding-bottom: 75%; /* Ratio plus élevé pour les petits écrans */
  }
}

/* Ajustements pour les écrans extrêmement petits (320px et moins) */
@media (max-width: 320px) {
  .container {
    padding: 0 5px;
  }
  
  .form-group label {
    font-size: 0.85rem;
  }
  
  .form-group input,
  .form-group textarea {
    padding: 6px;
    font-size: 0.85rem;
  }
  
  .cta-button {
    padding: 10px 15px;
    font-size: 0.85rem;
  }
  
  .contact-details p {
    font-size: 0.85rem;
  }
}


/*Safari*/
@supports (-webkit-touch-callout: none) {
  .demarches-content img {
    height: auto !important;
    max-height: 400px;
    width: 100%;
    object-fit: cover;
  }
}