/* Product hero */

#product-hero {
  padding: 0 var(--global-padding);

  min-height: 100svh;

  display: flex;
}

#product-hero .container {
  padding: 4rem 0;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: space-between;

  position: relative;

  z-index: 2;
}

#product-hero p {
  margin-bottom: 1.5rem;

  text-align: center;
}

#product-hero video {
  position: absolute;

  top: 0;

  left: 0;

  width: 100vw;

  height: 100svh;

  object-fit: cover;

  z-index: 1;
}

/* Section presentation */

#presentation {
  padding: 0 var(--global-padding);

  overflow: hidden;
}

#presentation .container {
  margin-top: 6rem;

  display: grid;

  grid-template-columns: var(--grid-template);

  grid-gap: var(--grid-gapcolumn);
}

#presentation .content {
  grid-column: 1/8;

  grid-row: 1/1;
}

#presentation .content p {
  margin: 1rem 0 2rem 0;
}

#presentation img {
  grid-column: 8/13;

  width: calc(100% + var(--global-padding));
}

/* Animation section */

#presentation.to-reveal .content {
  transform: translateY(2rem);

  opacity: 0;

  transition:
    opacity 1.5s var(--anim-bezier),
    transform 1.5s var(--anim-bezier);
}

#presentation.to-reveal.reveal .content {
  transform: translateY(0);

  opacity: 1;
}

#presentation.to-reveal img {
  transform: scale(1.3);

  transition: transform 1.5s var(--anim-bezier);
}

#presentation.to-reveal.reveal img {
  transform: scale(1);
}

/* Choix de la couleur */

#car-colors {
  padding: 0 var(--global-padding);

  min-height: 100svh;

  display: flex;

  background: var(--bg-current);

  transition: background 500ms var(--anim-bezier);
}

#car-colors .container {
  display: grid;

  grid-template-columns: var(--grid-template);

  column-gap: var(--grid-gapcolumn);
}

#car-colors .color-buttons {
  display: flex;

  flex-direction: column;

  gap: 1.5rem;

  grid-column: 1/4;

  margin-top: 8rem;
}

#car-colors .color-buttons h2 {
  display: block;

  width: 24rem;
}

#car-colors.inverse h2 {
  color: var(--txt-inverse-default);
}

#car-colors button {
  display: flex;

  align-items: center;

  color: var(--txt-alt);

  gap: 1rem;

  cursor: pointer;
}

#car-colors button:hover span:last-child {
  opacity: 0.6;
}

#car-colors button.active {
  color: var(--txt-primary);

  pointer-events: none;
}

#car-colors.inverse button {
  color: var(--txt-inverse-alt);

  transition: color 500ms var(--anim-bezier);
}

#car-colors.inverse button.active {
  color: var(--txt-inverse-default);
}

#car-colors .swatch {
  display: inline-block;

  width: 3rem;

  height: 3rem;

  background-color: var(--swatch-color);

  flex-shrink: 0;

  box-sizing: border-box;
}

#car-colors button.active .swatch {
  border: solid 0.125rem var(--txt-primary);
}

#car-colors .car-viewer {
  grid-column: 4/13;

  grid-row: 1/1;

  position: relative;
}

#car-colors .car-viewer .car-img {
  position: absolute;

  top: 0;

  left: 0;

  width: 100%;

  height: 100%;

  object-fit: contain;

  opacity: 0;

  z-index: 0;

  transition: opacity 500ms var(--anim-bezier);
}

#car-colors .car-viewer .car-img.active {
  opacity: 1;
}

/* Design */

/* --- SECTION DESIGN (Le Conteneur Épinglé) --- */

#design {
  height: 100vh;
  position: relative;
  overflow: hidden; /* Important pour ne pas voir le texte déborder quand il grandit */
  background-color: var(--bg-inverse-default); /* Couleur de fond de sécurité */
}

/* --- CALQUE 1 : LE FOND (Le Slider - En dessous) --- */

.reveal-bg {
  position: absolute;

  top: 0;

  left: 0;

  width: 100%;

  height: 100%;

  z-index: 1;

  opacity: 1;

  background-color: var(--bg-primary);

  padding-top: 3rem;
}

/* --- CALQUE 2 : LE MASQUE (Le Texte - Au dessus) --- */

/* product.css */

/* --- SECTION DESIGN --- */

#design {
  height: 100vh;

  position: relative;

  overflow: hidden;

  background-color: var(--bg-inverse-default);

  z-index: 1;
}

/* Le Masque (Fond uni) */

#design .reveal-mask {
  position: absolute;

  top: 0;

  left: 0;

  width: 100%;

  height: 100%;

  z-index: 2;

  display: flex;

  align-items: center;

  justify-content: center;

  text-align: center;

  background-color: var(--bg-inverse-default);

  /* IMPORTANT : Pour que le pochoir fonctionne proprement */

  isolation: isolate;
}

/* Le Texte (Configuration HD) */

#design {
  height: 100vh;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-inverse-default); /* Fond sombre */
  z-index: 1;
}

