.porsche-test-controls {
  width: min(100%, 480px);
  margin: 20px auto 0;
}

#porsche-status {
  margin-top: 12px;
  color: #666666;
  font-size: 14px;
}

#porsche-viewer {
  display: block;
  width: min(100%, 1000px);
  height: 450px;
  flex-shrink: 0;
  margin: 20px auto 0;
  background: #ffffff;
}

@media (max-width: 767.98px) {
  #porsche-viewer {
    height: 320px;
  }
}

/* Hauteur disponible pour effectuer la rotation */

#garage-animation {
  position: relative;
  min-height: 0;
  height: 500vh;
  height: 500svh;
}

/* La scène reste sous la navbar pendant le défilement */

#garage-animation .garage-scene {
  position: sticky;
  top: var(--navbar-height, 100px);
  height: calc(100vh - var(--navbar-height, 100px));
  height: calc(100svh - var(--navbar-height, 100px));
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 20px 10px;
}

#garage-animation .garage-eyebrow {
  margin-bottom: 8px;
}

#garage-animation h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 5vw, 56px);
}

#garage-animation .garage-scene > p:not(.garage-eyebrow) {
  margin-bottom: 8px;
}

/* Sélecteur temporaire, plus compact */

.porsche-test-controls {
  flex-shrink: 0;
  margin: 8px auto 0;
}

.porsche-test-controls .form-label {
  font-size: 13px;
  margin-bottom: 4px;
}

#porsche-status {
  margin: 6px 0;
  font-size: 12px;
}

/* Le modèle occupe la hauteur restante */

#porsche-viewer {
  flex: 1 1 0;
  min-height: 0;
  display: block;
  width: min(100%, 1100px);
  height: auto;
  margin: 0 auto;
  background: #ffffff;
  pointer-events: none;
}

/* Le sélecteur disparaît après le chargement */

#garage-animation.model-loaded .porsche-test-controls {
  display: none;
}

@media (max-width: 767.98px) {
  #garage-animation .garage-scene {
    padding: 14px 10px 8px;
  }
}

@media (max-width: 767.98px) {
  #garage-animation h1 {
    font-size: clamp(26px, 7vw, 38px);
  }
}

@media (max-width: 767.98px) {
  #garage-animation .garage-scene > p {
    font-size: 13px;
  }
}

/* Titre placé au-dessus de la voiture */

#garage-animation .garage-scene {
  isolation: isolate;
}

#garage-animation .garage-scene > .garage-eyebrow, #garage-animation .garage-scene > h1 {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
}

/* Le sélecteur temporaire reste utilisable */

#garage-animation .porsche-test-controls {
  position: relative;
  z-index: 5;
}

/* Mise en page finale activée après chargement */

#garage-animation.model-loaded #porsche-viewer {
  position: absolute;
  z-index: 0;
  top: 23%;
  left: 24%;
  width: 52%;
  height: 64%;
  margin: 0;
}

/* Les informations restent masquées avant le chargement */

.garage-informations, .garage-animation-footer {
  display: none;
}

#garage-animation.model-loaded .garage-informations {
  display: block;
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.garage-info {
  position: absolute;
  top: 43%;
  left: 4%;
  width: 25%;
  max-width: 340px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  transition: opacity 350ms ease, transform 350ms ease, visibility 350ms;
  pointer-events: none;
}

/* Deuxième et quatrième informations à droite */

.garage-info:nth-child(even) {
  left: auto;
  right: 4%;
}

.garage-info.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.garage-info-label {
  margin-bottom: 10px;
  color: #d9773a;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
}

.garage-info h2 {
  margin-bottom: 14px;
  color: #171717;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(26px, 3vw, 44px);
  font-weight: 700;
  line-height: 1.05;
}

.garage-info > p:not(.garage-info-label) {
  color: #666666;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.garage-info-button {
  padding: 10px 18px;
  border: 1px solid #d9773a;
  border-radius: 6px;
  background: #d9773a;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
}

.garage-info-button:hover, .garage-info-button:focus-visible {
  border-color: #b85d28;
  background: #b85d28;
  color: #ffffff;
}

