/* ============================================================
   BOUTIQUE — page premium (dark + light)
   N'utilise QUE les variables du design system (obsidian.css)
   pour s'adapter automatiquement aux deux thèmes.
   ============================================================ */

/* ── Hero ─────────────────────────────────────────────────── */
/* Pas d'image de fond ici : on resserre et on centre le bloc
   d'intro pour une composition aérée plutôt qu'un grand vide. */
.lm-shop-hero {
  min-height: auto;
  display: block;
  overflow: visible;
  text-align: center;
  padding: clamp(7rem, 12vh, 11rem) clamp(1.25rem, 5vw, 4rem) clamp(2rem, 5vh, 4rem);
}

.lm-shop-hero .lm-page-hero__inner {
  margin: 0 auto;
  max-width: 900px;
}

/* Sans image de fond, le titre forcé en #f7f2e8 par obsidian.css
   serait illisible en thème clair : on le rebranche sur --text. */
.lm-shop-hero .lm-display-title { color: var(--text); }
.lm-shop-hero .lm-display-title em { color: var(--gold); }

.lm-shop-hero__intro {
  max-width: 56ch;
  margin: 1.6rem auto 0;
  color: var(--muted);
  font-family: "Jost", sans-serif;
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

/* ── Conteneur boutique ───────────────────────────────────── */
.lm-shop {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 6rem) clamp(1.25rem, 5vw, 4rem) clamp(5rem, 9vw, 8rem);
}

/* ── Onglets ──────────────────────────────────────────────── */
.lm-shop__tabs {
  display: flex;
  justify-content: center;
  gap: clamp(0.25rem, 2vw, 1.5rem);
  border-bottom: 1px solid var(--border);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.lm-shop__tabs::-webkit-scrollbar { display: none; }

.lm-shop__tab {
  position: relative;
  flex: 0 0 auto;
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-family: "Jost", sans-serif;
  font-weight: 400;
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.4s cubic-bezier(.22,.61,.36,1);
}

.lm-shop__tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.4s cubic-bezier(.22,.61,.36,1);
}

.lm-shop__tab:hover { color: var(--text); }

.lm-shop__tab--active { color: var(--text); }
.lm-shop__tab--active::after { transform: scaleX(1); }

/* ── Panneaux ─────────────────────────────────────────────── */
.lm-shop__panel[hidden] { display: none; }

.lm-shop__panel-subtitle {
  text-align: center;
  max-width: 52ch;
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
  color: var(--muted);
  font-family: "Cormorant Garamond", serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  line-height: 1.5;
}

/* ── Grille produits ──────────────────────────────────────── */
.lm-shop__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

/* ── Carte produit ────────────────────────────────────────── */
.lm-shop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition:
    transform 0.5s cubic-bezier(.2,.7,.2,1),
    box-shadow 0.5s cubic-bezier(.22,.61,.36,1),
    border-color 0.5s cubic-bezier(.22,.61,.36,1);
}

.lm-shop-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.5);
  border-color: var(--border2);
}

.lm-shop-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.lm-shop-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(.2,.7,.2,1);
}

.lm-shop-card:hover .lm-shop-card__media img {
  transform: scale(1.06);
}

.lm-shop-card__badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--gold);
  color: var(--bg);
  font-family: "Jost", sans-serif;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border-radius: 2px;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.6);
}

.lm-shop-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  padding: clamp(1.2rem, 2vw, 1.6rem);
}

.lm-shop-card__title {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 400;
  font-size: clamp(1.4rem, 2.4vw, 1.7rem);
  line-height: 1.15;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lm-shop-card__desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-family: "Jost", sans-serif;
  font-weight: 300;
  font-size: 0.9rem;
  line-height: 1.6;
}
.lm-shop-card__desc p { margin: 0; }

.lm-shop-card__price {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.4rem;
}

.lm-shop-card__price-old {
  text-decoration: line-through;
  color: var(--muted);
  font-family: "Jost", sans-serif;
  font-size: 0.95rem;
}

.lm-shop-card__price-now {
  color: var(--gold);
  font-family: "Jost", sans-serif;
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}

/* ── État vide ────────────────────────────────────────────── */
.lm-shop--empty {
  text-align: center;
}

.lm-shop__empty {
  color: var(--muted);
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.5rem, 3vw, 2rem);
  padding: clamp(4rem, 10vw, 8rem) 1rem;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 540px) {
  .lm-shop__grid {
    grid-template-columns: 1fr;
  }
  .lm-shop__tabs {
    justify-content: flex-start;
  }
}

/* ─────────────────────────────────────────────────────────── */
/* Section "Produits à l'affiche" — page d'accueil (Task 5)     */
/* Réutilise les cartes .lm-shop-card du même fichier.          */
/* ─────────────────────────────────────────────────────────── */
.lm-shop-feature {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 8rem) clamp(1.2rem, 5vw, 4rem);
}

.lm-shop-feature__head {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vh, 4rem);
}

.lm-shop-feature__head .lm-section-label {
  margin-bottom: 1rem;
}

.lm-shop-feature__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.2rem, 2.5vw, 2rem);
}

.lm-shop-feature__cta {
  margin-top: clamp(2.5rem, 5vh, 4rem);
  text-align: center;
}

