/* ============ BOUTIQUE : PRODUIT + PAIEMENT ============ */
:root {
  --gold: #ffcf66;
  --gold-deep: #f0a93c;
  --gold-ink: #1d1304;
}

.shop-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 28px;
  visibility: hidden;
  pointer-events: none;
}
.shop-overlay.is-open { visibility: visible; pointer-events: auto; }
.shop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 8, 11, 0.62);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.shop-overlay.is-open .shop-backdrop { opacity: 1; }
.shop-panel {
  position: relative;
  width: min(1140px, 100%);
  max-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(820px 380px at 14% -4%, rgba(120, 140, 190, 0.13) 0%, rgba(120, 140, 190, 0) 55%),
    linear-gradient(160deg, #181b23 0%, #11131a 58%, #0d0f14 100%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 26px;
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  opacity: 0;
  transform: translateY(26px) scale(0.98);
  transition: opacity 0.4s ease, transform 0.55s var(--ease-out);
}
.shop-overlay.is-open .shop-panel { opacity: 1; transform: none; }

/* top bar : steps + close */
.shop-top {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 18px;
  padding: 20px 26px 18px 30px;
  border-bottom: 1px solid var(--hairline);
  flex: 0 0 auto;
}
.shop-steps { display: flex; align-items: center; gap: 14px; }
.shop-step {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: none;
  background: none;
  padding: 6px 2px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.3s ease;
}
.shop-step .step-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 11px;
  letter-spacing: 0.04em;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.shop-step.is-active { color: var(--ink); }
.shop-step.is-active .step-num {
  background: var(--ink);
  border-color: var(--ink);
  color: #14161c;
}
.shop-step:disabled { opacity: 0.45; cursor: default; }
.step-sep { width: 34px; height: 1px; background: rgba(255, 255, 255, 0.2); }
.shop-close {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink);
  transition: background-color 0.25s ease, color 0.25s ease;
}
.shop-close:hover { background: var(--ink); color: #14161c; }

/* views */
.shop-views {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
}
.shop-view {
  grid-area: 1 / 1;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(14px);
  filter: blur(8px);
  transition: opacity 0.45s ease, transform 0.55s var(--ease-out), filter 0.45s ease;
  pointer-events: none;
  z-index: 1;
}
.shop-view.is-active {
  opacity: 1;
  transform: none;
  filter: none;
  pointer-events: auto;
  z-index: 2;
}

/* ============ VUE PRODUIT ============ */
.prod-grid {
  display: grid;
  grid-template-columns: 1.04fr 1fr;
  gap: 44px;
  padding: 34px 44px 40px 40px;
  align-items: center;
}
.prod-gallery { position: relative; }
.g-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background:
    radial-gradient(420px 300px at 50% 30%, rgba(150, 165, 205, 0.14) 0%, rgba(150, 165, 205, 0) 70%),
    linear-gradient(170deg, #1b1f28 0%, #12141b 100%);
  cursor: grab;
}
.g-track.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.g-track::-webkit-scrollbar { display: none; }
.g-slide {
  position: relative;
  flex: 0 0 100%;
  aspect-ratio: 1 / 0.92;
  scroll-snap-align: center;
  display: grid;
  place-items: center;
  padding: 34px 34px 60px 34px;
}
.g-slide img {
  max-width: 78%;
  max-height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}
/* Premier visuel (pack complet) agrandi dans le cadre */
.g-slide:first-child { padding: 14px 14px 52px 14px; }
.g-slide:first-child img { max-width: 100%; max-height: 100%; }
.g-slide figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.g-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(13, 15, 20, 0.55);
  backdrop-filter: blur(6px);
  color: var(--ink);
  transition: background-color 0.25s ease, color 0.25s ease, opacity 0.2s ease;
}
.g-arrow:hover { background: var(--ink); color: #14161c; }
.g-arrow:disabled { opacity: 0.25; pointer-events: none; }
.g-prev { left: 14px; }
.g-next { right: 14px; }
.g-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.g-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.22);
  transition: background-color 0.3s ease, transform 0.3s ease;
}
.g-dot.is-active { background: var(--gold); transform: scale(1.25); }

