/**
 * SEÇÃO DE PRODUTOS - ESTILO PORSCHE
 */

/* Sobrescreve estilos do products.css antigo */
.produtos {
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  position: relative !important;
  padding: 100px clamp(20px, 5vw, 80px) clamp(80px, 10vh, 120px) !important;
  width: 100% !important;
  box-sizing: border-box !important;
  max-width: 100% !important;
  margin: 0 !important;
}

.produtos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 30px;
  max-width: clamp(1200px, 85vw, 1400px);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 80px);
  width: 100%;
  position: relative;
  box-sizing: border-box;
  /* Garante que não seja flex/carousel no desktop */
  overflow-x: visible;
  overflow-y: visible;
  flex-direction: initial;
}

.produto-card {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  min-height: 650px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.produto-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.produto-card-content {
  position: relative;
  height: 100%;
  min-height: 650px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

.produto-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  z-index: 0;
}

.produto-main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.produto-card:hover .produto-main-image {
  transform: scale(1.05);
}

.produto-title {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 30px;
  z-index: 2;
  font-size: 3rem;
  color: #ffffff;
  font-family: "Bebas Neue", sans-serif;
  margin: 0;
  font-weight: 400;
  letter-spacing: 3px;
  text-align: center;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
  padding-top: 40px;
  padding-bottom: 60px;
}

.produto-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
  box-sizing: border-box;
}

.produto-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

/* Descrição dentro do card */
.produto-descricao {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3;
  display: none;
  overflow-y: auto;
  border-radius: 12px;
}

/* Scrollbar da descrição - mesmo estilo da página */
.produto-descricao::-webkit-scrollbar {
  width: 6px;
}

.produto-descricao::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 6px;
}

.produto-descricao::-webkit-scrollbar-thumb {
  background: #e6b800;
  border-radius: 6px;
}

.produto-descricao::-webkit-scrollbar-thumb:hover {
  background: #d39e00;
}

.produto-card.descricao-ativa .produto-descricao {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
  overflow-y: auto;
}

.produto-descricao-content {
  color: #ffffff;
  line-height: 1.8;
  font-size: 1.1rem;
  flex: 1;
}

.produto-descricao-content h3 {
  font-size: 2rem;
  color: #e6b800;
  font-family: "Bebas Neue", sans-serif;
  margin-bottom: 20px;
  letter-spacing: 2px;
}

.produto-descricao-content p {
  margin-bottom: 15px;
  color: #ffffff;
}

.produto-descricao-content hr {
  border: none;
  border-top: 1px solid rgba(230, 184, 0, 0.3);
  margin: 20px 0;
}

.produto-descricao-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: 2px solid #e6b800;
  color: #e6b800;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 4;
  line-height: 1;
}

.produto-descricao-close:hover {
  background: #e6b800;
  color: #000;
}

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

.btn-ver-descricao,
.btn-ver-modelos {
  flex: 1;
  min-width: 150px;
  padding: 14px 28px;
  border: 2px solid #e6b800;
  background: transparent;
  color: #e6b800;
  font-size: 1rem;
  font-weight: 600;
  font-family: "Roboto-Black", sans-serif;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  box-sizing: border-box;
}

.btn-ver-descricao:hover,
.btn-ver-modelos:hover {
  background: #e6b800;
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(230, 184, 0, 0.3);
}

/* Estado quando descrição está ativa */
.produto-card.descricao-ativa .produto-info {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Estado quando galeria está ativa */
.produto-card.gallery-active .produto-card-content {
  display: none;
}

.produto-card.descricao-ativa.gallery-active .produto-descricao {
  display: none;
}

.produto-gallery {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0;
  height: 100%;
  min-height: 650px;
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
}

.produto-card.gallery-active .produto-gallery {
  display: flex;
  flex-direction: column;
}

.btn-voltar {
  position: absolute;
  top: 55px;
  left: 20px;
  background: transparent;
  border: none;
  color: #e6b800;
  padding: 0;
  border-radius: 0;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
  transition: all 0.3s ease;
  font-family: "Roboto-Black", sans-serif;
  z-index: 4;
  text-decoration: none;
}

.btn-voltar:hover {
  color: #d39e00;
  text-decoration: underline;
}

.gallery-main {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  z-index: 1;
}

.gallery-current-model {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  margin: 0;
}

.current-model-image-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  z-index: 1;
}

.current-model-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: opacity 1.5s ease-in-out;
  min-width: 100%;
  min-height: 100%;
  opacity: 1;
}

.current-model-name {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  font-size: 3rem;
  color: #ffffff;
  font-family: "Bebas Neue", sans-serif;
  margin: 0;
  font-weight: 400;
  letter-spacing: 3px;
  text-align: center;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
  padding: 40px 30px 60px;
}

.btn-comprar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
  text-decoration: none;
  color: #000;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 0;
  transition: all 0.3s ease;
  font-family: "Roboto-Black", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-comprar span {
  background: #e6b800;
  padding: 14px 40px;
  border-radius: 50px;
  display: inline-block;
}

.btn-comprar:hover span {
  background: #d39e00;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(230, 184, 0, 0.4);
}