@media (max-width: 1024px) {
  .lm-shop-feature__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .lm-shop-feature__grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MODALE PRODUIT + PARTAGE
   N'utilise QUE les variables du design system (dark + light).
   ═══════════════════════════════════════════════════════════════ */

/* Déclencheur invisible qui couvre la carte (toute la carte ouvre la modale) */
.lm-shop-card__trigger {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.lm-shop-card__trigger:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -4px;
}

/* ── Conteneur <dialog> : plein écran, centre son contenu ─────── */
.lm-product-modal {
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: clamp(1rem, 4vw, 3rem);
  border: 0;
  background: transparent;
  overflow: visible;
  color: var(--text);
}
/* Ouvert : flex pour centrer (fermé = display:none hérité du navigateur) */
.lm-product-modal[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Arrière-plan figé quand une modale est ouverte (scroll lock).
   --lm-sbw compense la largeur de la barre de défilement (posé en JS). */
html.lm-modal-open {
  overflow: hidden;
}
html.lm-modal-open body {
  padding-right: var(--lm-sbw, 0px);
}

/* Le curseur doré custom (z-index 9999) reste sous le <dialog> (top-layer).
   On rétablit le curseur système, toujours dessiné au premier plan,
   au lieu du « cursor: none » global d'obsidian.css. */
.lm-product-modal[open] { cursor: auto; }
.lm-product-modal[open] a,
.lm-product-modal[open] button { cursor: pointer; }
.lm-product-modal::backdrop {
  background: rgba(8, 7, 6, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
html[data-theme="light"] .lm-product-modal::backdrop {
  background: rgba(26, 22, 17, 0.55);
}

/* Animation d'ouverture */
.lm-product-modal[open] .lm-product-modal__inner {
  animation: lm-modal-in 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes lm-modal-in {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ── Panneau interne ─────────────────────────────────────────── */
/* Hauteur fixe : la modale garde la même taille quelle que soit la
   longueur de la description (seule la description défile, cf. plus bas). */
.lm-product-modal__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(960px, 100%);
  height: min(86vh, 600px);
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 6px;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.8);
}

.lm-product-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: rgba(8, 7, 6, 0.55);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s;
}
html[data-theme="light"] .lm-product-modal__close {
  background: rgba(255, 255, 255, 0.7);
}
.lm-product-modal__close:hover {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
}
.lm-product-modal__close svg { width: 18px; height: 18px; }

/* Colonne image */
.lm-product-modal__media {
  position: relative;
  min-height: 100%;
}
.lm-product-modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lm-product-modal__badge {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--gold);
  color: var(--bg);
  font-family: "Jost", sans-serif;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border-radius: 2px;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.6);
}

/* Colonne texte : hauteur bornée par le panneau, sans débordement propre
   (c'est la description seule qui défile). */
.lm-product-modal__body {
  padding: clamp(2rem, 4vw, 3.25rem);
  padding-top: clamp(3rem, 5vw, 3.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
  min-height: 0;
  overflow: hidden;
}
.lm-product-modal__cat {
  font-family: "Jost", sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.lm-product-modal__title {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.7rem);
  line-height: 1.05;
  color: var(--text);
}
.lm-product-modal__price {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}
.lm-product-modal__price-old {
  text-decoration: line-through;
  color: var(--muted);
  font-family: "Jost", sans-serif;
  font-size: 1.05rem;
}
.lm-product-modal__price-now {
  color: var(--gold);
  font-family: "Jost", sans-serif;
  font-weight: 500;
  font-size: 1.6rem;
}
/* La description occupe l'espace restant et défile seule si elle est longue. */
.lm-product-modal__desc {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  color: var(--muted);
  font-family: "Jost", sans-serif;
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.8;
  border-top: 1px solid var(--border);
  padding-top: 1.3rem;
  padding-right: 0.7rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.lm-product-modal__desc::-webkit-scrollbar { width: 6px; }
.lm-product-modal__desc::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 3px;
}
.lm-product-modal__desc p { margin: 0; }
.lm-product-modal__desc p + p { margin-top: 0.9rem; }

/* ── Barre de partage ────────────────────────────────────────── */
.lm-share {
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
}
.lm-share__label {
  font-family: "Jost", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.7rem;
}
.lm-share__row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}
.lm-share__btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s;
}
.lm-share__btn:hover {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
  transform: translateY(-2px);
}
.lm-share__btn svg { width: 16px; height: 16px; }
.lm-share__btn--native {
  width: auto;
  padding: 0 0.9rem;
  height: 36px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "Jost", sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}
/* Instagram : dégradé signature au survol */
.lm-share__btn--ig:hover {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  border-color: transparent;
  color: #fff;
}
.lm-share__feedback {
  margin-top: 0.8rem;
  font-family: "Jost", sans-serif;
  font-size: 0.8rem;
  color: var(--gold);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 760px) {
  /* Image (hauteur fixe) en haut, contenu défilant dessous. */
  .lm-product-modal__inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: min(90vh, 680px);
  }
  .lm-product-modal__media { aspect-ratio: 16 / 10; min-height: 0; }
  .lm-product-modal__media img { aspect-ratio: 16 / 10; }
  /* Titre sur une seule ligne dans la modale (tronqué avec « … » si besoin).
     flex-shrink:0 : sans ça, overflow:hidden ramène la taille mini flex à 0
     et le titre est écrasé par la description (flex:1) dans la colonne. */
  .lm-product-modal__title {
    flex-shrink: 0;
    font-size: 1.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lm-product-modal[open] .lm-product-modal__inner { animation: none; }
}