/* Le Masque (Fond uni) */

#design .reveal-mask {
  position: absolute;

  top: 0;

  left: 0;

  width: 100%;

  height: 100%;

  z-index: 2;

  display: flex;

  align-items: center;

  justify-content: center;

  text-align: center;

  padding: 0 var(--global-padding);
}

.cursor-drag {
  position: fixed;

  top: 0;

  left: 0;

  display: flex;

  padding: 1.5rem;

  backdrop-filter: blur(0.5rem);

  background-color: rgba(0, 0, 0, 0.6);

  z-index: 999;

  pointer-events: none !important;

  transform: translate(-50%, -50%);

  opacity: 0;
}

.cursor-drag svg {
  width: 3rem;

  height: 3rem;

  color: var(--txt-inverse-default);
}

.splide__arrows.invisible,
.splide__arrows.invisible .splide__arrow,
.splide__arrows.invisible .splide__arrow * {
  cursor: none !important;
}

.reveal-bg .splide {
  height: 100%;

  position: relative;

  display: flex;

  flex-direction: column;
}

.reveal-bg .splide__track {
  height: 100%;
}

#splide-design .splide__list,
#splide-design .splide__slide {
  height: 100%;

  width: 100%;
}

.splide img {
  width: 100%;

  height: 100%;

  object-fit: cover;
}

.splide__arrows.invisible {
  position: absolute;

  top: 0;

  left: 0;

  display: flex;

  width: 100%;

  height: calc(100% - 3rem);

  z-index: 5;

  cursor: none !important;
}

.splide__arrow {
  width: 100%;

  display: block;
}

.carousel-control {
  display: flex;

  flex-direction: row;

  gap: 2rem;

  min-height: 3rem;

  margin: 0 var(--global-padding);

  align-items: center;

  margin-bottom: 3rem;
}

.carousel-control .splide__arrows {
  display: flex;

  flex-direction: row;

  gap: 1rem;
}

.carousel-control .splide__arrow svg {
  width: 1.5rem;

  height: 1.5rem;
}

.carousel-control button.splide__arrow {
  display: flex;

  width: 1.5rem;

  aspect-ratio: 1/1;

  cursor: pointer;

  position: relative;

  color: var(--txt-primary);

  overflow: visible;

  transition: opacity 500ms var(--anim-bezier);
}

.carousel-control .splide__arrow--prev {
  transform: scaleX(-1);
}

.carousel-control .splide__arrow svg {
  transition: transform 500ms var(--anim-bezier);
}

.carousel-control .splide__arrow:hover svg {
  transform: translateX(0.25rem);
}

.carousel-control .splide__arrow::after {
  content: "";

  height: 1px;

  width: 0.5rem;

  position: absolute;

  left: 0.125rem;

  top: 50%;

  transform: translateY(-50%);

  background-color: currentColor;
}

.my-carousel-progress {
  height: 0.125rem;

  width: 100%;

  background-color: var(--bg-alt);
}

.my-carousel-progress-bar {
  background-color: var(--bg-inverse-default);

  height: 100%;

  width: 0;

  transition: width 500ms var(--anim-bezier);
}

/* --- SECTION INTERIOR --- */

#interior {
  position: relative;
  background-color: var(--bg-primary);
}

/* 2. Le Masque (Texte + Toit Panoramique) DOIT être au-dessus */

#interior .reveal-mask {
  width: 100%;
  height: 100svh;
  z-index: 2; /* Au-dessus du slider */
  background-color: var(--bg-primary);
  position: relative;
}

#interior .reveal-mask .container {
  padding: 4rem var(--global-padding) 0 var(--global-padding);
  text-align: center;
}

/* 3. Le Slider (Caché derrière au début) */

#interior .reveal-bg {
  width: 100%;
  height: 100svh;
  position: relative;
}

/* 4. Les images du toit dans le masque */

#interior .reveal-mask .img-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

#interior .reveal-mask img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#interior .reveal-mask .no-back {
  z-index: 2;
}
#interior .reveal-mask .with-back {
  z-index: 3;
}

