/* Accueil (choix A4 / 3D) et page des tableaux A4. S'appuie sur les couleurs de style.css. */

/* Apparition douce au défilement : le contenu reste visible sans JavaScript. */
.reveal { transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.pending { opacity: 0; transform: translateY(24px); }
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; }
  .reveal.pending { opacity: 1; transform: none; }
  .marquee-track { animation: none !important; }
  .float { animation: none !important; }
}

/* ---------- Accueil ---------- */
.home-hero { background: var(--espresso); color: var(--cream); position: relative; overflow: hidden; }
.home-hero .wrap { position: relative; z-index: 1; padding: 64px 0 40px; text-align: center; }
.home-hero h1 { font-family: var(--display); font-weight: 400; color: var(--gold); font-size: clamp(48px, 8vw, 96px); line-height: .95; margin: 14px auto 16px; max-width: 12ch; text-wrap: balance; }
html[dir="rtl"] .home-hero h1 { font-family: "Cairo", sans-serif; font-weight: 800; font-size: clamp(36px, 6vw, 64px); line-height: 1.2; }
.home-hero p { color: #d9cbb8; max-width: 34em; margin: 0 auto; font-size: 18px; }
.hero-frames { position: absolute; inset: 0; pointer-events: none; opacity: .22; }
.hero-frames img { position: absolute; width: clamp(80px, 12vw, 150px); aspect-ratio: 3/4; object-fit: cover; border: 6px solid #111; box-shadow: 0 18px 40px rgba(0,0,0,.6); border-radius: 2px; }
.float { animation: float 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-14px) rotate(var(--r, 0deg)); } }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: -8px; padding: 0 0 64px; position: relative; z-index: 2; }
.home-hero + .choices-wrap { background: linear-gradient(var(--espresso) 0 120px, var(--cream) 120px); }
.choice { position: relative; display: block; border-radius: 22px; overflow: hidden; min-height: 420px; color: #fff; box-shadow: 0 24px 50px rgba(26,17,11,.25); isolation: isolate; transform: translateZ(0); }
.choice img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); z-index: -2; }
.choice::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 25%, rgba(20,12,6,.55) 55%, rgba(20,12,6,.94)); z-index: -1; }
.choice::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.25), transparent); transform: skewX(-20deg); transition: left .9s ease; }
.choice:hover img { transform: scale(1.06); }
.choice:hover::after { left: 130%; }
.choice-body { position: absolute; inset-inline: 0; bottom: 0; padding: 26px; display: grid; gap: 8px; }
.choice h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 46px; line-height: 1; color: var(--gold); }
html[dir="rtl"] .choice h2 { font-family: "Cairo", sans-serif; font-weight: 800; font-size: 34px; }
.choice p { margin: 0; color: #eadfce; max-width: 30em; }
.choice .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.choice .from { font-weight: 800; font-size: 18px; }
.choice .go { display: inline-flex; align-items: center; gap: 8px; background: var(--gold); color: var(--espresso); padding: 12px 20px; border-radius: 999px; font-weight: 700; }
.choice .go span { transition: transform .3s; }
.choice:hover .go span { transform: translateX(4px); }
html[dir="rtl"] .choice .go span { transform: scaleX(-1); }

/* ---------- Défilement « plus vendus » ---------- */
.best { background: var(--paper); overflow: hidden; }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee-track { display: flex; gap: 16px; width: max-content; animation: marquee 70s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
html[dir="rtl"] .marquee-track { animation-direction: reverse; }
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee-track a, .marquee-track button { display: block; border: 0; padding: 0; background: none; flex: 0 0 auto; width: clamp(200px, 24vw, 280px); border-radius: 16px; overflow: hidden; box-shadow: 0 10px 24px rgba(42,28,19,.12); cursor: zoom-in; }
.marquee-track img { width: 100%; aspect-ratio: 928/1152; object-fit: cover; transition: transform .5s; }
.marquee-track a:hover img, .marquee-track button:hover img { transform: scale(1.04); }

/* ---------- Packs ---------- */
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pack { background: var(--paper); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 0 var(--line), 0 16px 36px rgba(42,28,19,.08); transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; position: relative; }
.pack:hover { transform: translateY(-6px); box-shadow: 0 1px 0 var(--line), 0 26px 50px rgba(42,28,19,.16); }
.pack-img { aspect-ratio: 928/1152; overflow: hidden; background: #e9e0d3; }
.pack-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s; }
.pack:hover .pack-img img { transform: scale(1.05); }
.pack-body { padding: 20px 20px 22px; display: grid; gap: 6px; }
.pack h3 { margin: 0; font-size: 20px; }
.pack .price { font-size: 30px; font-weight: 800; }
.pack .per { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.pack .btn { margin-top: 10px; }
.pack .ribbon-tag { position: absolute; top: 14px; inset-inline-end: 14px; background: var(--espresso); color: var(--gold); font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 999px; }

/* ---------- Galerie ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; margin-bottom: 18px; scrollbar-width: none; position: sticky; top: calc(64px + env(safe-area-inset-top, 0px)); z-index: 5; background: var(--cream); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 1.5px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 9px 16px; font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .2s, color .2s, border-color .2s; }
.chip.active { background: var(--espresso); color: var(--gold); border-color: var(--espresso); }
.chip small { opacity: .6; font-weight: 600; margin-inline-start: 4px; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.tile { position: relative; background: var(--paper); border-radius: 14px; overflow: hidden; box-shadow: 0 1px 0 var(--line); transition: transform .25s, box-shadow .25s; animation: pop .45s both; }
@keyframes pop { from { transform: scale(.96); } }
.tile.set { grid-column: span 2; }
.tile-img { display: flex; gap: 3px; background: #e9e0d3; cursor: zoom-in; border: 0; padding: 0; width: 100%; }
.tile-img img { flex: 1; min-width: 0; aspect-ratio: 3/4; object-fit: cover; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 10px 12px; }
.tile-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tile-title small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }
.add { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--espresso); color: var(--gold); font-size: 22px; line-height: 1; display: grid; place-items: center; transition: transform .2s, background .2s; }
.add:active { transform: scale(.9); }
.tile.selected { box-shadow: 0 0 0 3px var(--gold), 0 10px 24px rgba(42,28,19,.15); }
.tile.selected .add { background: var(--gold); color: var(--espresso); }
.tile .badge { position: absolute; top: 8px; inset-inline-start: 8px; background: var(--gold); color: var(--espresso); font-weight: 800; font-size: 13px; min-width: 28px; height: 28px; border-radius: 999px; display: none; place-items: center; padding: 0 8px; box-shadow: 0 4px 10px rgba(0,0,0,.2); }
.tile.selected .badge { display: grid; animation: bump .35s; }
@keyframes bump { 50% { transform: scale(1.25); } }
.more-wrap { text-align: center; margin-top: 24px; }

/* ---------- Barre de sélection ---------- */
.selbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 40; background: rgba(26,17,11,.97); color: var(--cream); padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); transform: translateY(110%); transition: transform .35s cubic-bezier(.2,.7,.2,1); box-shadow: 0 -10px 30px rgba(0,0,0,.25); }
.selbar.show { transform: none; }
.selbar .wrap { display: flex; align-items: center; gap: 14px; }
.sel-thumbs { display: flex; gap: 6px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.sel-thumbs::-webkit-scrollbar { display: none; }
.sel-thumbs button { flex: 0 0 auto; width: 40px; height: 52px; border-radius: 6px; overflow: hidden; border: 1.5px solid rgba(255,255,255,.25); padding: 0; position: relative; background: #333; }
.sel-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.sel-thumbs button::after { content: "×"; position: absolute; top: 0; inset-inline-end: 2px; color: #fff; font-size: 14px; text-shadow: 0 1px 2px #000; }
.sel-thumbs .slot { flex: 0 0 auto; width: 40px; height: 52px; border-radius: 6px; border: 1.5px dashed rgba(255,255,255,.3); }
.sel-info { display: grid; gap: 2px; text-align: end; flex: 0 0 auto; }
.sel-info strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.sel-info span { font-size: 12px; color: #c8b9a4; }
.sel-info .ready { color: var(--gold); }
.selbar .btn:disabled { opacity: .45; cursor: not-allowed; }
.progress { position: absolute; top: 0; inset-inline-start: 0; height: 3px; background: var(--gold); transition: width .35s; }
body.has-selbar { padding-bottom: 96px; }
.toast { position: fixed; left: 50%; bottom: 110px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .25s, transform .25s; z-index: 60; max-width: calc(100% - 32px); text-align: center; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Fenêtres (zoom et commande) ---------- */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(10,6,3,.78); backdrop-filter: blur(4px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.modal[hidden] { display: none !important; }
.lightbox-inner { display: flex; gap: 6px; max-width: min(960px, 100%); max-height: 86vh; }
.lightbox-inner img { min-width: 0; max-height: 86vh; width: auto; flex: 1 1 0; object-fit: contain; border-radius: 10px; }
.modal-close { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); inset-inline-end: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); font-size: 22px; color: var(--ink); }
.sheet { background: var(--paper); border-radius: 20px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 24px; animation: rise .35s cubic-bezier(.2,.7,.2,1); }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
.sheet h2 { margin: 0 0 4px; font-size: 22px; }
.sum-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 18px; }
.sum-thumbs img { width: 46px; height: 60px; object-fit: cover; border-radius: 6px; }
.sheet .sheet-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.sheet .x { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); padding: 0 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Bouton WhatsApp ---------- */
.wa { position: fixed; inset-inline-end: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 45; width: 58px; height: 58px; border-radius: 50%; background: #25d366; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(0,0,0,.25); transition: transform .2s, bottom .35s; }
.wa:hover { transform: scale(1.08); }
.wa::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #25d366; animation: ping 2.4s ease-out infinite; z-index: -1; }
@keyframes ping { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(1.7); opacity: 0; } }
.wa svg { width: 30px; height: 30px; fill: #fff; }
body.has-selbar .wa, body.has-sticky .wa { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

@media (max-width: 860px) {
  .choices { grid-template-columns: 1fr; }
  .choice { min-height: 340px; }
  .packs { grid-template-columns: 1fr; max-width: 440px; margin-inline: auto; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile.set { grid-column: span 2; }
  .field-row { grid-template-columns: 1fr; }
  .sel-info span { display: none; }
}
@media (min-width: 861px) and (max-width: 1100px) { .packs { gap: 16px; } }
.sheet .hint { color: var(--muted); font-size: 14px; margin: 4px 0 14px; }
.sheet .send-err { color: var(--err); font-weight: 600; font-size: 14px; text-align: center; margin: 10px 0 0; }
.sheet .opt-label { margin-bottom: 0; }
@media (max-width: 860px) {
  .hero-frames { opacity: .14; }
  .hero-frames img { width: 72px; border-width: 4px; }
}
@media (max-width: 860px) {
  .pack { flex-direction: row; align-items: stretch; }
  .pack-img { flex: 0 0 42%; aspect-ratio: auto; min-height: 210px; }
  .pack-body { padding: 16px; align-content: center; }
  .pack .price { font-size: 26px; }
  .pack h3 { font-size: 17px; }
  .pack .btn { padding: 12px 14px; font-size: 14px; }
  .pack .ribbon-tag { top: 10px; inset-inline-start: 10px; inset-inline-end: auto; font-size: 12px; }
}
@media (max-width: 860px) {
  .selbar .wrap { flex-wrap: wrap; gap: 10px; }
  .sel-thumbs { flex: 1 0 100%; order: -1; }
  .sel-info { text-align: start; flex: 1; }
  .sel-info span { display: block; }
  body.has-selbar { padding-bottom: 150px; }
  body.has-selbar .wa { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
}
/* Les triptyques se lisent toujours de gauche à droite, même en arabe. */
.tile-img, .lightbox-inner, .sum-thumbs { direction: ltr; }
.models.single { grid-template-columns: minmax(0, 520px); justify-content: center; }
.marquee.reverse .marquee-track { animation-direction: reverse; }
html[dir="rtl"] .marquee.reverse .marquee-track { animation-direction: normal; }
.marquee-3d .marquee-track img { aspect-ratio: 1122/1402; }
.slider-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.slider-head .sec-head { text-align: start; margin: 0; }
.best + .best { padding-top: 0; }
