/* Thème Tour · « au pied de la tour » (23/11/2026, direction choisie sur aperçu par Timour, né pour Touche pas à ma tour).
   Le jour, on lève la tête vers une tour jaune et orange ; le logo de la boutique devant elle. « Voir le menu » : on
   s'approche de la façade, et le catalogue EST la façade : chaque produit est une fenêtre avec son balcon orange.
   Trois couches, posées par tour.js (même squelette que Toits) :
     #tr-vue      (derrière tout)   le ciel, trois nuages qui passent
     le catalogue (dans la page)    la façade, qui défile avec les fiches : on longe les étages
     #tr-avant    (par-dessus)      la tour de l'accueil, le logo, le bouton ; tout s'efface au passage
   États sur <body> : tr-accueil → tr-bord. tr-hors = on n'est pas sur l'onglet Produits.
   La profondeur : tour.js écrit --px et --py (de -1 à 1) ; le ciel, les nuages et la tour glissent chacun à sa distance.
   Aucune ombre molle : les reliefs sont des rebords nets (retour de Timour sur la boutique de Snoop). */
body[data-vitrine="tour"] #cl-vitrine > :is(.cl-hero, .cl-bande, .cl-rayons) { display: none !important; }
/* #tr-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="tour"][data-glossy="candy"] { background: transparent !important; }
html:has(body[data-vitrine="tour"]) { background: #1d1438 !important; }
body[data-vitrine="tour"].tr-accueil #cl-barre { display: none !important; }

#tr-vue, #tr-avant { position: fixed; inset: 0; overflow: hidden; container-type: inline-size; }
#tr-vue { z-index: -1; background: #3fa9f5; }
#tr-avant { z-index: 2; pointer-events: none; }
body.tr-hors #tr-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) {
  #tr-vue, #tr-avant { left: 50%; right: auto; width: 56.25svh; translate: -50% 0; }
}
/* La boîte des planches (9:16) : calée en bas, elle couvre toujours l'écran. */
.tr-cadre { position: absolute; left: 50%; bottom: 0; width: max(100cqw, 56.25svh); aspect-ratio: 9 / 16; translate: -50% 0; }
.tr-cadre img { display: block; -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }
.tr-plein { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Derrière : le ciel et ses nuages ---------- */
.tr-ciel { scale: 1.06; translate: calc(var(--px, 0) * -4px) calc(var(--py, 0) * -3px); }
.tr-nuage { position: absolute; left: 0; top: 9%; width: 34%; aspect-ratio: 420 / 269; background: url("heros/nuage.webp?v=1") center / contain no-repeat; translate: -120% 0; }
.tr-nuage:nth-of-type(2) { top: 27%; width: 24%; }
.tr-nuage:nth-of-type(3) { top: 44%; width: 29%; }
.tr-anime .tr-nuage { animation: tr-derive 70s linear infinite; animation-delay: -22s; }
.tr-anime .tr-nuage:nth-of-type(2) { animation-duration: 96s; animation-delay: -60s; }
.tr-anime .tr-nuage:nth-of-type(3) { animation-duration: 84s; animation-delay: -8s; }
@keyframes tr-derive { to { translate: 320% 0; } }
/* Hors du catalogue (panier, infos, avis, contact) : un voile violet pour laisser lire les panneaux. */
#tr-vue::after { content: ""; position: absolute; inset: 0; background: rgba(29,20,56,.78); opacity: 0; transition: opacity .4s; }
body.tr-hors #tr-vue::after { opacity: 1; }

/* ---------- Par-dessus : la tour de l'accueil ---------- */
.tr-plan { translate: calc(var(--px, 0) * 12px) calc(var(--py, 0) * 7px); scale: 1.03; transform-origin: 50% 58%; will-change: transform; transition: transform .85s cubic-bezier(.6,0,.25,1), opacity .5s .3s; }
/* Le passage : on s'approche de la façade jusqu'à ce qu'elle remplisse l'écran. */
body.tr-bord .tr-plan { transform: scale(3.2); opacity: 0; }
body.tr-bord #tr-avant { visibility: hidden; transition: visibility 0s .9s; }

/* Le logo de la boutique devant la tour. Il flotte à peine. */
.tr-nom { position: absolute; left: 50%; top: max(7svh, calc(env(safe-area-inset-top) + 30px)); width: min(80cqw, 43svh); margin: 0; translate: calc(-50% + var(--px, 0) * -6px) calc(var(--py, 0) * -4px); transition: opacity .3s; }
.tr-nom img { display: block; width: 100%; height: auto; }
.tr-anime .tr-nom { animation: tr-pose .7s .15s cubic-bezier(.34,1.4,.64,1) both; }
@keyframes tr-pose { from { opacity: 0; scale: .7; } }
.tr-anime .tr-nom img { animation: tr-flotte 5s 1s ease-in-out infinite; }
@keyframes tr-flotte { 50% { translate: 0 -7px; } }
.tr-nom.tr-coup img { animation: tr-coup .4s cubic-bezier(.34,1.56,.64,1); }
@keyframes tr-coup { 40% { scale: 1.05; rotate: -1.5deg; } }
/* Le logo répond au doigt. */
.tr-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 : le lettrage du logo. Jaune verni, contour violet, un rebord net dessous. */
.tr-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 28px 18px 34px; 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 #2b1e57; border-radius: 999px; color: #2b1e57; font: 900 20px/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 #2b1e57;
}
.tr-go svg { width: 12px; height: 17px; fill: none; stroke: #2b1e57; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.tr-anime .tr-go { animation: tr-monte .6s .5s cubic-bezier(.34,1.4,.64,1) both; }
@keyframes tr-monte { from { opacity: 0; translate: -50% 26px; } }
.tr-anime .tr-go svg { animation: tr-appel 1.6s ease-in-out infinite; }
@keyframes tr-appel { 50% { translate: 5px 0; } }
.tr-go:active { translate: -50% 5px; box-shadow: 0 2px 0 #2b1e57; }
body.tr-bord :is(.tr-nom, .tr-go, .tr-touche) { opacity: 0; pointer-events: none; animation: none; }
.tr-grain { position: fixed; z-index: 9999; width: 10px; aspect-ratio: 1; border-radius: 3px; pointer-events: none; background: var(--c, #ffc629); }

/* ---------- Le catalogue : la façade ---------- */
#tr-monde { display: none; }
/* La façade est le fond du catalogue lui-même : elle défile avec les fiches. Sa tuile se répète sans raccord. */
body.tr-bord #tr-monde {
  display: block; box-sizing: border-box; min-height: 100svh; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 20px) 6% 170px;
  background: #f2c24b url("heros/facade.webp?v=1") center top / 100% auto repeat-y;
  border-top: 14px solid #4a3696; box-shadow: inset 0 5px 0 #2b1e57; /* le rebord violet du toit : au-dessus, le ciel */
}
@media (min-width: 600px) { body.tr-bord #tr-monde { width: 56.25svh; } }
.tr-anime#tr-monde { animation: tr-entre .6s .25s cubic-bezier(.2,.8,.3,1) both; }
@keyframes tr-entre { from { opacity: 0; scale: 1.12; } }
.tr-rayon + .tr-rayon { margin-top: 30px; }
/* Le nom du rayon : la plaque d'un étage. */
.tr-rayon h2 { display: inline-flex; align-items: center; margin: 0 0 16px; padding: 10px 18px; border-radius: 12px; border: 3px solid #2b1e57;
  background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,0) 50%), #fff3d6; color: #2b1e57; font: 900 15px/1 'Poppins', system-ui, sans-serif; letter-spacing: .03em; box-shadow: 0 4px 0 #2b1e57; }
.tr-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; padding-bottom: 28px; }
/* Une fiche : une fenêtre de la tour et son balcon. La colonne de droite est un demi-étage plus bas. */
.tr-carte { position: relative; display: flex; flex-direction: column; cursor: pointer; }
.tr-carte:nth-child(even) { top: 28px; }
.tr-anime .tr-rayon:not(.tr-vu) .tr-carte { opacity: 0; }
.tr-anime .tr-rayon.tr-vu .tr-carte { animation: tr-arrive .5s calc(var(--n) * 70ms) cubic-bezier(.2,.8,.3,1.2) both; }
@keyframes tr-arrive { from { opacity: 0; translate: 0 22px; scale: .92; } 60% { opacity: 1; } }
.tr-carte.tr-tenu { scale: .97; }
/* La fenêtre : un renfoncement dans le mur, une vitre bleue derrière la photo. */
.tr-photo { position: relative; width: 100%; aspect-ratio: 1; box-sizing: border-box; overflow: hidden; border: 6px solid #d99f2b; border-bottom-width: 0; border-radius: 8px 8px 0 0; outline: 2.5px solid #2b1e57; outline-offset: -1px;
  background: linear-gradient(125deg, rgba(255,255,255,.35) 0 18%, rgba(255,255,255,0) 18% 34%, rgba(255,255,255,.18) 34% 40%, rgba(255,255,255,0) 40%), linear-gradient(170deg, #6fbdf5, #2f6fc4 55%, #1f4a93); }
.tr-photo > :is(img, video) { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Le balcon : il dépasse du mur, de chaque côté de la fenêtre. */
.tr-balcon { position: relative; display: flex; flex-direction: column; gap: 4px; margin: 0 -6px; padding: 10px 50px 11px 11px; min-height: 58px; box-sizing: border-box; justify-content: center;
  border: 2.5px solid #2b1e57; border-radius: 10px; box-shadow: 0 5px 0 #2b1e57;
  background: linear-gradient(180deg, rgba(255,255,255,.4), rgba(255,255,255,0) 42%), linear-gradient(180deg, #ffa53a, #f28c1e 60%, #df7610); }
.tr-balcon b { font: 800 13.5px/1.2 'Poppins', system-ui, sans-serif; color: #2b1e57; overflow-wrap: anywhere; }
.tr-prix { font: 900 15px/1 'Poppins', system-ui, sans-serif; color: #fff7e0; text-shadow: 0 1.5px 0 #2b1e57; }
.tr-prix small { font-weight: 700; font-size: 11px; }
#tr-monde .tr-plus { position: absolute; right: 7px; top: 50%; left: auto; bottom: auto; translate: 0 -50%; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 2.5px solid #ffc629 !important; border-radius: 50%; background: linear-gradient(180deg, #4a3696, #2b1e57) !important; box-shadow: none !important; }
#tr-monde .tr-plus svg { width: 18px; height: 18px; fill: none; stroke: #ffc629; stroke-width: 3.6; stroke-linecap: round; }
#tr-monde .tr-plus:active { scale: .88; }
.tr-vide { padding: 24px 16px; text-align: center; border-radius: 16px; border: 3px solid #2b1e57; background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,0) 50%), #fff3d6; color: #2b1e57; box-shadow: 0 5px 0 #2b1e57; }
.tr-vide b { display: block; margin-bottom: 4px; font: 900 19px/1.2 'Poppins', system-ui, sans-serif; }
.tr-vide span { font: 600 13.5px/1.4 'Poppins', system-ui, sans-serif; opacity: .85; }
/* Le produit ajouté descend vers le panier. */
.tr-envol { position: fixed; z-index: 9999; border-radius: 10px; object-fit: cover; pointer-events: none; outline: 2.5px solid #2b1e57; }

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