/* ======================================================================
   OFFRES — carrousel à lentille courbe (WebGL)
   Balisage : index.html, <section class="lens" id="produits">
   Scripts  : sections/05-offers/offers.js (les cinq offres), curved-carousel.js (la scène)
   ====================================================================== */

/* Two stacked bands, never one over the other: the stage with its cards
   (each card carries its title in a clear glass bubble at its foot), then the active offer in text.
   Nothing is written on the cards from the page, and no card is cut. */

.lens {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip; /* never scrollable, even by a focus or scrollIntoView */
  /* Kept short at the top so the cards come right after the figures band. */
  padding-block: clamp(20px, 3vh, 32px) clamp(44px, 5vw, 68px);
  background: linear-gradient(to bottom var(--in-oklab), var(--hero-sky-bottom, #002565), var(--navy-abyss));
  color: var(--sky-light);
  user-select: none;
  -webkit-user-select: none;
}

/* The section takes focus so the arrow keys can drive the carousel, but it is never framed:
   a click anywhere in it would draw that frame. Reached with the Tab key, it lights its two
   arrows instead (class set by the script). */
.lens:focus,
.lens:focus-visible {
  outline: none;
}

.lens.is-keyed .lens-btn {
  outline: 2px solid var(--sky-light);
  outline-offset: 3px;
}

.lens-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Height of the tallest card plus a margin; the script sets the exact figure.
   Five cards across on a desktop: the same card size as the first version. */
.lens-stage {
  position: relative;
  height: calc(min(100vw, 1920px) * 0.4834 + 20px);
}

@media (max-width: 999px) {
  .lens-stage { height: calc(71.1vw + 20px); }
}

.lens-glow {
  position: absolute;
  inset: -8% -20%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(155, 199, 231, 0.2), transparent 70%);
  pointer-events: none;
}

.lens-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
}

.lens-canvas:active { cursor: grabbing; }

/* Until the WebGL stage is live (or if it never is), the active photo is shown flat. */
.lens-fallback {
  position: absolute;
  left: 50%;
  top: 50%;
  width: auto;
  height: 64%;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  object-fit: cover;
  transform: translate(-50%, -50%);
}

.lens.is-live .lens-fallback { display: none; }

/* Pulled up a little into the empty foot of the stage, to sit closer to the cards
  . Only the buttons take the pointer, so a drag still reaches the cards. */
.lens-info {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -40px;
  text-align: center;
  pointer-events: none;
}

.lens-info button { pointer-events: auto; }

.lens-copy { margin-top: 22px; }

/* The offer name is on its card; in text it only shows when the cards cannot. */
.lens-name {
  margin-bottom: 10px;
  font-family: 'Outfit', 'Avenir Next', 'Century Gothic', sans-serif;
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 300;
  line-height: 1.05;
  text-transform: uppercase;
  color: #FFFFFF;
}

.lens.is-live .lens-name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.lens-kicker {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.78;
}

/* Reference price struck through, then the launch price in the site's pink. */
.lens-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px 14px;
  margin-top: 12px;
  font-family: 'Outfit', 'Avenir Next', 'Century Gothic', sans-serif;
}

.lens-price s {
  font-size: 21px;
  font-weight: 300;
  text-decoration-thickness: 1px;
  color: #FFFFFF;
  opacity: 0.6;
}

.lens-price strong {
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
  color: var(--peach);
}

.lens-badge {
  align-self: center;
  padding: 6px 12px;
  border: 1px solid rgba(226, 242, 254, 0.5);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.lens-badge[hidden] { display: none; }

.lens-cap {
  max-width: 58ch;
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.55;
}

.lens-kicker,
.lens-price,
.lens-cap {
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.9, 0.1, 1);
}

.lens-copy:not(.is-in) .lens-kicker,
.lens-copy:not(.is-in) .lens-price,
.lens-copy:not(.is-in) .lens-cap {
  opacity: 0;
  transform: translateY(8px);
}

.lens-copy.is-in .lens-cap { opacity: 0.84; }

/* Arrows and order button come first, right under the cards; the text follows. */
.lens-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Fixed width, set for the longest label: the arrows on each side never move. */
.lens-order {
  width: 280px;
  min-height: 48px;
  padding: 0 20px 0 24px;
  font-size: 15.5px;
}

.lens-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  color: inherit;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1), background 0.3s ease, border-color 0.3s ease;
}

.lens-btn:hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
  transform: translateY(-2px) scale(1.06);
}

.lens-btn:active { transform: scale(0.94); }

.lens-btn:focus-visible {
  outline: 2px solid var(--sky-light);
  outline-offset: 3px;
}

.lens-btn svg {
  width: 18px;
  height: 18px;
}

.lens-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.lens-count {
  font-size: 12px;
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.lens-count i {
  font-style: normal;
  opacity: 0.5;
}

.lens-bar {
  width: 132px;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(226, 242, 254, 0.18);
}

.lens-bar > span {
  display: block;
  height: 100%;
  background: var(--sky-light);
  transform-origin: 0 50%;
  transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.1, 1);
}

.lens.is-static .lens-btn,
.lens.is-static .lens-progress { display: none; }

@media (max-width: 640px) {
  .lens-stage { height: calc(146.5vw + 20px); }
  .lens-info { margin-top: -20px; } /* less room under the cards on a phone */
  .lens-price strong { font-size: 32px; }
  .lens-cap { font-size: 14px; }
  /* Arrows at both ends of the row, the button takes what is left between them. */
  .lens-actions {
    width: 100%;
    max-width: 360px;
    gap: 10px;
  }

  .lens-order {
    flex: 1;
    width: auto;
    min-width: 0;
    gap: 8px;
    padding: 0 12px;
    font-size: 13.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lens-kicker,
  .lens-price,
  .lens-cap,
  .lens-bar > span,
  .lens-btn { transition: opacity 0.2s ease; }

  .lens-copy:not(.is-in) .lens-kicker,
  .lens-copy:not(.is-in) .lens-price,
  .lens-copy:not(.is-in) .lens-cap { transform: none; }
}
