/* =========================================================
   COMPLÉMENT CSS — L'Atelier de Voray
   Ce fichier complète main.css (le design d'origine) :
   1. Variables CSS manquantes utilisées par main.css
   2. Petits ajustements liés à la version PHP (logo + slogan, etc.)
   Chargé APRÈS main.css.
   ========================================================= */

:root {
  /* Variables référencées par main.css mais non définies à l'origine */
  --text: #2a1431;            /* texte principal (= aubergine-deep) */
  --text-muted: #7a6680;      /* texte secondaire, doux */
  --border: #e3d6ea;          /* bordures discrètes, ton lavande */
  --lavande-ultra: #f4eef7;   /* lavande très pâle, fonds de survol */
  --space-2xl: 6rem;          /* grand espacement vertical de sections */
}

/* =========================================================
   LOGO : nom + slogan configurables (header)
   Le design d'origine n'avait que le nom ; on ajoute proprement
   un petit slogan sous le nom, dans l'esprit du site.
   ========================================================= */
.logo-text-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--aubergine);
  letter-spacing: -0.01em;
}
.logo-amp { color: var(--or); font-style: normal; }
.logo-sub {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--violet-soft);
  margin-top: 2px;
}

@media (max-width: 480px) {
  .logo-name { font-size: 1.15rem; }
  .logo-sub { font-size: 0.58rem; letter-spacing: 0.12em; }
}

/* =========================================================
   Lien d'évitement (accessibilité) — visible au focus clavier
   ========================================================= */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--aubergine);
  color: var(--ivoire);
  padding: 0.7rem 1.2rem;
  border-radius: 0 0 var(--radius-sm) 0;
  font-size: 0.9rem;
}
.skip-link:focus { left: 0; }

/* =========================================================
   Newsletter dans le footer (mini-formulaire)
   ========================================================= */
.footer-newsletter-row {
  display: flex;
  gap: 0.4rem;
  max-width: 320px;
}
.footer-newsletter-row input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(250,246,242,0.2);
  background: rgba(250,246,242,0.08);
  color: var(--ivoire);
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.88rem;
}
.footer-newsletter-row input::placeholder { color: rgba(250,246,242,0.5); }
.footer-newsletter-row input:focus {
  outline: none;
  border-color: var(--or);
  background: rgba(250,246,242,0.12);
}
.footer-newsletter-row button {
  width: 42px;
  flex-shrink: 0;
  background: var(--or);
  color: var(--aubergine-deep);
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--t-fast);
}
.footer-newsletter-row button:hover { background: var(--or-clair); }
.footer-newsletter-msg { font-size: 0.8rem; margin-top: 0.5rem; min-height: 1rem; }
.footer-newsletter-msg.success { color: var(--or-clair); }
.footer-newsletter-msg.error { color: var(--rose-poudre); }
/* =========================================================
   COMPLÉMENTS — éléments ajoutés au portage PHP
   Ce fichier complète main.css sans le modifier.
   Chargé APRÈS main.css dans le layout.
   ========================================================= */

/* ---- Cartes catégories sur l'accueil (version simple icône + titre) ---- */
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.6rem;
  padding: var(--space-lg) var(--space-md);
  aspect-ratio: auto;
  min-height: 180px;
  background: var(--lavande-pale);
  border: 1px solid transparent;
}
.category-card:hover {
  transform: translateY(-4px);
  background: var(--ivoire);
  border-color: var(--lavande);
  box-shadow: var(--shadow-lg);
}
.category-card-icon {
  font-size: 2rem;
  color: var(--or);
  transition: var(--t-base);
}
.category-card:hover .category-card-icon {
  transform: scale(1.15) rotate(8deg);
}
.category-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--aubergine);
  font-style: italic;
}
.category-card-link {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--violet);
  opacity: 0;
  transform: translateY(6px);
  transition: var(--t-base);
}
.category-card:hover .category-card-link {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Section vidéo YouTube (accueil) ---- */
.home-video-section {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}
.home-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg, 24px);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--aubergine);
  border: 1px solid var(--lavande);
}
.home-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---- Section vidéo sur la page produit ---- */
.product-video-section {
  margin-top: var(--space-xl, 4rem);
}
.product-video-main {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg, 24px);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--aubergine);
  border: 1px solid var(--lavande);
}
.product-video-main iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.product-video-secondaries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md, 1.5rem);
  margin-top: var(--space-md, 1.5rem);
}
.product-video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md, 16px);
  overflow: hidden;
  box-shadow: var(--shadow-md, 0 4px 12px rgba(61,31,71,0.12));
  background: var(--aubergine);
  border: 1px solid var(--lavande);
}
.product-video-thumb iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* =========================================================
   GALERIE PRODUIT — complète (swipe, zoom, plein écran)
   Pensée mobile d'abord. Remplace l'ancienne .product-gallery.
   ========================================================= */

.product-gallery { display: flex; flex-direction: column; gap: 0.75rem; }
.product-gallery:focus { outline: none; }
.product-gallery:focus-visible .gallery-stage { box-shadow: 0 0 0 3px var(--or); }

