/* Thème Toits · « la nuit des toits » (Le Chat Poudré, 20/11/2026, direction choisie sur aperçu par Timour).
   La nuit, le chat est debout sur les toits devant une lune immense. Trois couches, posées par toits.js :
     #tt-vue      (derrière tout)   le ciel, la lune, deux nuages, la baie et ses lumières
     le catalogue (dans la page)    les fiches, qui flottent DEVANT la lune
     #tt-toits    (par-dessus)      les toits de l'accueil et le logo (le chat et son nom) devant la lune, puis les
                                    toits du catalogue (le chat allongé, de dos), le bouton, la poudre
   Toutes les planches font 9:16 et se posent dans la même boîte (.tt-cadre) : elles restent calées entre elles.
   États sur <body> : tt-accueil → tt-bord. tt-hors = on n'est pas sur l'onglet Produits.
   Le passage : le chat souffle, la poudre couvre l'écran, on monte vers la lune qui grossit.
   La profondeur : toits.js écrit --px et --py (de -1 à 1) ; chaque plan glisse d'une distance différente.
   Le héros et les rayons de Candy sont cachés ; le moteur garde la fiche, le panier et la commande. */
body[data-vitrine="toits"] #cl-vitrine > :is(.cl-hero, .cl-bande, .cl-rayons) { display: none !important; }
/* #tt-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="toits"][data-glossy="candy"] { background: transparent !important; }
html:has(body[data-vitrine="toits"]) { background: #07080d !important; }
body[data-vitrine="toits"].tt-accueil #cl-barre { display: none !important; }

#tt-vue, #tt-toits { position: fixed; inset: 0; overflow: hidden; container-type: inline-size; }
#tt-vue { z-index: -1; background: #07080d; }
#tt-toits { z-index: 2; pointer-events: none; }
body.tt-hors #tt-toits { 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) {
  #tt-vue, #tt-toits { left: 50%; right: auto; width: 56.25svh; translate: -50% 0; }
}
/* La boîte des planches : calée en bas (les toits se voient toujours), elle couvre la largeur. */
.tt-cadre { position: absolute; left: 50%; bottom: 0; width: max(100cqw, 56.25svh); aspect-ratio: 9 / 16; translate: -50% 0; }
.tt-cadre img { display: block; -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }
.tt-plein { position: absolute; inset: 0; width: 100%; height: 100%; }
:is(#tt-vue, #tt-toits) :is(.tt-ciel, .tt-lune, .tt-ville, .tt-plan) { will-change: transform; transition: transform 1.25s cubic-bezier(.5,0,.2,1), opacity .9s; }

/* ---------- Derrière : le ciel, la lune, la baie ---------- */
.tt-ciel { scale: 1.06; translate: calc(var(--px, 0) * -4px) calc(var(--py, 0) * -3px); }
body.tt-bord .tt-ciel { transform: translateY(3%); }
/* La lune : dessinée à sa taille du catalogue (nette), réduite sur l'accueil. Son halo respire. */
.tt-lune { position: absolute; left: 50%; top: 33%; width: 136%; aspect-ratio: 1; margin: -68% 0 0 -68%; transform: scale(.62); translate: calc(var(--px, 0) * -8px) calc(var(--py, 0) * -6px); }
.tt-lune img { width: 100%; height: 100%; }
.tt-lune::before { content: ""; position: absolute; inset: -24%; border-radius: 50%; background: radial-gradient(circle, rgba(255,214,130,.5) 38%, rgba(255,190,90,.2) 52%, rgba(255,190,90,0) 68%); }
.tt-anime .tt-lune::before { animation: tt-halo 6s ease-in-out infinite; }
@keyframes tt-halo { 50% { opacity: .55; scale: .95; } }
body.tt-bord .tt-lune { transform: scale(1); }
/* Deux nuages passent devant elle. */
.tt-nuage { position: absolute; left: 0; top: 22%; width: 110%; height: 13%; background: radial-gradient(ellipse at center, rgba(14,16,28,.34), rgba(14,16,28,0) 70%); translate: -110% 0; }
.tt-nuage + .tt-nuage { top: 38%; width: 80%; height: 10%; }
.tt-anime .tt-nuage { animation: tt-derive 75s linear infinite; }
.tt-anime .tt-nuage + .tt-nuage { animation-duration: 110s; animation-delay: -40s; }
@keyframes tt-derive { to { translate: 125% 0; } }
body.tt-bord .tt-nuage { display: none; }
.tt-ville { scale: 1.05; translate: calc(var(--px, 0) * -13px) calc(var(--py, 0) * -8px); }
body.tt-bord .tt-ville { transform: translateY(17%); }
/* Hors du catalogue (panier, infos, avis, contact) : la nuit s'assombrit pour laisser lire les panneaux. */
#tt-vue::after { content: ""; position: absolute; inset: 0; background: rgba(7,8,13,.62); opacity: 0; transition: opacity .4s; }
body.tt-hors #tt-vue::after { opacity: 1; }

/* ---------- Par-dessus : les toits ---------- */
/* L'accueil : le chat debout sur son toit. Au passage, la caméra monte : le toit descend et s'efface. */
.tt-plan--a { translate: calc(var(--px, 0) * 16px) calc(var(--py, 0) * 9px); scale: 1.03; transform-origin: 50% 100%; }
body.tt-bord .tt-plan--a { transform: translateY(46%); opacity: 0; }
/* Le catalogue : les toits en bas, le chat de dos. Ils montent à l'arrivée ; quand on fait défiler, ils redescendent
   un peu (on s'approche de la lune). */
.tt-plan--b { transform: translateY(32%); opacity: 0; translate: calc(var(--px, 0) * 10px) 0; }
body.tt-bord .tt-plan--b { transform: translateY(calc(9% + var(--penche, 0) * 13%)); opacity: 1; transition: transform .5s cubic-bezier(.2,.8,.3,1), opacity .9s; }

/* Le logo (le chat et son nom) devant la lune. */
.tt-nom { position: absolute; left: 50%; top: max(10svh, calc(env(safe-area-inset-top) + 40px)); width: min(84cqw, 45svh); margin: 0; translate: calc(-50% + var(--px, 0) * 6px) calc(var(--py, 0) * 4px); transition: opacity .4s; }
.tt-nom img { display: block; width: 100%; height: auto; }
.tt-nom.tt-coup img { animation: tt-coup .4s cubic-bezier(.34,1.56,.64,1); }
@keyframes tt-coup { 40% { scale: 1.05; rotate: -1.5deg; } }
.tt-anime .tt-nom { animation: tt-pose .7s .15s cubic-bezier(.34,1.4,.64,1) both; }
@keyframes tt-pose { from { opacity: 0; scale: .7; } }
/* Le chat répond au doigt. */
.tt-chat { position: absolute; left: 12%; top: 10svh; width: 76%; height: 30svh; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* Le bouton : une pastille d'or verni. */
.tt-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: 17px 26px 17px 32px; cursor: pointer; pointer-events: auto; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; white-space: nowrap;
  border: 2px solid #fff3d6; border-radius: 999px; color: #1a1206; font: 800 19px/1 'Poppins', system-ui, sans-serif; letter-spacing: .01em;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 46%), linear-gradient(180deg, #f7d98b, #d9a441 60%, #b9831f);
  box-shadow: 0 6px 0 #6b4a0c, 0 16px 28px rgba(0,0,0,.6), 0 0 26px rgba(255,200,100,.35), inset 0 -3px 0 rgba(120,70,0,.3); text-shadow: 0 1px 0 rgba(255,255,255,.45);
}
.tt-go svg { width: 12px; height: 17px; fill: none; stroke: #1a1206; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.tt-anime .tt-go { animation: tt-monte .6s .5s cubic-bezier(.34,1.4,.64,1) both; }
@keyframes tt-monte { from { opacity: 0; translate: -50% 26px; } }
.tt-anime .tt-go svg { animation: tt-appel 1.6s ease-in-out infinite; }
@keyframes tt-appel { 50% { translate: 5px 0; } }
.tt-go:active { translate: -50% 4px; box-shadow: 0 2px 0 #6b4a0c, 0 8px 14px rgba(0,0,0,.5), inset 0 -3px 0 rgba(120,70,0,.3); }
body.tt-bord :is(.tt-nom, .tt-go, .tt-chat) { opacity: 0; visibility: hidden; pointer-events: none; animation: none; transition: opacity .35s, visibility 0s .4s; }

/* Le nuage de poudre : il part de la patte du chat, couvre l'écran, et se dissipe pendant qu'on monte. */
.tt-nuee { position: absolute; left: 34%; top: 34%; width: 250vmax; aspect-ratio: 1; translate: -50% -50%; scale: 0; opacity: 0; border-radius: 50%;
  background: radial-gradient(circle, #fffdf6 0, #fff1cf 30%, rgba(255,222,150,.9) 48%, rgba(255,214,130,0) 68%); }
.tt-nuee.tt-souffle { animation: tt-souffle 1.25s cubic-bezier(.3,.6,.3,1) both; }
@keyframes tt-souffle { 0% { scale: .03; opacity: 0; } 10% { opacity: 1; } 34% { scale: 1; opacity: .96; } 100% { scale: 1.2; opacity: 0; } }
/* La poudre qui file dans le vent, les lumières de la baie. */
#tt-toits canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.tt-grain { position: fixed; z-index: 9999; width: 9px; aspect-ratio: 1; border-radius: 50%; pointer-events: none; background: var(--c, #fff3d6); box-shadow: 0 0 8px var(--c, #fff3d6); }

/* ---------- Le catalogue, devant la lune ---------- */
#tt-monde { display: none; }
/* Les marges suivent la boîte des planches : toits.js les calcule (--tt-g, --tt-d). */
body.tt-bord #tt-monde { display: block; padding: 14px var(--tt-d, 6%) 46svh var(--tt-g, 6%); }
.tt-rayon + .tt-rayon { margin-top: 26px; }
/* Le nom du rayon : une pastille d'or. */
.tt-rayon h2 { display: inline-flex; align-items: center; margin: 0 0 12px; padding: 9px 18px; border-radius: 999px; border: 1.5px solid #fff3d6;
  background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0) 50%), linear-gradient(180deg, #f7d98b, #d9a441); color: #1a1206; font: 800 14px/1 'Poppins', system-ui, sans-serif; letter-spacing: .04em; box-shadow: 0 6px 14px rgba(0,0,0,.4); }
.tt-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* Une fiche : un écrin noir verni à liseré d'or, qui se détache sur la lune. */
.tt-carte { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 11px; cursor: pointer; border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,0) 34%), linear-gradient(180deg, #1c1e2b, #0b0c12); border: 1.5px solid #e8c478; box-shadow: 0 12px 24px rgba(20,10,0,.5), inset 0 1px 0 rgba(255,255,255,.14); }
.tt-anime .tt-rayon:not(.tt-vu) .tt-carte { opacity: 0; }
.tt-anime .tt-rayon.tt-vu .tt-carte { animation: tt-arrive .55s calc(var(--n) * 80ms) cubic-bezier(.2,.8,.3,1.2) both; }
@keyframes tt-arrive { from { opacity: 0; translate: 0 26px; scale: .9; } 60% { opacity: 1; } }
.tt-carte.tt-tenu { scale: .97; }
.tt-photo { width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: radial-gradient(circle at 50% 35%, #2a2d40, #0d0f17); }
.tt-photo > :is(img, video) { display: block; width: 100%; height: 100%; object-fit: cover; }
.tt-carte b { padding: 0 3px; font: 700 13.5px/1.2 'Poppins', system-ui, sans-serif; color: #fff6e6; overflow-wrap: anywhere; }
.tt-prix { padding: 0 3px; font: 800 14.5px/1 'Poppins', system-ui, sans-serif; color: #f2c66d; }
.tt-prix small { font-weight: 500; color: rgba(255,246,230,.7); }
#tt-monde .tt-plus { position: absolute; right: 12px; top: 12px; left: auto; bottom: auto; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 2px solid #fff3d6 !important; border-radius: 50%; background: linear-gradient(180deg, #f7d98b, #d9a441) !important; box-shadow: 0 5px 12px rgba(0,0,0,.5), inset 0 -2px 0 rgba(120,70,0,.25) !important; }
#tt-monde .tt-plus svg { width: 18px; height: 18px; fill: none; stroke: #1a1206; stroke-width: 3.2; stroke-linecap: round; }
#tt-monde .tt-plus:active { scale: .88; }
.tt-vide { padding: 22px 16px; text-align: center; border-radius: 18px; border: 1.5px solid #e8c478; background: linear-gradient(180deg, #1c1e2b, #0b0c12); color: #fff6e6; box-shadow: 0 12px 24px rgba(20,10,0,.5); }
.tt-vide b { display: block; margin-bottom: 4px; font: 800 18px/1.2 'Poppins', system-ui, sans-serif; color: #f2c66d; }
.tt-vide span { font: 500 13.5px/1.4 'Poppins', system-ui, sans-serif; opacity: .8; }
/* Le produit ajouté descend vers le panier. */
.tt-envol { position: fixed; z-index: 9999; border-radius: 12px; object-fit: cover; pointer-events: none; box-shadow: 0 0 16px rgba(242,198,109,.8); }

@media (prefers-reduced-motion: reduce) {
  .tt-go svg { animation: none; }
  :is(#tt-vue, #tt-toits) :is(.tt-ciel, .tt-lune, .tt-ville, .tt-plan) { transition: none; }
}