.gallery-thumbnails {
  position: absolute;
  bottom: 120px;
  left: 0;
  right: 0;
  display: flex;
  gap: 15px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 30px 20px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  z-index: 4;
  justify-content: flex-start;
}

/* Scrollbar estilo dourado para thumbnails - transparente */
.gallery-thumbnails::-webkit-scrollbar {
  height: 8px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  margin: 0 30px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
  background: rgba(230, 184, 0, 0.3);
  border-radius: 10px;
  transition: background 0.3s ease;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
  background: rgba(230, 184, 0, 0.6);
}

.gallery-thumbnail {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.3s ease;
  scroll-snap-align: start;
  background: #000;
  opacity: 0.50;
}

.gallery-thumbnail:hover {
  border-color: #e6b800;
  transform: scale(1.05);
  opacity: 1;
}

.gallery-thumbnail.active {
  border-color: #e6b800;
  box-shadow: 0 0 15px rgba(230, 184, 0, 0.5);
  opacity: 0.80;
}

@media (max-width: 768px) {
  .gallery-thumbnail.active {
    box-shadow: none;
  }
  
  .produto-card {
    box-shadow: none !important;
  }
}

@media (max-width: 480px) {
  .gallery-thumbnail.active {
    box-shadow: none;
  }
  
  .produto-card {
    box-shadow: none !important;
  }
}

.gallery-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* Controles do carousel - Ocultos por padrão (só aparecem no mobile) */
.produtos-carousel-controls {
  display: none !important;
}

/* Estilo do título PRODUTOS - Sobrescreve products.css - Igual ao CONTATO */
.produtos h1 {
  font-size: 2.5rem !important;
  margin-top: 0 !important;
  margin-bottom: 40px !important;
  color: #e6b800 !important;
  font-family: "Bebas Neue", sans-serif !important;
  position: relative !important;
  display: inline-block !important;
  text-align: center !important;
  width: auto !important;
  z-index: 1 !important;
}

.produtos h1::after {
  content: "" !important;
  position: absolute !important;
  bottom: -15px !important;
  left: 0 !important;
  width: 100% !important;
  height: 2px !important;
  background: linear-gradient(90deg, transparent, #e6b800, transparent) !important;
  transform: none !important;
}

/* Responsividade */
@media (max-width: 1024px) {
  .produtos-grid {
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 25px;
  }

  .current-model-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: transparent;
    z-index: 1;
  }

  .current-model-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    min-width: 100%;
    min-height: 100%;
  }

  .produto-gallery {
    background: transparent;
  }
}

@media (max-width: 768px) {
  /* Remove padding horizontal da seção produtos no mobile */
  .produtos {
    padding: 100px 0 clamp(80px, 10vh, 120px) !important;
  }

  /* Título PRODUTOS - igual aos outros títulos */
  .produtos h1 {
    font-size: 2rem !important;
    margin-bottom: 30px !important;
  }
  
  .produtos-grid {
    display: flex;
    flex-direction: row;
    gap: 0;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    width: 100%;
    max-width: 100%;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-padding: 0;
    /* Centraliza o card visível */
    scroll-snap-type: x mandatory;
    align-items: center;
  }

  .produtos-grid::-webkit-scrollbar {
    display: none;
  }

  .produtos-grid {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .produto-card {
    min-height: 600px;
    height: 600px;
    width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
    background: #000;
    flex-shrink: 0;
    margin: 0 10px;
    border-radius: 24px;
    scroll-snap-align: center;
    box-shadow: none;
  }
  
  /* Primeiro card - adiciona margin-left para centralizar */
  .produtos-grid > .produto-card:first-child {
    margin-left: calc((100vw - (100vw - 40px)) / 2);
  }
  
  /* Último card - adiciona margin-right para centralizar */
  .produtos-grid > .produto-card:last-child {
    margin-right: calc((100vw - (100vw - 40px)) / 2);
  }

  .produto-card-content {
    min-height: 600px;
    height: 600px;
  }

  .produto-gallery {
    min-height: 600px;
    height: 600px;
  }

  .produto-image-wrapper {
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
  }

  .produto-title {
    font-size: 2.5rem;
    padding: 25px 20px 40px;
  }

  .produto-info {
    padding: 20px 20px 25px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.8) 50%, transparent 100%);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

  .produto-actions {
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .btn-ver-descricao,
  .btn-ver-modelos {
    width: 100%;
    max-width: 100%;
    padding: 16px 28px;
    font-size: 1rem;
    box-sizing: border-box;
    margin: 0;
  }

  /* Controles de navegação estilo Porsche - Só aparecem no mobile */
  .produtos-carousel-controls {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 100;
    background: transparent;
    padding: 0;
    margin: 30px auto 20px;
    width: fit-content;
    height: 40px;
  }

  /* Container dos dots - estilo Porsche (capsule-shaped, dark grey) */
  .carousel-dots {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(35, 35, 35, 0.75);
    padding: 10px 18px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    height: 40px;
    box-sizing: border-box;
  }

  .carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(80, 80, 80, 0.9);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
  }

  .carousel-dot:hover {
    background: rgba(120, 120, 120, 0.9);
  }

  .carousel-dot.active {
    width: 60px;
    height: 8px;
    border-radius: 4px;
    background: #686868;
  }

  .carousel-dot-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(212, 212, 212, 0.95);
    border-radius: 4px;
    animation: none;
  }

  @keyframes carouselProgress {
    from {
      width: 0%;
    }
    to {
      width: 100%;
    }
  }
  
  /* Garante que a barra de progresso preencha o dot ativo */
  .carousel-dot.active .carousel-dot-progress {
    width: 0%;
  }

  /* Botão de pause - estilo Porsche (separado, circular, dark grey) - mesmo tamanho do container dos dots */
  #carousel-pause {
    background: rgba(35, 35, 35, 0.75);
    border: none;
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-shrink: 0;
    margin-left: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
  }

  #carousel-pause:hover {
    background: rgba(50, 50, 50, 0.95);
    transform: scale(1.05);
  }

  #carousel-pause:active {
    transform: scale(0.95);
  }

  .produto-gallery {
    background: transparent;
    min-height: 650px;
  }

  .current-model-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: transparent;
    z-index: 1;
  }

  .current-model-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    min-width: 100%;
    min-height: 100%;
  }

  .current-model-name {
    font-size: 2.5rem;
    padding: 30px 20px 50px;
  }

  .btn-voltar {
    top: 45px;
    left: 15px;
    padding: 0;
    font-size: 1.1rem;
  }

  .gallery-thumbnails {
    gap: 10px;
    bottom: 100px;
    padding: 10px 20px 20px;
  }

  .gallery-thumbnail {
    width: 70px;
    height: 70px;
  }

  .descricao-modal-content {
    padding: 30px 20px;
    margin: 20px;
  }
}

