/* ============================================================
   Le Coin des Saveurs — Mini Salés & Pâtisserie, Meknès
   Direction artistique : éditorial / luxe / magazine
   Crème papier · serif Didot (Cormorant) · filets fins
   ============================================================ */

:root {
  --bg: #F7F2E3;               /* papier crème chaud */
  --bg-deep: #EFE8D4;          /* crème légèrement plus foncée */
  --ink: #111820;              /* noir bleuté très foncé */
  --ink-soft: rgba(17, 24, 32, 0.68);
  --ink-faint: rgba(17, 24, 32, 0.42);
  --line: rgba(17, 24, 32, 0.14);   /* filet éditorial */
  --choco: #4A2A18;            /* brun chocolat profond pour le titre */
  --choco-soft: #5C3A21;       /* chocolat plus clair pour le hover */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);   /* ease-out premium */
  --sage: #8a947f;             /* vert sauge très doux */
  --sage-deep: #5c6652;
  --cream: #F7F2E3;
  --serif: "Cormorant Garamond", "Cairo", serif;
  --sans: "Poppins", "Cairo", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

html[dir="rtl"] body,
html[dir="rtl"] .nav-links a,
html[dir="rtl"] .hero-sub,
html[dir="rtl"] .btn { font-family: "Cairo", "Poppins", sans-serif; }

/* En árabe el letter-spacing rompe la ligadura de las letras: reseteamos a 0
   en todo elemento con espaciado/versali de estilo editorial, y dejamos envolver
   el titular para que nunca desborde en pantallas estrechas. */
html[dir="rtl"] .btn,
html[dir="rtl"] .kicker,
html[dir="rtl"] .contact-label,
html[dir="rtl"] .footer-tag,
html[dir="rtl"] .info-item small,
html[dir="rtl"] .lang-btn {
  letter-spacing: 0;
  text-transform: none;
}

html[dir="rtl"] .hero-title {
  font-family: "Amiri", serif;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0;
  font-size: min(6.6vw, 5.6rem);
  white-space: normal;
  line-height: 1.25;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

.container { width: min(1200px, 92%); margin-inline: auto; }

/* Los anclajes aterrizan justo debajo de la navbar fija */
section[id] { scroll-margin-top: 84px; }

/* ============ NAVBAR ============ */
.navbar {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background 0.35s var(--ease), padding 0.35s var(--ease), border-color 0.35s var(--ease);
  border-bottom: 1px solid transparent;
  animation: fadeDown 0.7s var(--ease) 0.1s both;
}

.navbar.scrolled {
  background: rgba(247, 242, 227, 0.92);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
  padding: 14px 0;
}

.nav-inner { display: flex; align-items: center; gap: 18px; }

.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand-logo { height: 50px; width: auto; object-fit: contain; }

.nav-links {
  display: flex;
  gap: 24px;
  margin-inline: auto;   /* centre la navigation */
}
.nav-links a {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink);
  position: relative;
  padding: 4px 0;
}
.nav-links a::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--ink);
  transition: width 0.3s ease;
}
.nav-links a:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }

/* Sélecteur de langue discret */
.lang-toggle {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-family: inherit;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}
.lang-btn.active { background: var(--ink); color: var(--cream); }

.nav-cta { padding: 10px 22px; font-size: 0.66rem; border-radius: 6px; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.hamburger span { width: 22px; height: 1px; background: var(--ink); transition: transform 0.3s ease, opacity 0.3s ease; }
.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============ BOUTONS ============ */
.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--cream);
  background: var(--choco);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  cursor: pointer;
}
.btn:hover {
  background: var(--choco-soft);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(74, 42, 24, 0.16);
}
.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-dark { background: var(--choco); color: var(--cream); }
.btn-dark:hover { background: var(--choco-soft); color: var(--cream); }

/* ============ HERO ============ */
.hero {
  padding: 200px 0 36px;   /* les photos montent sous le hero */
  text-align: center;
}

/* Entrée au chargement : fondu + légère montée, en cascade */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: min(10vw, 8.6rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--choco);
  white-space: nowrap;
  max-width: 97%;
  margin-inline: auto;
  animation: riseIn 0.9s var(--ease) 0.18s both;
}