/* Indicateur en bas de la scène */

#garage-animation.model-loaded .garage-animation-footer {
  display: block;
  position: absolute;
  z-index: 3;
  bottom: 3%;
  left: 50%;
  transform: translateX(-50%);
  width: min(240px, 65%);
  color: #777777;
  text-align: center;
  font-size: 11px;
  pointer-events: none;
}

.garage-animation-track {
  height: 3px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 10px;
  background: #eeeeee;
}

#garage-animation-progress {
  width: 100%;
  height: 100%;
  background: #d9773a;
  transform: scaleX(0);
  transform-origin: left center;
}

/* Tablettes et téléphones : textes sous la voiture */

@media (max-width: 991.98px) {
  #garage-animation.model-loaded #porsche-viewer {
    top: 20%;
    left: 3%;
    width: 94%;
    height: 41%;
  }
}

@media (max-width: 991.98px) {
  .garage-info, .garage-info:nth-child(even) {
    top: 63%;
    left: 7%;
    right: 7%;
    width: auto;
    max-width: none;
    text-align: center;
  }
}

@media (max-width: 991.98px) {
  .garage-info h2 {
    margin-bottom: 9px;
    font-size: clamp(26px, 5vw, 36px);
  }
}

@media (max-width: 991.98px) {
  .garage-info-label {
    margin-bottom: 7px;
    font-size: 10px;
  }
}

@media (max-width: 991.98px) {
  .garage-info > p:not(.garage-info-label) {
    max-width: 480px;
    margin: 0 auto 10px;
    font-size: 13px;
    line-height: 1.45;
  }
}

@media (max-width: 991.98px) {
  .garage-info-button {
    padding: 7px 14px;
    font-size: 12px;
  }
}

/* Respect du réglage de réduction des animations */

@media (prefers-reduced-motion: reduce) {
  .garage-info {
    transition: none;
    transform: none;
  }
}

/* Couleur pilotée par le défilement */

#garage-animation {
  --garage-background: rgb(255, 255, 255);
  background: var(--garage-background);
}

/* La scène laisse apparaître le fond de la section */

#garage-animation .garage-scene {
  background: transparent;
}

/* Évite un rectangle blanc derrière la voiture */

#garage-animation #porsche-viewer {
  background: transparent;
}

/* Centre verticalement les informations sur ordinateur */

#garage-animation .garage-info, #garage-animation .garage-info:nth-child(even) {
  top: 50%;
  translate: 0 -50%;
  transition: none;
}

/* Évite que les images prennent toute la hauteur */

#garage-animation .garage-info img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 180px;
  margin: 12px 0 16px;
  border-radius: 10px;
  object-fit: cover;
}

/* Protection pour les blocs longs */

#garage-animation .garage-info {
  box-sizing: border-box;
  max-height: 72%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: #d9773a transparent;
}

/* Voiture dans la partie haute */

@media (max-width: 991.98px) {
  #garage-animation.model-loaded #porsche-viewer {
    top: 17%;
    left: 3%;
    width: 94%;
    height: 28%;
  }
}

/* Bloc centré dans la zone située sous la voiture */

@media (max-width: 991.98px) {
  #garage-animation .garage-info, #garage-animation .garage-info:nth-child(even) {
    top: 67%;
    left: 7%;
    right: 7%;
    width: auto;
    max-width: none;
    max-height: 40%;
    translate: 0 -50%;
    padding: 0 6px;
    text-align: center;
  }
}

@media (max-width: 991.98px) {
  #garage-animation .garage-info img {
    width: auto;
    max-width: 100%;
    max-height: 110px;
    margin: 10px auto 12px;
  }
}

@media (max-width: 991.98px) {
  #garage-animation .garage-info h2 {
    margin-bottom: 8px;
    font-size: clamp(25px, 5vw, 34px);
  }
}

@media (max-width: 991.98px) {
  #garage-animation .garage-info > p:not(.garage-info-label) {
    font-size: 13px;
    line-height: 1.45;
  }
}