@media (max-width: 480px) {
  /* Remove padding horizontal da seção produtos no mobile */
  .produtos {
    padding: 100px 0 clamp(80px, 10vh, 120px) !important;
  }

  /* Título PRODUTOS - igual aos outros títulos */
  .produtos h1 {
    font-size: 1.8rem !important;
    margin-bottom: 30px !important;
  }
  
  .produtos-grid {
    padding: 0;
    gap: 0;
    /* Centraliza o card visível */
    scroll-snap-type: x mandatory;
    align-items: center;
  }

  .produto-card {
    min-height: 580px;
    height: 580px;
    width: calc(100vw - 30px);
    max-width: calc(100vw - 80px);
    border-radius: 24px;
    margin: 0 7.5px;
    scroll-snap-align: center;
  }
  
  /* Primeiro card - adiciona margin-left para centralizar */
  .produtos-grid > .produto-card:first-child {
    margin-left: calc((100vw - (100vw - 30px)) / 2);
  }
  
  /* Último card - adiciona margin-right para centralizar */
  .produtos-grid > .produto-card:last-child {
    margin-right: calc((100vw - (100vw - 30px)) / 2);
  }

  .produto-card-content {
    min-height: 580px;
    height: 580px;
  }

  .produto-gallery {
    min-height: 580px;
    height: 580px;
  }

  .produto-image-wrapper {
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    border-radius: 24px;
  }

  .produto-title {
    font-size: 2.2rem;
    padding: 20px 15px 35px;
  }

  .produto-info {
    padding: 15px 15px 20px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

  .produto-actions {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .btn-ver-descricao,
  .btn-ver-modelos {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
  }

  .produto-gallery {
    background: transparent;
    min-height: 520px;
  }

  .current-model-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: transparent;
    z-index: 1;
  }

  .current-model-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    min-width: 100%;
    min-height: 100%;
  }

  .current-model-name {
    font-size: 2rem;
    padding: 25px 15px 40px;
  }

  .btn-voltar {
    top: 12px;
    left: 1px;
    padding: 20px 10px;
    font-size: 0.95rem;
  }

  .gallery-thumbnails {
    bottom: 90px;
    padding: 10px 15px 20px;
  }

  .gallery-thumbnail {
    width: 60px;
    height: 60px;
  }

  .btn-comprar {
    padding: 20px;
  }

  .btn-comprar span {
    padding: 12px 30px;
    font-size: 1rem;
  }
}

/* Celulares menores (até 400px) - iPhone SE, Android pequenos */
@media (max-width: 400px) {
  .produto-card {
    min-height: 550px;
    height: 550px;
  }

  .produto-card-content {
    min-height: 550px;
    height: 550px;
  }

  .produto-gallery {
    min-height: 550px;
    height: 550px;
  }

  .produto-title {
    font-size: 2rem;
    padding: 18px 15px 30px;
  }

  .produto-info {
    padding: 12px 15px 18px;
  }

  .btn-ver-descricao,
  .btn-ver-modelos {
    padding: 14px 24px;
    font-size: 0.95rem;
  }

  .current-model-name {
    font-size: 1.8rem;
    padding: 20px 15px 35px;
  }

  .gallery-thumbnails {
    bottom: 85px;
    padding: 8px 15px 18px;
  }

  .gallery-thumbnail {
    width: 55px;
    height: 55px;
  }
}