.hero-sub {
  margin: 40px auto 0;
  max-width: 470px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.9;
  animation: riseIn 0.9s var(--ease) 0.34s both;
}

.hero-cta {
  margin-top: 44px;
  animation: riseIn 0.9s var(--ease) 0.5s both;
}

/* ============ GALERIE / PRODUITS ============ */
.gallery-section { padding: 0 0 84px; }   /* les photos restent collées au hero */

.products {
  position: relative;
  padding: 30px 0 130px;
}

.products-head {
  text-align: center;
  padding: 10px 0 12px;
}

.product {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(36px, 5vw, 64px);
  align-items: center;
  padding: 56px 0;
  border-top: 1px solid var(--line);
}
.product:last-child { border-bottom: 1px solid var(--line); }

/* --- Carrusel --- */
.product-slider {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-deep);
  user-select: none;
  touch-action: pan-y;
}

.product-slides {
  display: flex;
  transition: transform 0.65s var(--ease);
}

.product-slide {
  flex: 0 0 100%;
  aspect-ratio: 1 / 1;
}
.product-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(247, 242, 227, 0.6);
  background: rgba(247, 242, 227, 0.82);
  color: var(--choco);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
  backdrop-filter: blur(4px);
}
.slider-arrow:hover {
  background: var(--choco);
  color: var(--cream);
}
.slider-prev { inset-inline-start: 14px; }
.slider-next { inset-inline-end: 14px; }

.slider-dots {
  position: absolute;
  bottom: 14px;
  inset-inline: 0;
  display: flex;
  justify-content: center;
  gap: 7px;
  z-index: 5;
}
.slider-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: none;
  background: rgba(247, 242, 227, 0.7);
  padding: 0;
  cursor: pointer;
  transition: width 0.3s var(--ease), background 0.3s var(--ease);
}
.slider-dot.active {
  width: 20px;
  background: var(--choco);
}

/* ============ NOS DOUCEURS (galerie) ============ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

.gallery-item {
  margin: 0;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-deep);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateY(var(--py, 0px)) scale(1.08);   /* marge pour le parallax */
  transition: transform 1s var(--ease);
  will-change: transform;
}
.gallery-item:hover img {
  transform: translateY(var(--py, 0px)) scale(1.14);   /* zoom doux au survol */
}

.gallery-item:nth-child(1) { --d: 0.05s; }
.gallery-item:nth-child(3) { --d: 0.31s; }

/* --- Infos produit --- */
.product-info {
  text-align: start;
}

.product-name {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.25;
  color: var(--choco);
  margin-bottom: 16px;
}

.product-desc {
  color: var(--ink-soft);
  font-size: 0.98rem;
  margin-bottom: 18px;
}

.product-note {
  border-inline-start: 1px solid var(--sage);
  padding-inline-start: 14px;
  color: var(--ink);
  font-size: 0.88rem;
}

/* Composition asymétrique : l'image centrale est surélevée */
.gallery-item:nth-child(2) { margin-top: 72px; }

/* ============ INFO STRIP ============ */
.info-strip {
  border-block: 1px solid var(--line);
  padding: 36px 0;
}
.info-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 44px;
}
.info-item {
  text-align: center;
}
.info-item span {
  display: block;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
}
.info-item small {
  display: block;
  margin-top: 4px;
  font-size: 0.64rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.info-rule {
  width: 1px;
  height: 38px;
  background: var(--line);
  flex-shrink: 0;
}

/* ============ SECTIONS COMMUNES ============ */
.kicker {
  display: block;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 26px;
}

/* ============ À PROPOS ============ */
.about { padding: 130px 0 100px; }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

.about-image img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

.about-text {
  text-align: start;
  max-width: 480px;
}

.about-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  line-height: 1.2;
  color: var(--choco);
  margin-bottom: 22px;
}

.about-text p {
  color: var(--ink-soft);
  font-size: 0.98rem;
  margin-bottom: 18px;
}

.about-text .btn { margin-top: 10px; }

