/* Estilos base para opções de cor */
.color-option {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  transition: all 0.3s ease;
  border: 3px solid transparent;
  position: relative;
}

/* Versão decorativa para lavatórios */
.color-selector.decorative {
  pointer-events: none;
}

.color-option.decorative {
  cursor: default;
  opacity: 0.7;
}

.color-option.decorative.active {
  opacity: 1;
  border-color: #007bff;
  transform: scale(1.05);
}

/* Estado ativo (comum) */
.color-option.active {
  border-color: #007bff;
  transform: scale(1.15);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Cores padrão para todos os produtos */
.color-c1 {
  background-color: #1f1d1c; /* Preto */
}

.color-c2 {
  background-color: #7e4629; /* Marrom */
}

.color-c3 {
  background-color: #f3f2c7; /* Bege */
}

/* Container do carrossel mobile */
.carousel-container {
  padding: 0 20px;
  margin: 0 -20px;
}

.carousel-track {
  padding: 0 20px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.carousel-slide {
  touch-action: pan-y;
}

.carousel-slide img {
  transition: transform 0.3s ease;
}

.carousel-slide img:active {
  transform: scale(0.95);
}

/* Indicadores do carrossel */
.carousel-indicators {
  margin-top: 16px;
}

.indicator {
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.indicator:hover {
  transform: scale(1.2);
}

.indicator.active {
  background-color: #007bff;
}

/* Otimizações para touch */
@media (max-width: 768px) {
  .carousel-track {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  
  .carousel-slide {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  /* Esconde seletor de cores decorativo no mobile */
  .mobile-color-selector.decorative {
    display: none;
  }
}

/* Animações e estilos de transição */
.carousel-track.transitioning {
  pointer-events: none;
}

.carousel-slide img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Layout geral */
.flex-center {
  display: flex;
  justify-content: center;
}

.container-width {
  width: 1340px;
  padding-left: 24px;
  padding-right: 24px;
}

/* Layout Desktop */
.desktop-layout {
  display: flex;
  justify-content: center;
}

.desktop-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}

@media (min-width: 1024px) {
  .desktop-grid {
    grid-template-columns: 550px 620px;
  }
}

.main-image-container {
  display: flex;
  justify-content: center;
  height: 800px;
}

.main-image {
  height: 100%;
  width: auto;
  transition: transform 0.15s ease;
}

.right-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 800px;
}

/* Card de produto */
.product-card {
  background-color: var(--preto);
  color: var(--branco-primario);
  border-radius: 20px;
  padding: 30px 50px 40px 50px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  width: 620px;
  height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-title {
  font-size: 42px;
  font-weight: 500;
  margin-bottom: 40px;
  line-height: 1.1;
}

.product-description {
  font-size: 18px;
  flex-grow: 1;
  line-height: 1.4;
  overflow-y: auto;
}

.product-button {
  width: 220px;
  height: 60px;
  border: 2px solid var(--branco-primario);
  color: var(--branco-primario);
  font-size: 18px;
  padding: 8px 24px;
  border-radius: 10px;
  transition: all 0.3s;
  background-color: transparent;
  cursor: pointer;
  margin-top: 40px;
  flex-shrink: 0;
}

.product-button:hover {
  background-color: #ffffff;
  color: #000000;
}

/* Seção inferior */
.bottom-section {
  display: grid;
  grid-template-columns: 100px 490px;
  gap: 32px;
  height: 400px;
  width: 620px;
}

.color-selector {
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: center;
  align-items: center;
  width: 100px;
}

.color-large {
  width: 100px;
  height: 100px;
}

/* Preview do produto - ajuste para lavatórios */
.product-preview.lavatorio {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 490px;
}

.preview-image {
  max-width: 100%;
  max-height: 400px;
  height: auto;
  width: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* Layout Mobile */
.mobile-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-product-card {
  background-color: var(--preto);
  color: var(--branco-primario);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.mobile-product-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
}

.mobile-product-description {
  color: var(--branco-primario);
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.4;
  flex-grow: 1;
}

.mobile-product-button {
  border: 1px solid var(--branco-primario);
  color: var(--branco-primario);
  padding: 8px 16px;
  border-radius: 5px;
  transition: all 0.3s;
  font-size: 14px;
  background-color: transparent;
  cursor: pointer;
  margin-top: auto;
  flex-shrink: 0;
  align-self: flex-start;
}

.mobile-product-button:hover {
  background-color: var(--branco-primario);
  color: var(--preto);
}

.mobile-image-container {
  display: flex;
  justify-content: center;
  padding-right: 40px;
}

.mobile-main-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 0.15s ease;
}

.mobile-color-selector {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.color-medium {
  width: 64px;
  height: 64px;
}

/* Produtos relacionados - Desktop */
.desktop-related-products {
  margin-top: 40px;
}

.related-products-container {
  overflow-x: auto;
  /* adiciona espaço antes e depois da lista */
  padding: 0 20px;
}

/* grid passa a ser inline-flex */
.related-products-grid {
  display: inline-flex;
  gap: 10px;
  /* mantêm tudo em uma linha */
  flex-wrap: nowrap;
}

/* cada imagem continua com tamanho fixo */
.related-products-grid img {
  flex: 0 0 335px;
  height: auto;
  object-fit: contain;
  transition: transform 0.3s;
}

.related-product-image {
  width: 100%;
  max-width: 335px;
  height: 480px;
  object-fit: contain;
  transition: transform 0.3s;
}

.related-product-image:hover {
  transform: translateY(-8px);
}

/* Produtos relacionados - Mobile */
.mobile-related-products {
  margin-top: 0px;
}

.carousel-track {
  display: flex;
  transition: transform 0.3s ease-out;
}

.carousel-slide {
  flex-shrink: 0;
  width: 50%;
}

.carousel-image {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: contain;
}

.carousel-indicators {
  display: flex;
  justify-content: center;
  margin-top: 15px;
  gap: 5px;
}

.indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--fundo-cinza);
}

/* Media Queries para responsividade */
@media (min-width: 768px) {
  .desktop-layout {
    display: flex;
  }
  
  .mobile-layout,
  .mobile-related-products {
    display: none;
  }
  
  .desktop-related-products {
    display: block;
  }
}

@media (max-width: 767px) {
  .desktop-layout,
  .desktop-related-products {
    display: none;
  }
  
  .mobile-layout,
  .mobile-related-products {
    display: flex;
  }
  
  .container-width {
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Ajustes para telas menores */
@media (max-width: 1200px) {
  .product-card {
    width: 100%;
    max-width: 620px;
    height: auto;
    min-height: 380px;
  }
  
  .bottom-section {
    width: 100%;
    max-width: 620px;
    grid-template-columns: 100px 1fr;
  }
  
  .product-preview {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .desktop-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .main-image-container {
    height: 500px;
  }
  
  .right-section {
    height: auto;
  }
  
  .bottom-section {
    grid-template-columns: 1fr;
    gap: 24px;
    height: auto;
  }
  
  .color-selector {
    flex-direction: row;
    width: 100%;
    justify-content: center;
  }
  
  .product-preview {
    height: 300px;
  }
}

/* ============================= */
/* Centralizar preview abaixo da descrição */
/* ============================= */

.bottom-section {
  /* transforma o grid de 2 colunas em 1 só */
  display: flex;
  flex-direction: column;
  align-items: center;
  /* garante espaçamento acima da preview */
  gap: 24px;
  /* ajusta altura para caber o conteúdo */
  height: auto;
  width: 100%;
  max-width: 620px; /* mantém o mesmo max-width do .product-card :contentReference[oaicite:0]{index=0} */
}

.product-preview.lavatorio {
  /* ocupa 100% da largura disponível no bottom-section */
  width: 100%;
  /* altura automática */
  height: auto;
}

.preview-image {
  /* preenche até a largura máxima sem distorcer */
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