/* product info */
.prod-info { display: flex; flex-direction: column; align-items: flex-start; }
.offer-row { display: flex; align-items: center; gap: 12px; }
.flash-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-ink);
  background: linear-gradient(108deg, var(--gold-deep) 0%, #ffe49a 28%, var(--gold) 52%, var(--gold-deep) 78%, #ffe49a 100%);
  background-size: 240% 100%;
  box-shadow: 0 0 26px -6px rgba(255, 200, 90, 0.55);
}
.save-chip {
  display: inline-grid;
  place-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 207, 102, 0.12);
  border: 1px solid rgba(255, 207, 102, 0.55);
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
@media (prefers-reduced-motion: no-preference) {
  .flash-badge { animation: flashPan 3s linear infinite; }
  @keyframes flashPan { to { background-position: -240% 0; } }
  .save-chip { animation: savePulse 2s ease-in-out infinite; }
  @keyframes savePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 207, 102, 0.35); }
    50% { box-shadow: 0 0 0 8px rgba(255, 207, 102, 0); }
  }
}
.prod-name {
  margin-top: 22px;
  font-weight: 300;
  font-size: clamp(34px, 3.4vw, 48px);
  letter-spacing: -0.01em;
  line-height: 1.05;
}
.prod-name b { font-weight: 500; letter-spacing: 0.18em; }
.price-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 14px;
}
.price-old {
  font-size: 20px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(255, 207, 102, 0.7);
}
.price-new {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--gold);
}
.price-per { font-size: 15px; font-weight: 500; color: var(--ink-soft); }
.prod-desc {
  margin-top: 16px;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 48ch;
  text-wrap: pretty;
}
.prod-includes {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 20px;
  font-size: 15.5px;
  line-height: 1.45;
}
.prod-includes li { display: flex; align-items: flex-start; gap: 11px; }
.prod-includes li::before {
  content: "\2713";
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--gold-ink);
  font-size: 10px;
}
.prod-warranty {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
  color: var(--ink-soft);
}
.prod-warranty img { width: 22px; height: 22px; filter: invert(1); opacity: 0.85; }
.shop-cta-big {
  width: 100%;
  margin-top: 0;
  padding: 18px 24px;
  border: none;
  border-radius: 999px;
  background: var(--ink);
  color: #14161c;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background-color 0.25s ease, transform 0.25s ease;
}
.shop-cta-big:hover { background: #ffffff; transform: scale(1.015); }
.prod-ship {
  width: 100%;
  margin: 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-soft);
}

/* action bar (partagée produit + paiement) */
.shop-back-m {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink);
  flex: 0 0 auto;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.shop-back-m:hover { background: var(--ink); color: #14161c; }
.shop-foot { display: flex; flex-direction: column; gap: 12px; }
.prod-foot {
  align-items: center;
  padding: 10px 44px 36px 44px;
  border-top: 1px solid var(--hairline);
}
.prod-foot .shop-cta-big { max-width: 460px; }
.foot-price { display: none; }

/* ============ VUE PAIEMENT ============ */
.pay-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  grid-template-areas: "summary fields" "summary foot";
  align-content: start;
  gap: 28px 40px;
  padding: 34px 44px 40px 40px;
}
.pay-summary {
  grid-area: summary;
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  padding: 26px;
}
.sum-prod { display: flex; align-items: center; gap: 16px; }
.sum-prod img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(170deg, #1b1f28 0%, #12141b 100%);
  padding: 8px;
}
.sum-prod .sum-text { display: flex; flex-direction: column; gap: 4px; }
.sum-name { font-size: 19px; font-weight: 500; }
.sum-name b { font-weight: 600; letter-spacing: 0.14em; }
.sum-term { font-size: 13.5px; color: var(--ink-soft); }
.sum-lines {
  display: flex;
  flex-direction: column;
  gap: 13px;
  border-top: 1px solid var(--hairline);
  padding-top: 20px;
  font-size: 15px;
}
.sum-line { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.sum-line > span:first-child { color: var(--ink-soft); }
.sum-old { text-decoration: line-through; text-decoration-color: rgba(255, 207, 102, 0.7); color: var(--ink-soft); }
.sum-line.save > span { color: var(--gold); font-weight: 600; }
.sum-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--hairline);
  padding-top: 16px;
  font-size: 17px;
  font-weight: 600;
}
.sum-total > span:last-child { font-size: 24px; color: var(--gold); }
.sum-flash {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--gold-ink);
  background: linear-gradient(108deg, var(--gold-deep) 0%, #ffe49a 30%, var(--gold) 55%, var(--gold-deep) 80%, #ffe49a 100%);
  background-size: 240% 100%;
  box-shadow: 0 0 30px -8px rgba(255, 200, 90, 0.5);
}
@media (prefers-reduced-motion: no-preference) {
  .sum-flash { animation: flashPan 3.4s linear infinite; }
}