#interior .reveal-mask img.with-back {
  opacity: 0;
}
@supports (animation-timeline: scroll()) {
  #interior {
    position: relative;
    background-color: var(--bg-primary);
    height: 300svh;
    scroll-timeline: --synchro-scroll block;
  }
  #interior .reveal-mask {
    position: sticky;
    top: 0;
    animation-timeline: view();
    animation-range: entry 100% exit 0%;
    animation-name: anim-opacity;
    animation-fill-mode: both;
    animation-timing-function: linear;
  }
  @keyframes anim-opacity {
    0%,
    80% {
      opacity: 1;
    }
    85%,
    100% {
      opacity: 0;
      pointer-events: none;
    }
  }
  #interior .reveal-mask .img-wrapper {
    inset: 0;
    margin: auto;
    animation-timeline: view();
    animation-range: entry 100% exit 0%;
    animation-name: anim-resize;
    animation-fill-mode: both;
    animation-timing-function: linear;
  }
  @keyframes anim-resize {
    25% {
      width: 100%;
      height: 100%;
    }
    75%,
    100% {
      width: calc(100vw - var(--global-padding) * 2);
      max-width: 112.5rem;
      height: calc(100svh - 9rem);
      transform: translateY(-1.5rem);
    }
  }
  #interior .reveal-mask .with-back {
    animation-timeline: view();
    animation-range: entry 100% exit 0%;
    animation-name: anim-back-opacity;
    animation-fill-mode: both;
    animation-timing-function: linear;
  }
  @keyframes anim-back-opacity {
    30% {
      opacity: 0;
    }
    90% {
      opacity: 1;
    }
  }
  #interior .reveal-mask h2 {
    animation-timeline: view();
    animation-range: entry 100% exit 0%;
    animation-name: anim-txt;
    animation-fill-mode: both;
    animation-timing-function: linear;
  }
  @keyframes anim-txt {
    50% {
      transform: translateY(0);
      opacity: 1;
    }
    80%,
    100% {
      transform: translateY(-2rem);
      opacity: 0;
    }
  }
  #interior .reveal-bg {
    position: sticky;
    z-index: 1;
    top: 0;
    left: 0;
    opacity: 0;
    animation-timeline: view();
    animation-range: entry 0% cover 50%;
    animation-name: anim-apparition;
    animation-fill-mode: both;
    animation-timing-function: linear;
  }
  @keyframes anim-apparition {
    0%,
    75% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }
}

/* Section More */
section#more {
  margin: 0 var(--global-padding);
}
section#more.to-reveal {
  transform: translateY(2rem);
  opacity: 0;
  transition:
    transform 1.5s var(--anim-bezier),
    opacity 1.5s var(--anim-bezier);
}
section#more.to-reveal.reveal {
  transform: translateY(0);
  opacity: 1;
}
@scope (section#more) {
  .container {
    padding: 6rem 0;
  }
  .arguments-wrapper {
    margin: 3rem 0;
    display: flex;
    flex-direction: row;
    gap: 3rem;
  }
  .card-argument {
    flex: 1;
  }
  .card-argument img {
    width: 100%;
    aspect-ratio: 1/1;
    margin-bottom: 0.5rem;
  }
}

/* Layout big number */
@scope (.big-number) {
  h2 {
    margin-bottom: 0.5rem;
  }
  .head {
    max-width: 44.25rem;
  }
  .big-number-wrapper {
    display: flex;
    flex-direction: row;
    gap: 7.5rem;
    margin: 5rem 0 1rem;
  }
  h3 {
    display: flex;
    flex-direction: column;
  }
  h3 span {
    font-size: 8.75rem;
    line-height: 0.9;
    letter-spacing: -0.04em;
  }
  p {
    margin-bottom: 5rem;
  }
}
section#autonomy,
section#recharge {
  display: flex;
  align-items: center;
  margin: 0 var(--global-padding);
}
section#autonomy .container,
section#recharge .container {
  margin: unset;
  position: relative;
  z-index: 2;
}
/* Section autonomy */
section#autonomy {
  padding: 6rem 0;
}
section#autonomy.to-reveal {
  transform: translateY(2rem);
  opacity: 0;
  transition:
    transform 1.5s var(--anim-bezier),
    opacity 1.5s var(--anim-bezier);
}
section#autonomy.to-reveal.reveal {
  transform: translateY(0);
  opacity: 1;
}
/* Section recharge */
#recharge {
  min-height: 100svh;
  position: relative;
}
#recharge::after {
  content: "";
  background: var(--bg-inverse-brand);
  width: 100vw;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transform: translateX(calc(-1 * var(--global-padding))) scaleX(0);
  z-index: 1;
  transition: transform 5s var(--anim-bezier);
  transform-origin: left;
}
#recharge.reveal::after {
  transform: translateX(calc(-1 * var(--global-padding))) scaleX(1);
}

/* Section links */
#links {
  padding: 6rem var(--global-padding) 12.5rem;
}
#links h2 {
  margin-bottom: 2rem;
}
#links .links-wrapper {
  display: flex;
  flex-direction: row;
  gap: 3rem;
}
@scope (.links-wrapper) {
  .link-card {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 8rem;
    background-color: var(--bg-inverse-alt);
    justify-content: space-between;
    overflow: hidden;
  }
  .link-card:last-child {
    background-color: var(--bg-brand);
  }
  .link-card:hover img {
    transform: scale(1);
    opacity: 1;
  }
  h3 {
    position: relative;
    z-index: 3;
  }
  img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    top: 0;
    left: 0;
    opacity: 0;
    transform: scale(1.05);
    transition:
      opacity 500ms var(--anim-bezier),
      transform 500ms var(--anim-bezier);
  }
  .btn.secondary.underline {
    --btn-txt: var(--txt-inverse-default);
    --btn-stroke: var(--txt-inverse-default);
    --btn-icon-color: var(--txt-inverse-default);
  }
  a.btn.underline {
    color: var(--btn-txt);
  }
}