/* ============ FAQ ============ */
.faq {
  padding: 0 0 130px;
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
}
.faq-list { text-align: start; margin-top: 20px; }
.faq-item {
  border-bottom: 1px solid var(--line);
}
.faq-item:first-child { border-top: 1px solid var(--line); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  font-style: italic;
  padding: 22px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--sans);
  font-style: normal;
  font-weight: 300;
  font-size: 1.1rem;
  color: var(--ink-faint);
  transition: transform 0.3s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.55s var(--ease), opacity 0.45s var(--ease);
}
.faq-item .faq-answer > span {
  overflow: hidden;
  min-height: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  padding: 0 4px 24px;
}
.faq-item[open] .faq-answer {
  grid-template-rows: 1fr;
  opacity: 1;
}

/* ============ CONTACT ============ */
.contact {
  padding: 0 0 140px;
  text-align: center;
}
.contact-row {
  display: flex;
  justify-content: center;
  max-width: 780px;
  margin-inline: auto;
  margin-top: 16px;
}
.contact-item {
  flex: 1;
  padding: 26px 22px;
  transition: background 0.3s ease;
}
.contact-item + .contact-item { border-inline-start: 1px solid var(--line); }
.contact-item:hover { background: var(--bg-deep); }
.contact-label {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.contact-value {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
}

/* ============ FOOTER ============ */
.footer {
  background: var(--ink);
  color: var(--cream);
  text-align: center;
  padding: 64px 0 44px;
}
.footer-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin: 0 auto 18px;
  border-radius: 4px;
}
.footer-brand { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
.footer-tag {
  font-size: 0.62rem;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: rgba(247, 242, 227, 0.5);
  margin-top: 6px;
}
.footer-copy {
  font-size: 0.72rem;
  color: rgba(247, 242, 227, 0.38);
  margin-top: 26px;
  border-top: 1px solid rgba(247, 242, 227, 0.16);
  padding-top: 22px;
  max-width: 520px;
  margin-inline: auto;
}

/* Bouton WhatsApp flottant */
.whatsapp-float {
  position: fixed;
  bottom: 22px;
  inset-inline-end: 22px;
  z-index: 90;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(37, 211, 102, 0.35);
  transition: transform 0.25s ease;
}
.whatsapp-float:hover { transform: scale(1.06); }

/* ============ RÉVÉLATION AU SCROLL ============ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: none; }

/* Variante rápida para secciones largas (productos) : menos recorrido, más breve */
.reveal.reveal-fast { transform: translateY(14px); transition-duration: 0.5s; }
.reveal.reveal-fast.visible { transform: none; }

.contact-item:nth-child(2) { --d: 0.12s; }
.contact-item:nth-child(3) { --d: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .navbar, .hero-title, .hero-sub, .hero-cta { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .gallery-item img { transform: scale(1.08); transition: none; }
  .gallery-item:hover img { transform: scale(1.08); }
  .btn:hover, .whatsapp-float:hover, .contact-item:hover { transform: none; }
  .faq-item .faq-answer { transition: none; }
}

/* ============ RÉPONSIVE ============ */
@media (max-width: 1000px) {
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 0.72rem; }
  .brand-logo { height: 44px; }
  .nav-cta { padding: 8px 16px; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: 0;
    inset-inline-end: 0;
    height: 100vh;
    width: min(280px, 78vw);
    background: var(--bg);
    border-inline-start: 1px solid var(--line);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 0;
    transform: translateX(100%);
    transition: transform 0.35s ease;
  }
  html[dir="rtl"] .nav-links { transform: translateX(-100%); }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { font-size: 1rem; }

  .hamburger { display: flex; }
  .nav-cta { display: none; }

  .hero { padding: 150px 0 32px; }
}

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 34px; }
  .about-image { order: 1; }        /* image d'abord */
  .about-text { order: 2; max-width: 100%; }

  .product { grid-template-columns: 1fr; gap: 28px; padding: 44px 0; }
  .product-media { order: 1; }      /* photos d'abord */
  .product-info { order: 2; }
}

@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 22px;
    max-width: 420px;
    margin-inline: auto;
  }
  .gallery-item:nth-child(2) { margin-top: 0; }   /* sin elevación al apilar */

  .contact-row { flex-direction: column; max-width: 420px; }
  .contact-item + .contact-item { border-inline-start: none; border-top: 1px solid var(--line); }
}

/* Pantallas muy estrechas (<380px) : el titular nunca debe desbordar */
@media (max-width: 380px) {
  .hero-title { font-size: min(9vw, 2.6rem); }
  .hero { padding-top: 130px; }
}
