* {
  box-sizing: border-box;
}

:root {
  --header-height: 70px;
}

body {
  font-family: 'Playfair Display', serif;
  color: var(--text-dark);
  background-color: #F6F2EA;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

html, body {
  max-width: 100%;
  scroll-behavior: smooth;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover,
a:focus {
  color: var(--secondary);
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

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

.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: var(--text-light);
  padding: 8px;
  text-decoration: none;
  z-index: 9999;
}

.skip-to-content:focus {
  top: 0;
}

#header {
  background: #151C30;
  padding: 15px 0;
  position: fixed;
  width: 100%;
  z-index: 999;
  transition: all 0.3s ease;
  top: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

#header .logo a {
  color: var(--text-light);
  font-size: 28px;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 1px;
}

#header .navbar ul {
  display: flex;
  list-style: none;
  gap: 20px;
  margin: 0;
  padding: 0;
}

#header .navbar a {
  color: var(--text-light);
  font-weight: 500;
  position: relative;
  padding: 5px 10px;
  transition: all 0.3s ease;
}

#header .navbar a:focus {
  outline: 2px solid var(--text-light);
  outline-offset: 4px;
}

#header .navbar a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--text-light);
  transition: width 0.3s ease;
}

#header .navbar a:hover::after,
#header .navbar .active::after {
  width: 100%;
}

#hero {
  background: linear-gradient(var(--hero-overlay, rgba(0,0,0,0.4)),
                              var(--hero-overlay, rgba(0,0,0,0.4))),
              var(--hero-bg-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  align-items: center;
  color: var(--hero-text-color, #ffffff);
  padding-top: 120px;  
}
@media (max-width: 768px) {
  #hero {
    padding-top: 240px;
  }
}

@media (max-width: 576px) {
  #hero {
    padding-top: 240px;
  }
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  line-height: 1.2;
}

.hero-content .hero-subtitle {
  font-size: 1.4rem;
  margin-bottom: 30px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  line-height: 1.5;
}

.btn-get-started {
  background: var(--primary);
  color: var(--text-light);
  padding: 12px 30px;
  border-radius: 50px;
  border: 2px solid var(--primary);
  transition: all 0.3s ease;
  display: inline-block;
  font-weight: 600;
  cursor: pointer;
}

