/* Thème Mine · « les rails » (03/12/2026, direction choisie sur aperçu par Timour, né pour Le Petit Coin d'Or).
   En fin de journée, l'entrée d'une mine d'or ; le logo de la boutique devant, les rails partent sous lui. « Entrer dans
   la mine » : on s'enfonce dans le tunnel, et le catalogue longe les rails : chaque produit est une caisse en bois.
   Trois couches, posées par mine.js (même squelette que Tour) :
     #mn-vue      (derrière tout)   le noir du tunnel
     le catalogue (dans la page)    le sol du tunnel et ses rails, qui défilent avec les caisses
     #mn-avant    (par-dessus)      l'entrée de la mine, le logo, le bouton ; tout s'efface au passage
   États sur <body> : mn-accueil → mn-bord. mn-hors = on n'est pas sur l'onglet Produits.
   La profondeur : mine.js écrit --px et --py (de -1 à 1) ; le décor et le logo glissent chacun à sa distance.
   Aucune ombre molle : les reliefs sont des rebords nets (retour de Timour sur la boutique de Snoop). */
body[data-vitrine="mine"] #cl-vitrine > :is(.cl-hero, .cl-bande, .cl-rayons) { display: none !important; }
/* #mn-vue est derrière la page (z-index -1) : le fond de <body> le cacherait, on le rend transparent et on peint <html>. */
body[data-vitrine="mine"][data-glossy="candy"] { background: transparent !important; }
html:has(body[data-vitrine="mine"]) { background: #1a120b !important; }
body[data-vitrine="mine"].mn-accueil #cl-barre { display: none !important; }

#mn-vue, #mn-avant { position: fixed; inset: 0; overflow: hidden; container-type: inline-size; }
#mn-vue { z-index: -1; background: radial-gradient(circle at 50% 38%, #3d2713, #1a120b 68%); }
#mn-avant { z-index: 2; pointer-events: none; }
body.mn-hors #mn-avant { display: none; }
/* Grand écran : l'app reste une colonne à la taille d'un téléphone, le décor ne déborde pas. */
@media (min-width: 600px) {
  #mn-vue, #mn-avant { left: 50%; right: auto; width: 56.25svh; translate: -50% 0; }
}
/* La boîte de la planche (9:16) : calée en bas, elle couvre toujours l'écran. */
.mn-cadre { position: absolute; left: 50%; bottom: 0; width: max(100cqw, 56.25svh); aspect-ratio: 9 / 16; translate: -50% 0; }
.mn-cadre img { display: block; -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }
.mn-plein { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Par-dessus : l'entrée de la mine ---------- */
/* Le point de fuite est la bouche du tunnel : c'est vers elle qu'on avance. */
.mn-plan { translate: calc(var(--px, 0) * 10px) calc(var(--py, 0) * 6px); scale: 1.03; transform-origin: 50% 43%; will-change: transform; transition: transform .9s cubic-bezier(.6,0,.25,1), opacity .45s .4s; }
/* La lanterne du poteau : sa flamme respire. Posée sur celle de la planche (89 % · 34,5 %). */
.mn-flamme { position: absolute; left: 89.5%; top: 35%; width: 26%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; mix-blend-mode: screen; opacity: .5;
  background: radial-gradient(circle, rgba(255,214,120,.85), rgba(255,170,60,.3) 38%, rgba(255,170,60,0) 68%); }
.mn-anime .mn-flamme { animation: mn-flamme 3.4s ease-in-out infinite; }
@keyframes mn-flamme { 0%, 100% { opacity: .5; scale: 1; } 22% { opacity: .78; scale: 1.08; } 40% { opacity: .42; scale: .96; } 63% { opacity: .7; scale: 1.05; } 80% { opacity: .5; } }
/* Le passage : on s'enfonce dans le tunnel jusqu'au noir. */
body.mn-bord .mn-plan { transform: scale(3.6); opacity: 0; }
body.mn-bord #mn-avant { visibility: hidden; transition: visibility 0s .95s; }

/* Le logo de la boutique devant l'entrée. Il flotte à peine. */
.mn-nom { position: absolute; left: 50%; top: max(6svh, calc(env(safe-area-inset-top) + 26px)); width: min(80cqw, 40svh); margin: 0; translate: calc(-50% + var(--px, 0) * -6px) calc(var(--py, 0) * -4px); transition: opacity .3s; }
.mn-nom img { display: block; width: 100%; height: auto; max-height: 52svh; object-fit: contain; }
.mn-anime .mn-nom { animation: mn-pose .7s .15s cubic-bezier(.34,1.4,.64,1) both; }
@keyframes mn-pose { from { opacity: 0; scale: .7; } }
.mn-anime .mn-nom img { animation: mn-flotte 5s 1s ease-in-out infinite; }
@keyframes mn-flotte { 50% { translate: 0 -7px; } }
.mn-nom.mn-coup img { animation: mn-coup .4s cubic-bezier(.34,1.56,.64,1); }
@keyframes mn-coup { 40% { scale: 1.05; rotate: -1.5deg; } }
/* Le logo répond au doigt. */
.mn-touche { position: absolute; left: 12%; top: 8svh; width: 76%; height: 42svh; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* Le bouton : un lingot verni. Or, texte et contour vert sombre du lettrage, un rebord net dessous. */
.mn-go {
  position: absolute; left: 50%; bottom: calc(112px + env(safe-area-inset-bottom) + 2.5svh); translate: -50% 0; display: inline-flex; align-items: center; gap: 12px;
  padding: 18px 26px 18px 30px; cursor: pointer; pointer-events: auto; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; white-space: nowrap;
  border: 3.5px solid #0f3d14; border-radius: 999px; color: #0f3d14; font: 900 19px/1 'Poppins', system-ui, sans-serif; letter-spacing: .01em;
  background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,0) 46%), linear-gradient(180deg, #ffd84a, #ffb400 62%, #f29a00);
  box-shadow: 0 7px 0 #0f3d14;
}
.mn-go svg { width: 12px; height: 17px; fill: none; stroke: #0f3d14; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.mn-anime .mn-go { animation: mn-monte .6s .5s cubic-bezier(.34,1.4,.64,1) both; }
@keyframes mn-monte { from { opacity: 0; translate: -50% 26px; } }
.mn-anime .mn-go svg { animation: mn-appel 1.6s ease-in-out infinite; }
@keyframes mn-appel { 50% { translate: 5px 0; } }
.mn-go:active { translate: -50% 5px; box-shadow: 0 2px 0 #0f3d14; }
body.mn-bord :is(.mn-nom, .mn-go, .mn-touche) { opacity: 0; pointer-events: none; animation: none; }
.mn-grain { position: fixed; z-index: 9999; width: 10px; aspect-ratio: 1; border-radius: 3px; pointer-events: none; background: var(--c, #ffc629); }
/* Hors du catalogue (panier, infos, avis, contact) : le tunnel reste derrière, assombri pour laisser lire les panneaux. */
#mn-vue::after { content: ""; position: absolute; inset: 0; background: rgba(26,18,11,.6); opacity: 0; transition: opacity .4s; }
body.mn-hors #mn-vue::after { opacity: 1; }

/* ---------- Le catalogue : le tunnel et ses rails ---------- */
#mn-monde { display: none; }
/* Le sol du tunnel est le fond du catalogue lui-même : les rails défilent avec les caisses. La tuile se répète sans raccord. */
body.mn-bord #mn-monde {
  display: block; box-sizing: border-box; min-height: 100svh; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 22px) 5% 170px;
  background: #4a2f18 url("heros/tunnel.webp?v=1") center top / 100% auto repeat-y;
  border-top: 16px solid #6b4423; box-shadow: inset 0 5px 0 #2a1a0c; /* la poutre du cadre d'entrée, au-dessus de la tête */
}
@media (min-width: 600px) { body.mn-bord #mn-monde { width: 56.25svh; } }
/* La poutre d'entrée touche le haut de l'écran : sur le catalogue, la marge haute du moteur (70 px + 24 px) laissait une bande noire vide. */
body[data-vitrine="mine"].mn-bord:not(.mn-hors) #appContent { padding-top: 0 !important; }
body[data-vitrine="mine"].mn-bord:not(.mn-hors) #shoppingSection { margin-top: 0 !important; }
.mn-anime#mn-monde { animation: mn-entre .6s .3s cubic-bezier(.2,.8,.3,1) both; }
@keyframes mn-entre { from { opacity: 0; scale: 1.12; } }
.mn-rayon + .mn-rayon { margin-top: 30px; }
/* Le nom du rayon : une plaque crème vissée. */
.mn-rayon h2 { display: inline-flex; align-items: center; margin: 0 0 14px; padding: 10px 18px; border-radius: 12px; border: 3px solid #0f3d14;
  background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,0) 50%), #fff3d6; color: #0f3d14; font: 900 15px/1 'Poppins', system-ui, sans-serif; letter-spacing: .03em; box-shadow: 0 4px 0 #0f3d14; }
.mn-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; padding-bottom: 28px; }
/* Une fiche : une caisse posée le long des rails. La colonne de droite est une demi-caisse plus bas. */
.mn-carte { position: relative; display: flex; flex-direction: column; cursor: pointer; }
.mn-carte:nth-child(even) { top: 28px; }
.mn-anime .mn-rayon:not(.mn-vu) .mn-carte { opacity: 0; }
.mn-anime .mn-rayon.mn-vu .mn-carte { animation: mn-arrive .5s calc(var(--n) * 70ms) cubic-bezier(.2,.8,.3,1.2) both; }
@keyframes mn-arrive { from { opacity: 0; translate: 0 22px; scale: .92; } 60% { opacity: 1; } }
.mn-carte.mn-tenu { scale: .97; }
/* La caisse : la photo du commerçant est dans son ouverture, le bois passe devant ses bords.
   L'ouverture mesurée sur heros/caisse.webp (preparer-mine.py) : 16,6 % à gauche et à droite, 15,4 % en haut, 17 % en bas. */
.mn-photo { position: relative; width: 100%; aspect-ratio: 1; }
.mn-photo::before { content: ""; position: absolute; inset: 14.4% 15.6% 16% 15.6%; background: linear-gradient(165deg, #fff8e8, #efe2c6); }
.mn-photo > :is(img, video) { position: absolute; left: 15.6%; top: 14.4%; width: 68.8%; height: 69.6%; display: block; object-fit: cover; }
.mn-photo::after { content: ""; position: absolute; inset: 0; background: url("heros/caisse.webp?v=1") center / 100% 100% no-repeat; pointer-events: none; }
/* L'étiquette de la caisse : crème, le nom, le prix, le + vert. */
.mn-plaque { position: relative; display: flex; flex-direction: column; gap: 4px; margin: -9% 2% 0; padding: 9px 46px 10px 11px; min-height: 56px; box-sizing: border-box; justify-content: center;
  border: 2.5px solid #0f3d14; border-radius: 12px; box-shadow: 0 5px 0 #0f3d14;
  background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,0) 46%), #fff3d6; }
.mn-plaque b { font: 800 13.5px/1.2 'Poppins', system-ui, sans-serif; color: #0f3d14; overflow-wrap: anywhere; }
.mn-prix { font: 900 15px/1 'Poppins', system-ui, sans-serif; color: #3f7a0a; }
.mn-prix small { font-weight: 700; font-size: 11px; color: #6b4423; }
#mn-monde .mn-plus { position: absolute; right: 6px; top: 50%; left: auto; bottom: auto; translate: 0 -50%; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 2.5px solid #0f3d14 !important; border-radius: 50%; background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 48%), linear-gradient(180deg, #b4f53c, #8fd61a) !important; box-shadow: none !important; }
#mn-monde .mn-plus svg { width: 18px; height: 18px; fill: none; stroke: #0f3d14; stroke-width: 3.6; stroke-linecap: round; }
#mn-monde .mn-plus:active { scale: .88; }
.mn-vide { padding: 24px 16px; text-align: center; border-radius: 16px; border: 3px solid #0f3d14; background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,0) 50%), #fff3d6; color: #0f3d14; box-shadow: 0 5px 0 #0f3d14; }
.mn-vide b { display: block; margin-bottom: 4px; font: 900 19px/1.2 'Poppins', system-ui, sans-serif; }
.mn-vide span { font: 600 13.5px/1.4 'Poppins', system-ui, sans-serif; opacity: .85; }
/* Le produit ajouté descend vers le wagonnet. */
.mn-envol { position: fixed; z-index: 9999; border-radius: 10px; object-fit: cover; pointer-events: none; outline: 2.5px solid #0f3d14; }

@media (prefers-reduced-motion: reduce) {
  .mn-go svg, .mn-nom img, .mn-flamme { animation: none; }
  .mn-plan { transition: none; }
}