/* form */
.pay-fields { grid-area: fields; display: flex; flex-direction: column; }
.pay-fields h3 {
  margin-top: 28px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.pay-fields h3 + * { margin-bottom: 0; }
.pay-fields h3:first-child { margin-top: 0; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field.span-2 { grid-column: span 2; }
.field label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field input,
.field select {
  font-family: inherit;
  font-size: 15.5px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 13px 15px;
  outline: none;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.field input::placeholder { color: rgba(236, 233, 226, 0.32); }
.field input:focus, .field select:focus { border-color: rgba(255, 207, 102, 0.7); background: rgba(255, 255, 255, 0.07); }
.field select option { background: #14161c; color: var(--ink); }

/* paiement à la livraison (option unique) */
.pay-cod {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 207, 102, 0.45);
  background: rgba(255, 207, 102, 0.07);
  color: var(--ink);
}
.pay-cod .cod-ic {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 207, 102, 0.14);
  color: var(--gold);
}
.pay-cod .cod-text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  font-weight: 500;
}
.pay-cod .opt-sub { font-size: 12.5px; font-weight: 400; color: var(--ink-soft); margin-top: 2px; }
.pay-cod .cod-check {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--gold-ink);
}
.pay-foot { grid-area: foot; display: flex; flex-direction: column; gap: 12px; }
.back-link {
  align-self: center;
  margin-top: 16px;
  border: none;
  background: none;
  font-size: 14.5px;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.25s ease;
}
.back-link:hover { color: var(--ink); }

/* ============ VUE CONFIRMATION ============ */
.merci {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  padding: 60px 40px;
}
.merci-check {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--gold-ink);
  box-shadow: 0 0 50px -10px rgba(255, 200, 90, 0.6);
}
.merci h2 {
  font-weight: 300;
  font-size: clamp(32px, 3.4vw, 46px);
  letter-spacing: -0.01em;
}
.merci p {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 48ch;
  text-wrap: pretty;
}
.merci .shop-cta-big { width: auto; padding: 16px 44px; }

/* ============ RESPONSIVE ============ */

/* Tablette : on dégroupe les colonnes mais on reste en panneau centré */
@media (max-width: 920px) and (min-width: 761px) {
  .pay-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "summary" "fields" "foot";
    gap: 26px;
  }
  .pay-summary { position: static; }
  .form-grid { grid-template-columns: 1fr 1fr; }
}

