html {
  scroll-behavior: smooth;
}

section.galerie {
  scroll-margin-top: 40px;
}

/* --- RESET GLOBAL ET BASES --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #FFFCF2;
  font-family: Arial, sans-serif;
  color: #333333;
  overflow-x: hidden;
  margin: 0;
}

h1 {
  color: black;
  text-align: center;
  font-size: 34px;
}

section.galerie h2, 
main h2 {
  font-family: 'Didot', 'Bodoni MT', 'Cinzel', serif;
  font-size: 1.6rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 5px;
  margin-top: 50px;
  margin-bottom: 30px;
  text-align: center;
  color: #1a1a1a;
}

h2 {
  font-size: 24px;
}

main p {
  margin-bottom: 8px;
  line-height: 1.2;
}

main {
  max-width: 1100px;
  width: 90%;
  margin: 20px auto;
  background-color: #FFFCF2;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

img {
  max-width: 100%;
  height: auto;
}

/* --- HEADER ET NAVIGATION --- */
header {
  background-color: #FAF0DE;
  padding: 15px 30px;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}

.logo {
  color: black;
  font-weight: bold;
  font-size: 1.2rem;
}

.logo img {
  height: 60px;
  width: auto;
  display: block;
}

h1 img {
  max-height: 300px;
  width: auto;
  display: block;
  margin: 0 auto;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

nav a {
  color: black;
  text-decoration: none;
  font-weight: 500;
  font-size: 17px;
}

nav a:hover {
  text-decoration: underline;
}

/* --- BARRE DE RECHERCHE --- */
.recherche-box {
  display: flex;
  align-items: center;
  background-color: #FFFCF2;
  border: 1px solid #dcd6cd;
  border-radius: 20px;
  padding: 4px 10px;
}

.recherche-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  padding: 4px;
  width: 130px;
}

.recherche-box button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}

/* --- GRILLE PRODUITS & CARTES --- */
.grille-produits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.carte {
  background-color: #FFFCF2;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.carte img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

.carte .contenu {
  padding: 15px;
}

.carte .contenu h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.carte .contenu p {
  margin: 0;
  color: #333333;
  line-height: 1.4;
  font-size: 0.95rem;
}

/* --- MODALE & CARROUSEL --- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

/* 2. Élargis légèrement la modale pour qu'elle respire mieux avec contain */
.modal-contenu {
  background-color: #FFFCF2;
  color: #1a1a1a;
  padding: 40px;
  border-radius: 4px;
  max-width: 650px;        /* Passé à 650px au lieu de 500px */
  width: 90%;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
  border: 1px solid #e0dcd3;
}

.modal-image-container {
  position: relative;
  margin-bottom: 15px;
}

/* 1. Modifie le comportement de l'image principale dans la modale */
#modal-image {
  width: 100%;
  max-height: 450px;       /* Augmente un peu la hauteur max si besoin */
  object-fit: contain;     /* Affiche l'image en entier sans la couper */
  border-radius: 4px;
  display: block;
  margin: 0 auto;          /* Centre l'image horizontalement */
}

.modal-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 252, 242, 0.8);
  border: none;
  font-size: 1.2rem;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 50%;
  color: #1a1a1a;
  transition: background-color 0.2s;
}

.modal-nav-btn:hover {
  background-color: #FAF0DE;
}

#modal-prev {
  left: 10px;
}

#modal-next {
  right: 10px;
}

#modal-titre {
  margin-top: 0;
  font-size: 1.5rem;
  color: #000000;
}

#modal-description {
  color: #333333;
  line-height: 1.6;
}

#btn-fermer {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  color: #1a1a1a;
  transition: opacity 0.2s;
}

#btn-fermer:hover {
  opacity: 0.5;
}

/* --- FOOTER ÉPURÉ & AÉRÉ --- */
footer {
  background-color: #FAF0DE;
  padding: 60px 20px 30px 20px;
  border-top: 1px solid #e6d7c3;
  margin-top: 80px;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section {
  flex: 1;
  min-width: 250px;
  text-align: center;
}

.footer-section h3 {
  font-family: 'Didot', 'Bodoni MT', 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 15px;
  color: #2b2b2b;
}

.footer-section p, 
.footer-section a {
  font-size: 0.9rem;
  color: #555555;
  line-height: 1.6;
  text-decoration: none;
}

.footer-section a:hover {
  color: #000000;
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.85rem;
  color: #777777;
}

/* --- MEDIA QUERIES --- */
@media (max-width: 900px) {
  .grille-produits {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

@media (max-width: 768px) {
  header {
    padding: 10px 15px;
    width: 100%;
  }

  nav {
    width: 100%;
    max-width: 100%;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }

  .logo img {
    height: 35px;
  }

  nav ul {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
  }

  nav a {
    font-size: 14px;
  }

  .recherche-box {
    padding: 2px 8px;
  }

  .recherche-box input {
    width: 70px;
    font-size: 12px;
  }

  h1 img {
    max-height: 150px;
  }
}

@media (max-width: 550px) {
  .grille-produits {
    grid-template-columns: 1fr;
  }
}

.footer-reseaux {
  display: flex;
  justify-content: center;
  gap: 25px;
}

.footer-reseaux a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #555555;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-reseaux a svg {
  stroke: #555555;
  transition: stroke 0.2s;
}

.footer-reseaux a:hover,
.footer-reseaux a:hover svg {
  color: #000000;
  stroke: #000000;
  text-decoration: none;
}

/* Alignement sur ordinateur */
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-principal,
.nav-secondaire,
.nav-secondaire ul {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Empêche "À propos" de se couper sur deux lignes */
nav a {
    white-space: nowrap;
}

/* --- VERSION MOBILE --- */
@media (max-width: 768px) {
    nav {
        flex-wrap: wrap;
        gap: 12px;
    }

    /* Ligne 1 : Accueil, Couture, Broderie, Autres */
    .nav-principal {
        width: 100%;
        justify-content: space-around;
        gap: 10px;
        font-size: 0.9rem;
    }

    /* Ligne 2 : À propos, Contact à gauche + Recherche à droite */
    .nav-secondaire {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }

    .nav-secondaire ul {
        gap: 15px;
        font-size: 0.9rem;
    }

    .recherche-box {
        max-width: 150px; /* Ajuste la largeur de la barre de recherche sur mobile */
    }
}