/* ======================================= */
/* ===== ESTILOS DA PÁGINA DE PRODUTO ===== */
/* ======================================= */

/* 1. SEÇÃO PRINCIPAL */
.product-detail {
  padding: var(--spacing-xxl) 0;
}

/* 2. GALERIA DE IMAGENS */
.product-gallery .main-image {
  border-radius: var(--border-radius-large);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: var(--spacing-md);
}

.product-gallery .main-image img {
  width: 100%;
  height: auto;
  display: block;
}

.product-gallery .thumbnails img {
  border-radius: var(--border-radius-small);
  border: 2px solid #dee2e6;
  cursor: pointer;
  opacity: 0.7;
  transition: var(--transition-fast);
}

.product-gallery .thumbnails img:hover,
.product-gallery .thumbnails img.active {
  opacity: 1;
  border-color: var(--primary-color);
}

/* 3. BREADCRUMB */
.breadcrumb-nav {
  font-size: 0.85rem;
  color: var(--text-light);
}

.breadcrumb-nav a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition-fast);
}

.breadcrumb-nav a:hover {
  color: var(--primary-dark);
}

/* 5. TÍTULO E PREÇO */
.product-title {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: clamp(1.5rem, 4vw, 1rem);
  color: var(--primary-color);
  margin-bottom: var(--spacing-lg);
}

.product-price {
  margin-bottom: var(--spacing-xl);
}

.price-amount {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--primary-color);
  display: block;
  margin-bottom: var(--spacing-xs);
}

.price-note {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* 6. FORMULÁRIO */
.product-form {
  margin-bottom: var(--spacing-xl);
}

.variation-group {
  margin-bottom: var(--spacing-lg);
}

.variation-label {
  font-family: var(--font-title);
  font-weight: 500;
  color: var(--primary-color);
  display: block;
  margin-bottom: var(--spacing-sm);
}

.variation-group .btn-group {
  gap: var(--spacing-sm);
  display: flex;
  flex-wrap: wrap;
  max-width: 100%;
}

.variation-group .btn-group .btn-check + .btn-outline-primary {
  flex: 0 0 calc(25% - (var(--spacing-sm) * 3 / 4));
  max-width: calc(25% - (var(--spacing-sm) * 3 / 4));
  font-size: 0.8rem;
}

/* Responsivo: 3 botões por linha em tablets */
@media (max-width: 992px) {
  .variation-group .btn-group .btn-check + .btn-outline-primary {
    flex: 0 0 calc(33.333% - (var(--spacing-sm) * 2 / 3));
    max-width: calc(33.333% - (var(--spacing-sm) * 2 / 3));
  }
}

/* Responsivo: 2 botões por linha em mobile */
@media (max-width: 576px) {
  .variation-group .btn-group .btn-check + .btn-outline-primary {
    flex: 0 0 calc(50% - (var(--spacing-sm) / 2));
    max-width: calc(50% - (var(--spacing-sm) / 2));
  }
}

.variation-group .btn-outline-primary {
  --bs-btn-color: var(--text-dark);
  --bs-btn-border-color: var(--text-light);
  --bs-btn-hover-bg: var(--accent-color);
  --bs-btn-hover-border-color: var(--accent-color);
  --bs-btn-hover-color: var(--text-dark);
  --bs-btn-active-bg: var(--primary-color);
  --bs-btn-active-border-color: var(--primary-color);
  --bs-btn-active-color: var(--white);

  border-radius: var(--border-radius-small);
}

/* 7. QUANTIDADE */
.quantity-group {
  margin-bottom: var(--spacing-lg);
}

.quantity-label {
  font-family: var(--font-title);
  font-weight: 500;
  color: var(--primary-color);
  display: block;
  margin-bottom: var(--spacing-sm);
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  max-width: 200px;
}

.qty-input {
  text-align: center;
  border-radius: var(--border-radius-small);
  border-color: var(--text-light);
  padding: 8px;
  width: 70px;
}

.minus-btn,
.plus-btn {
  background: var(--bg-light) !important;
  color: var(--primary-color) !important;
  border: 1px solid var(--text-light) !important;
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-small) !important;
  font-weight: 700;
}

