* {
  margin: 0;
  padding: 0;
}
html,
body {
  overflow-x: auto;
}
body {
  background-color: #000000;
}
html {
  scroll-behavior: smooth;
  -ms-overflow-style: none;
}

/* body::-webkit-scrollbar { 
display: none; 
} */

@font-face {
  font-family: "Body-Font";
  src: url("../assets/fonts/Ferrari-SansRegular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: fallback;
  font-stretch: normal;
}

@font-face {
  font-family: "Body-Font-Medium";
  src: url("../assets/fonts/Ferrari-SansRegular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: fallback;
  font-stretch: normal;
}

@font-face {
  font-family: "Title-Font";
  src: url("../assets/fonts/Ferrari-SansRegular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: fallback;
  font-stretch: normal;
}

#app,
#container {
  position: relative;
  z-index: 0;
  background: transparent;
  pointer-events: none;
  background: transparent;
}
.details-section {
  padding: 0rem 4rem;
  height: 100vh;
  overflow: hidden;
}
.section-title {
  display: inline-flex;
  align-items: center;
  font-family: "Body-Font";
  font-size: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #da291c;
  padding: 40px;
  margin-top: 5px;
  gap: 4rem;
}
.section-title::after {
  content: "";
  display: inline-block;
  background-color: #da291c;
  width: 0;
  height: 1px;
  transition: width 1s ease;
}

.details-section.visible .section-title::after {
  width: 20rem;
}

canvas#modello {
  position: relative;
  display: block;
  width: 100% !important;
  height: auto !important;
  background-color: #404040;
  border-radius: 5px;
  cursor: grab;
}
.canvas-container {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* 3d loader */
#loading-screen {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(50px);
  opacity: 1;
  transition: 1s opacity;
  pointer-events: none;
  border-radius: 5px;
}
#percent {
  position: absolute;
  color: #D40000;
  pointer-events: none;
  text-align: center;
  font-weight: medium;
   font-family: "Title-Font";
}

#loading-screen.fade-out {
  opacity: 0;
}
#loader-wrapper {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  
}
#loader {
  display: flex;
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #D40000;
  -webkit-animation: spin 2s linear infinite;
  animation: spin 2s linear infinite;
}
#loader:before {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  bottom: 5px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #E66B00  ;
  -webkit-animation: spin 3s linear infinite;
  animation: spin 3s linear infinite;
}
#loader:after {
  content: "";
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  bottom: 15px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #FCE903 ;
  -webkit-animation: spin 1.5s linear infinite;
  animation: spin 1.5s linear infinite;
}
@-webkit-keyframes spin {
  0% {
    -webkit-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}
@keyframes spin {
  0% {
    -webkit-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}
/* navigation */
.nav-bar {
  position: fixed;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: start;
  padding: 15px 15px;
  gap: 90px;
  color: white;
  transition: transform 0.3s ease;
}
.nav-hidden {
  transform: translateY(-100%);
}
.logo img {
  height: 38px;
}

nav {
  display: flex;
  gap: 80px;
}

nav a {
  text-decoration: none;
  font-family: "Body-Font";
  font-size: 12px;
  color: white;
  letter-spacing: 2px;
}

#main-picture {
  position: relative;
  z-index: 1;
  height: 100vh;
  width: 100%;
  object-fit: cover;
  overflow: hidden;
}

/* macchina sidebar */

.squadra-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 350px;
  height: 100%;
  display: flex;
  flex-direction: row;
  background: #191919;
  z-index: 4;
  transform: translateX(-100%);
  transition: transform 0.4s ease-in-out;
  box-shadow: 5px 0 30px rgba(0, 0, 0, 0.5);
  overflow-y: hidden;
}

#squadra-toggle:checked ~ .squadra-sidebar {
  transform: translateX(0);
}
.squadra-sidebar .sidebar-close-button:hover {
  color: #da291c;
  transform: rotate(90deg);
  transition: transform 0.7s ease;
}

.macchine-sidebar-start {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 50px;
  /* width: 100px; */
  padding: 1.5rem 1rem;
  height: 100%;
  background: rgb(20, 20, 20);
}
.macchine-sidebar-main {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  /* align-items: center; */
  gap: 10px;
  /* width: 100px; */
  padding: 5rem 1rem;
  height: 100%;
  background: rgb(24, 24, 24);
}
.macchine-sidebar-main ul {
  list-style: none;
}
.macchine-sidebar-main li {
  font-family: "Body-Font";
  font-stretch: normal;
  letter-spacing: normal;
  font-size: 13px;
  line-height: 1.6em;
  font-size: 20px;
  line-height: 24px;
  padding: 0.8rem 1.2rem;
  color: rgb(171, 171, 171);
}
.macchine-sidebar-main a {
  text-decoration: none;
  color: rgb(171, 171, 171);
}
.macchine-sidebar-main li:hover {
  color: rgb(255, 255, 255);
}
.sidebar-close-button {
  font-size: 2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  background: none;
  border: none;
  color: rgb(142, 141, 141);
  text-decoration: none;
  z-index: 40;
}
/* loading logo */

#load {
  position: fixed;
  width: 100%;
  height: 100%;
  background-color: #000;
  z-index: 70;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeOut 1s ease-out 1s forwards;
}