.btn-get-started:hover,
.btn-get-started:focus {
  background: transparent;
  border-color: var(--text-light);
  color: var(--text-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.hero-img-container {
  position: relative;
  text-align: center;
}

.hero-img {
  max-width: 100%;
  height: auto;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.hero-float {
  position: relative;
  display: inline-block;
  margin-top: 30px;
  width: 300px;
  z-index: 2;
}

.hero-float img {
  width: 100%;
  height: auto;
  border-radius: 15px;
  animation: float-slow 6s ease-in-out infinite;
  box-shadow: 0 15px 40px rgba(0,0,0,0.3);
  transition: transform 0.3s ease;
}

.hero-float img:hover {
  transform: scale(1.05);
  animation-play-state: paused;
}

@keyframes float-slow {
  0% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}

section {
  padding: 80px 0;
  background-color: transparent;
}

.section-bg {
  background: #F2EBE0;
  color: var(--text-dark);
}

.section-title {
  text-align: center;
  margin-bottom: 50px;
}

.section-title h2 {
  font-size: 2.5rem;
  color: var(--menu-title-color);
  margin-bottom: 15px;
  font-weight: 700;
}

.section-title p {
  font-size: 1.2rem;
  color: var(--menu-subtitle-color);
}

section p,
.produit-description,
.contact-info p,
.atelier-content p {
  font-size: 1.15rem;
  line-height: 1.75;
}

.produits-grid {
  display: grid;
  gap: 30px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.produit-card {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.produit-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.produit-card:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

.produit-card h3,
.produit-body h3 {
  color: var(--primary);
  font-size: 1.45rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.produit-description,
.produit-body p {
  flex-grow: 1;
  margin-bottom: 20px;
  color: var(--text-dark);
  font-size: 1.12rem;
  line-height: 1.7;
}

.produit-footer {
  margin-top: auto;
}

.btn-commander {
  background: var(--primary);
  border: 2px solid var(--primary);
  color: var(--text-light);
  padding: 12px 25px;
  border-radius: 30px;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: inline-block;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  text-align: center;
}

.btn-commander:hover,
.btn-commander:focus {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.atelier-gallery {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.atelier-gallery img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.atelier-gallery img:hover {
  transform: scale(1.05);
}

.contact-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.contact-info h3 {
  color: var(--primary);
  font-size: 1.8rem;
  margin-bottom: 20px;
  font-weight: 600;
}

.contact-info h4 {
  color: var(--primary);
  font-size: 1.3rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.contact-info i {
  color: var(--primary);
  width: 20px;
  margin-right: 8px;
}

.contact-info address {
  font-style: normal;
  line-height: 1.8;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  background: var(--primary);
  color: var(--text-light);
  border-radius: 50%;
  transition: all 0.3s ease;
  margin-right: 15px;
  font-size: 1.2rem;
}

.social-links a:hover,
.social-links a:focus {
  background: var(--secondary);
  transform: translateY(-3px);
}

.horaires {
  margin-top: 30px;
}

.horaires h4 {
  margin-bottom: 15px;
  color: var(--primary);
  font-size: 1.3rem;
}

.horaires ul {
  list-style: none;
  padding: 0;
}

.horaires li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 0;
}

.jour {
  font-weight: 600;
}

.contact-map iframe {
  width: 100%;
  height: 300px;
  border: none;
  border-radius: 15px;
}

#footer {
  background: var(--text-dark);
  color: var(--text-light);
  text-align: center;
  padding: 30px 0;
}

#footer a {
  color: var(--text-light) !important;
  transition: color 0.3s ease;
}

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

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 999;
  cursor: pointer;
}

.back-to-top.active {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover,
.back-to-top:focus {
  background: var(--secondary);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.extrait-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
}

.extrait-modal.open {
  display: flex;
}

.extrait-modal-content {
  background: #ffffff;
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.25);
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.extrait-modal-close {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  float: right;
  cursor: pointer;
  transition: transform 0.2s ease;
  padding: 4px 8px;
}

.extrait-modal-close:hover,
.extrait-modal-close:focus {
  transform: rotate(90deg);
  outline: 2px solid var(--primary);
  border-radius: 4px;
}

.extrait-modal h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--primary);
  clear: both;
}

#extrait-modal-body {
  white-space: pre-line;
  font-size: 1.05rem;
  line-height: 1.8;
}

.recueil-images {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: nowrap;
  margin: 0 auto;
  padding: 0 15px;
}

.livre-visuel {
  flex: 0 1 auto;
  max-width: 280px;
  width: 100%;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 15px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.livre-visuel:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.livre-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 400px;
  border-radius: 12px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.livre-image:hover {
  transform: scale(1.02);
}

button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .hero-float img {
    animation: none;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  #hero {
    min-height: auto;
    padding-top: 180px;
    padding-bottom: 30px;
  }
  
  .hero-content h1 {
    font-size: 2rem;
    margin-bottom: 10px;
  }
  
  .hero-content .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 15px;
  }
  
  .hero-float {
    width: 180px;
    margin-top: 10px;
  }
  
  section {
    padding: 40px 0;
  }
  
  .recueil-images {
    gap: 10px;
  }
  
  .livre-visuel {
    max-width: 160px;
  }
  
  .livre-image {
    max-height: 240px;
  }
}

@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
  #header {
    padding: 5px 0;
  }
  
  #hero {
    padding-top: 220px;
    padding-bottom: 20px;
  }
  
  .hero-content h1 {
    font-size: 1.6rem;
    margin-bottom: 8px;
  }
  
  .hero-content .hero-subtitle {
    font-size: 0.9rem;
    margin-bottom: 12px;
  }
  
  .hero-float {
    width: 150px;
  }
  
  .btn-get-started {
    padding: 8px 20px;
    font-size: 0.85rem;
  }
}

@media (max-width: 576px) and (orientation: landscape) {
  #hero {
    padding-top: 220px;
  }
}

@media (max-width: 400px) and (orientation: landscape) {
  #hero {
    padding-top: 220px;
  }
}

.produit-card,
.hero-float img,
.livre-image {
  will-change: transform;
}

.produit-card:hover,
.hero-float img:hover,
.livre-image:hover {
  will-change: transform;
}

@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  
  .hero-content h1 {
    font-size: 3.5rem;
  }
  
  .livre-visuel {
    max-width: 320px;
  }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  .container {
    max-width: 1140px;
  }
  
  .livre-visuel {
    max-width: 300px;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .container {
    max-width: 960px;
  }
  
  .hero-content h1 {
    font-size: 2.8rem;
  }
  
  .hero-content .hero-subtitle {
    font-size: 1.3rem;
  }
  
  .livre-visuel {
    max-width: 280px;
  }
  
  .recueil-images {
    gap: 15px;
  }
}