/* ============ TÉLÉPHONE — expérience pensée pour le mobile ============ */
@media (max-width: 760px) {
  .shop-overlay { padding: 0; align-items: stretch; }
  .shop-panel {
    width: 100%;
    max-height: none;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }

  /* Barre supérieure : retour · étapes · fermer */
  .shop-top { padding: 13px 12px; gap: 8px; }
  .shop-back-m:not([hidden]) { display: grid; }
  .shop-steps { flex: 1; justify-content: center; gap: 8px; }
  .shop-step { font-size: 11px; letter-spacing: 0.05em; gap: 7px; padding: 4px 2px; }
  .shop-step .step-num { width: 22px; height: 22px; font-size: 9.5px; }
  .step-sep { width: 16px; }
  .shop-close, .shop-back-m { width: 38px; height: 38px; }

  /* Les vues défilent ; la barre d'action reste collée en bas */
  .shop-view { -webkit-overflow-scrolling: touch; }
  .prod-grid {
    display: block;
    gap: 0;
    padding: 0 0 16px 0;
  }
  .prod-gallery { margin: 0; }
  .g-track {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .g-slide { aspect-ratio: 1 / 0.84; padding: 24px 24px 48px 24px; }
  .g-slide img { max-width: 74%; }
  .g-arrow { display: none; }
  .g-dots { margin-top: 14px; }
  .prod-info { padding: 6px 20px 8px 20px; }
  .prod-name { margin-top: 16px; }
  .offer-row { flex-wrap: wrap; }

  /* Barre d'action collante (produit + paiement) */
  .shop-foot {
    position: sticky;
    bottom: 0;
    z-index: 5;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(13, 15, 20, 0.82), #0d0f14 62%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 -18px 36px -24px rgba(0, 0, 0, 0.9);
  }
  .prod-foot {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 13px 16px calc(13px + env(safe-area-inset-bottom)) 16px;
  }
  .prod-foot .foot-price { display: flex; flex-direction: column; line-height: 1.08; flex: 0 0 auto; }
  .fp-old {
    font-size: 12.5px;
    color: var(--ink-soft);
    text-decoration: line-through;
    text-decoration-color: rgba(255, 207, 102, 0.7);
  }
  .fp-new { font-size: 21px; font-weight: 600; color: var(--gold); }
  .prod-foot .shop-cta-big {
    flex: 1 1 150px;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 16px 16px;
    font-size: 13.5px;
  }
  .prod-foot .prod-ship { order: 3; flex: 1 0 100%; margin: 0; font-size: 11.5px; }

  /* Paiement */
  .pay-grid {
    display: block;
    padding: 18px 16px 18px 16px;
  }
  .pay-summary { position: static; padding: 18px; margin-bottom: 20px; gap: 16px; }
  .sum-prod img { width: 64px; height: 64px; }
  .pay-fields h3:first-child { margin-top: 0; }
  .form-grid { grid-template-columns: 1fr; gap: 13px; margin-bottom: 22px; }
  .field.span-2 { grid-column: auto; }
  .field input, .field select { font-size: 16px; padding: 14px 15px; }
  .pay-seg { grid-template-columns: 1fr; }
  .pay-opt { padding: 16px; }
  .pay-foot {
    flex-direction: column;
    gap: 10px;
    padding: 13px 16px calc(13px + env(safe-area-inset-bottom)) 16px;
  }
  .pay-foot .shop-cta-big { margin: 0; }

  /* Confirmation */
  .merci { min-height: 0; padding: 56px 24px; }
}

/* RTL : la barre de retour pointe vers la droite */
body.lang-ar .shop-back-m svg { transform: scaleX(-1); }
body.lang-ar .back-link { direction: rtl; }

/* ============ CHECKOUT SOBRE + IMAGES SUR FOND BLANC ============ */
/* visuels produit sur fond blanc */
.g-track { background: #ffffff; border-color: rgba(0,0,0,0.08); }
.g-slide figcaption { color: rgba(20,22,28,0.55); }
.sum-prod img { background: #ffffff; border-color: rgba(0,0,0,0.10); }

/* fini le doré clinquant — palette sobre */
.flash-badge {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--hairline);
  color: var(--ink);
  box-shadow: none;
  animation: none !important;
}
.save-chip {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--hairline);
  color: var(--ink);
  box-shadow: none;
  animation: none !important;
}
.price-new { color: var(--ink); }
.price-old { text-decoration-color: rgba(236,233,226,0.45); }
.prod-includes li::before { background: var(--ink); color: #14161c; }
.fp-new { color: var(--ink); }
.fp-old { text-decoration-color: rgba(236,233,226,0.45); }
.sum-old { text-decoration-color: rgba(236,233,226,0.45); }
.sum-line.save > span { color: var(--ink); font-weight: 600; }
.sum-total > span:last-child { color: var(--ink); }
.sum-flash {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--hairline);
  color: var(--ink);
  box-shadow: none;
  animation: none !important;
}
.g-dot.is-active { background: var(--ink); }