#load img {
  max-width: 17%;
  max-height: 17%;
  animation: fadeOut 3s;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}
/* main specs */
#main-specs {
  position: absolute;
  z-index: 2;
  bottom: 10%;
  right: 5%;
  display: flex;
  color: white;
  text-align: center;
}
.main-specs dt,
#main-specs dd {
  display: block;
}

#main-specs dt {
  padding: 0 40px;
  font-size: 36px;
  font-weight: bold;
  font-family: "Title-Font";
}

#main-specs dd {
  font-size: 11px;
  margin-top: 5px;
  font-family: "Body-Font";
  letter-spacing: 1px;
  text-transform: uppercase;
}

#main-specs span {
  font-family: "Title-Font";
  font-weight: normal;
  font-stretch: normal;
  letter-spacing: normal;
  font-size: 26px;
  line-height: 1.23em;
  font-size: 18px;
}

.spec-seperator {
  height: 20px;
  width: 1px;
  background-color: white;
  align-self: center;
  z-index: 3;
}
/* description */

.description-wrapper {
  display: flex;
  height: 70vh;
  gap: 2vw;
  opacity: 0;
  transform: translateX(-100px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.details-section.visible .description-wrapper {
  opacity: 1;
  transform: translateX(0);
}

.description-text {
  flex: 1;
  display: flex;
  align-items: center;
  text-align: center;
  justify-content: flex-start;
  font-size: 1.2rem;
  color: #969696;
  padding-right: 2vw;
}

.description-image {
  flex: 0 0 45vw;
  max-height: 65vh;
  overflow: hidden;
}

.description-image img {
  width: 100%;
  height: 100%;
  border-radius: 5px;

  object-fit: cover;
}

/* images slider */

.slider-wrapper {
  position: relative;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

.slider {
  position: relative;
  display: flex;
  width: 100%;
  height: auto;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  opacity: 0;
  transform: translateX(-100px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.details-section.visible .slider {
  opacity: 1;
  transform: translateX(0);
}

.slider .slide {
  min-width: 160px;
  width: 170px;
  height: 100px;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: 3px;
  margin: 2rem;
}

input[type="checkbox"] {
  display: none;
}
.slider .slide label {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.slider .slide label:hover {
  transform: scale(1.2) translateY(-5px);
}

.slider .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slider::-webkit-scrollbar {
  display: none;
}

.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
}

.image-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.image-display {
  height: 100%;
  width: auto;
  display: block;
  object-fit: contain;
}

.slider::-webkit-scrollbar {
  display: none;
}
.image-modal.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.image-modal.show .image-container {
  transform: scale(1);
}

.image-container {
  pointer-events: auto;
}

#image-checkboxes input[type="checkbox"] {
  display: none;
}

@media (max-width: 768px) {
  .image-container {
    width: 95%;
    margin: 20px;
  }
}

/* unvieling video */

.floating-video-player {
  position: absolute;
  bottom: 15%;
  left: 6%;
  z-index: 2;
}

.floating-video-thumbnail {
  display: block;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  border: 2px solid rgb(39, 39, 39);
}

.floating-video-thumbnail:hover {
  transform: scale(1.05) translateY(-5px);
  box-shadow: 0 3px 3px rgba(255, 0, 0, 0.4);
  animation: none;
}

#video-toggle:checked ~ .floating-video-player .floating-video-thumbnail {
  display: none;
}

#video-toggle:checked ~ .floating-video-player .video-modal {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}

#video-toggle:checked ~ .floating-video-player .video-container {
  transform: scale(1);
}

.thumbnail-content {
  position: relative;
  width: 160px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: 100% 100%;
  overflow: hidden;
}

.thumbnail-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.8;
}

.play-button {
  position: relative;
  z-index: 2;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.play-button::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 12px solid #333;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  margin-left: 3px;
}

.floating-video-player summary:hover .play-button {
  background: white;
  transform: scale(1.1);
}

.thumbnail-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  color: white;
  font-family: "Body-Font";
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 8px;
  border-radius: 4px;
  backdrop-filter: blur(10px);
}

.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
  transform: scale(0);
}

.video-container {
  position: relative;
  width: 90%;
  max-width: 75vw;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.video-header {
  background: linear-gradient(135deg, #ff0000, #990000);
  padding: 20px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.close-button {
  position: absolute;
  right: 1%;
  top: 1%;
  font-size: 24px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  background: none;
  border: none;
  color: rgb(142, 141, 141);
  text-decoration: none;
  z-index: 40;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.video-player {
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  position: relative;
  background: #000;
}

.video-player video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-controls {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  padding: 20px;
  color: white;
  font-family: "Body-Font";
  font-size: 14px;
  line-height: 1.6;
}

/* Animations */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .floating-video-player {
    bottom: 20px;
    left: 20px;
  }

  .thumbnail-content {
    width: 120px;
    height: 68px;
  }

  .video-container {
    width: 95%;
    margin: 20px;
  }

  .video-header {
    padding: 15px;
  }

  .video-title {
    font-size: 16px;
  }
}
/* change car */
.car-switching {
  transition: opacity 0.3s ease-in-out;
}

.car-switching #main-wrapper,
.car-switching .description-wrapper {
  opacity: 0.7;
}

img:not([src]),
img[src=""] {
  opacity: 0;
}