/* Scène principale : la zone qui affiche la grande image */
.gallery-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg, 24px);
  overflow: hidden;
  background: var(--lavande-pale);
  cursor: zoom-in;
  touch-action: pan-y; /* autorise le scroll vertical, on gère l'horizontal en JS */
  user-select: none;
}
.gallery-empty {
  display: grid;
  place-items: center;
  cursor: default;
}
.gallery-empty span { font-size: 4rem; color: var(--lavande); }

/* Piste défilante : toutes les images côte à côte */
.gallery-track {
  display: flex;
  height: 100%;
  will-change: transform;
}
.gallery-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}
.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Flèches précédent / suivant */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: rgba(250, 246, 242, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50%;
  color: var(--aubergine);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(61,31,71,0.15));
  transition: var(--t-fast, 0.2s);
  z-index: 2;
  opacity: 0;
}
.gallery-stage:hover .gallery-arrow { opacity: 1; }
.gallery-arrow:hover { background: var(--ivoire); transform: translateY(-50%) scale(1.08); }
.gallery-arrow svg { width: 22px; height: 22px; }
.gallery-arrow-prev { left: 0.75rem; }
.gallery-arrow-next { right: 0.75rem; }

/* Compteur 1/4 */
.gallery-counter {
  position: absolute;
  bottom: 0.75rem; left: 0.75rem;
  background: rgba(61, 31, 71, 0.7);
  color: var(--ivoire);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full, 999px);
  z-index: 2;
  pointer-events: none;
}

/* Bouton plein écran */
.gallery-zoom-hint {
  position: absolute;
  bottom: 0.75rem; right: 0.75rem;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: rgba(250, 246, 242, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50%;
  color: var(--aubergine);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(61,31,71,0.15));
  z-index: 2;
  transition: var(--t-fast, 0.2s);
}
.gallery-zoom-hint:hover { background: var(--ivoire); transform: scale(1.08); }
.gallery-zoom-hint svg { width: 18px; height: 18px; }

/* Bande de miniatures */
.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.gallery-thumb {
  flex: 0 0 auto;
  width: 68px; height: 68px;
  border-radius: var(--radius-md, 14px);
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--lavande-pale);
  cursor: pointer;
  transition: var(--t-fast, 0.2s);
  padding: 0;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb.active { border-color: var(--or); }
.gallery-thumb:hover { border-color: var(--lavande); }

/* ---- LIGHTBOX plein écran ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(42, 20, 49, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.open { opacity: 1; visibility: visible; }

.lightbox-stage {
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-stage img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-md, 14px);
  cursor: zoom-in;
  transition: transform 0.3s ease;
  user-select: none;
}
.lightbox-stage img.zoomed {
  transform: scale(2);
  cursor: zoom-out;
}

.lightbox-close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: rgba(250, 246, 242, 0.12);
  border-radius: 50%;
  color: var(--ivoire);
  transition: var(--t-fast, 0.2s);
  z-index: 2;
}
.lightbox-close:hover { background: rgba(250, 246, 242, 0.25); }
.lightbox-close svg { width: 26px; height: 26px; }

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  display: grid; place-items: center;
  background: rgba(250, 246, 242, 0.12);
  border-radius: 50%;
  color: var(--ivoire);
  transition: var(--t-fast, 0.2s);
  z-index: 2;
}
.lightbox-arrow:hover { background: rgba(250, 246, 242, 0.25); }
.lightbox-arrow svg { width: 28px; height: 28px; }
.lightbox-arrow-prev { left: 1rem; }
.lightbox-arrow-next { right: 1rem; }

.lightbox-counter {
  position: absolute;
  bottom: 1.25rem; left: 50%;
  transform: translateX(-50%);
  color: var(--ivoire);
  font-size: 0.9rem;
  background: rgba(250, 246, 242, 0.12);
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full, 999px);
}

/* ---- Mobile : la galerie d'abord ---- */
@media (max-width: 768px) {
  .gallery-stage {
    border-radius: var(--radius-md, 16px);
    cursor: default;
  }
  /* Sur mobile, les flèches restent visibles (pas de hover) */
  .gallery-arrow { opacity: 0.9; width: 40px; height: 40px; }
  .gallery-thumb { width: 60px; height: 60px; }
  .lightbox-arrow { width: 44px; height: 44px; }
  .lightbox-arrow-prev { left: 0.5rem; }
  .lightbox-arrow-next { right: 0.5rem; }
}

/* Respecte les préférences de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  .gallery-track { transition: none !important; }
  .lightbox-stage img { transition: none; }
}

/* =========================================================
   PLACEHOLDERS PRODUIT — visuels dessinés par catégorie
   (affichés tant qu'aucune photo n'est uploadée)
   ========================================================= */
.produit-card-placeholder {
  width: 100%;
  height: 100%;
}
.produit-card-placeholder svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
/* Dans la galerie produit, le placeholder remplit la scène carrée */
.gallery-empty svg {
  width: 100%;
  height: 100%;
  display: block;
}