@media (max-width: 991px) {
  #hero {
    background-attachment: scroll;
    min-height: auto;
    padding-top: 220px;
    padding-bottom: 60px;
  }
  
  section {
    padding: 60px 0;
  }
  
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .hero-content .hero-subtitle {
    font-size: 1.2rem;
  }
  
  .section-title h2 {
    font-size: 2.2rem;
  }
  
  .livre-visuel {
    max-width: 240px;
  }
  
  .recueil-images {
    gap: 15px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 140px;
  }

  .header-container {
    flex-direction: column;
    gap: 10px;
    padding: 10px 20px;
  }

  #header .navbar ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 15px;
  }
  
  #header .navbar a {
    font-size: 0.9rem;
    padding: 5px 10px;
  }

  #header .logo a {
    font-size: 24px;
  }

  #hero {
    padding-top: calc(var(--header-height) + 80px);
    padding-bottom: 50px;
    text-align: center;
  }

  #hero .row {
    flex-direction: column;
  }

  .hero-content {
    margin-bottom: 30px;
  }

  .hero-content h1 {
    font-size: 2.2rem;
    margin-bottom: 15px;
  }

  .hero-content .hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 20px;
  }

  .btn-get-started {
    padding: 10px 25px;
    font-size: 0.95rem;
  }

  .hero-float {
    width: 260px;
    margin: 20px auto 0;
  }

  section {
    padding: 50px 0;
  }
  
  .section-title h2 {
    font-size: 2rem;
  }
  
  .section-title p {
    font-size: 1.1rem;
  }

  .produits-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 15px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 0 15px;
  }

  .recueil-images {
    flex-wrap: nowrap;
    gap: 12px;
    padding: 0 10px;
  }

  .livre-visuel {
    max-width: 200px;
    padding: 12px;
  }
  
  .livre-image {
    max-height: 280px;
  }
  
  section p,
  .produit-description,
  .contact-info p {
    font-size: 1.1rem;
    line-height: 1.7;
  }
}

@media (max-width: 576px) {
  :root {
    --header-height: 160px;
  }

  #header {
    padding: 10px 0;
  }
  
  .header-container {
    padding: 8px 15px;
  }

  #header .logo a {
    font-size: 20px;
  }

  #header .navbar ul {
    gap: 8px 12px;
  }
  
  #header .navbar a {
    font-size: 0.85rem;
    padding: 4px 8px;
  }

  #hero {
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 40px;
  }

  .hero-content h1 {
    font-size: 1.8rem;
    margin-bottom: 12px;
    line-height: 1.3;
  }

  .hero-content .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 18px;
    line-height: 1.5;
  }

  .btn-get-started {
    padding: 10px 22px;
    font-size: 0.9rem;
  }

  .hero-float {
    width: 220px;
  }

  section {
    padding: 40px 0;
  }
  
  .section-title {
    margin-bottom: 30px;
  }

  .section-title h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
  }
  
  .section-title p {
    font-size: 1rem;
  }

  .recueil-images {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .livre-visuel {
    max-width: 100%;
    width: 90%;
    max-width: 320px;
  }
  
  .livre-image {
    max-height: 450px;
  }

  .produit-card {
    padding: 20px;
  }
  
  .produit-card h3 {
    font-size: 1.3rem;
  }

  section p,
  .produit-description,
  .contact-info p {
    font-size: 1.05rem;
    line-height: 1.6;
  }
  
  .contact-info h3 {
    font-size: 1.5rem;
  }
  
  .contact-info h4 {
    font-size: 1.2rem;
  }
  
  .btn-commander {
    padding: 10px 20px;
    font-size: 0.9rem;
    width: 100%;
    max-width: 300px;
  }
  
  .extrait-modal-content {
    width: 95%;
    padding: 20px;
  }
  
  #extrait-modal-body {
    font-size: 1rem;
    line-height: 1.7;
  }
}

@media (max-width: 400px) {
  #header .logo a {
    font-size: 18px;
  }

  #header .navbar a {
    font-size: 0.8rem;
    padding: 3px 6px;
  }

  #hero {
    padding-top: 220px;
  }

  .hero-content h1 {
    font-size: 1.6rem;
  }

  .hero-content .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-float {
    width: 200px;
  }

  .section-title h2 {
    font-size: 1.6rem;
  }

  .livre-visuel {
    width: 100%;
    max-width: 280px;
  }
  
  .livre-image {
    max-height: 400px;
  }

  .btn-get-started {
    padding: 8px 20px;
    font-size: 0.85rem;
  }
  
  section p,
  .produit-description,
  .contact-info p {
    font-size: 1rem;
  }
}

@media (max-width: 360px) {
  #header .logo a {
    font-size: 16px;
  }
  
  #header .navbar ul {
    gap: 6px 8px;
  }

  #header .navbar a {
    font-size: 0.75rem;
    padding: 3px 5px;
  }

  .hero-content h1 {
    font-size: 1.4rem;
  }

  .hero-content .hero-subtitle {
    font-size: 0.9rem;
  }

  .hero-float {
    width: 180px;
  }

  .section-title h2 {
    font-size: 1.5rem;
  }
  
  .livre-visuel {
    width: 100%;
    max-width: 260px;
  }
  
  section {
    padding: 35px 0;
  }
}