.minus-btn:hover,
.plus-btn:hover {
  background: var(--accent-color) !important;
}

/* 8. BOTÃO ADICIONAR */
.btn-add-cart {
  background: var(--accent-color);
  color: var(--text-dark);
  border: none;
  font-family: var(--font-title);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: var(--border-radius-medium);
  padding: 14px 28px;
  transition: var(--transition-normal);
  box-shadow: var(--shadow);
  width: 100%;
}

.btn-add-cart:hover {
  background: var(--primary-dark);
  color: var(--white);
  box-shadow: var(--shadow-hover);
}

.product-meta {
  margin-bottom: var(--spacing-lg);
  color: var(--text-light);
}

/* 10. ABAS */
.product-tabs .nav-tabs {
  border-bottom: 2px solid var(--bg-light);
}

.product-tabs .nav-link {
  color: var(--text-light);
  font-weight: 600;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition-fast);
  font-family: var(--font-title);
}

.product-tabs .nav-link:hover {
  color: var(--primary-color);
}

.product-tabs .nav-link.active {
  color: var(--primary-color);
  background-color: transparent;
  border-color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
}

.product-tabs .tab-content {
  padding: var(--spacing-lg) 0;
  line-height: 1.7;
  color: var(--text-dark);
}

/* 11. PRODUTOS RELACIONADOS */
.related-products {
  padding-top: var(--spacing-xxl);
  border-top: 1px solid #e9ecef;
}

.related-products .section-title {
  font-family: var(--font-title);
  color: var(--primary-color);
  font-size: 1.8rem;
  font-weight: 500;
  margin-bottom: var(--spacing-xxl);
}

.related-products .products-slider {
  position: relative;
  overflow: hidden;
  padding: 10px 50px; /* Espaço para os botões */
  width: 100%;
}

.related-products .products-container {
  display: flex;
  gap: 20px;
  transition: transform 0.5s ease;
  will-change: transform;
}

.related-products .product-card {
  flex: 0 0 calc((100% - 40px) / 3); /* 3 cards com 20px gap entre eles */
  width: calc((100% - 40px) / 3);
  background: var(--white);
  border-radius: var(--border-radius-medium);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition-normal);
}

.related-products .product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.related-products .product-image {
  width: 100%;
  height: 250px;
  object-fit: contain;
  padding: var(--spacing-md);
  background: var(--bg-light);
}

.related-products .product-info {
  padding: var(--spacing-md);
}

.related-products .product-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
  line-height: 1.4;
}

.related-products .product-link {
  text-decoration: none;
}

.related-products .product-link:hover .product-title {
  color: var(--primary-color);
}

/* Botões Slider */
.related-products .slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-color);
  color: var(--white);
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.related-products .slider-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-50%) scale(1.1);
}

.related-products .prev-btn {
  left: 0;
}

.related-products .next-btn {
  right: 0;
}

/* 12. RESPONSIVO */
@media (max-width: 992px) {
  .product-detail {
    padding: var(--spacing-lg) 0;
  }

  .product-gallery {
    margin-bottom: var(--spacing-xl);
  }

  .related-products .product-card {
    min-width: calc(50% - (var(--spacing-lg) / 2));
    max-width: calc(50% - (var(--spacing-lg) / 2));
  }

  .related-products .products-slider {
    padding: 0 45px;
  }
}

@media (max-width: 576px) {
  .product-title {
    font-size: 1.5rem;
  }

  .price-amount {
    font-size: 1.5rem;
  }

  .related-products .product-card {
    min-width: calc(100% - 20px);
    max-width: calc(100% - 20px);
  }

  .related-products .products-slider {
    padding: 0 40px;
  }

  .related-products .slider-btn {
    width: 38px;
    height: 38px;
    font-size: 1.4rem;
  }
}

/* Compensação da sidebar no desktop */
@media (min-width: 993px) {
    .product-detail .container {
        padding-left: calc(16px + var(--sidebar-width) + var(--sidebar-gap));
        padding-right: 16px;
    }
}
