/* ==========================================================================
   DIGISAAT - PÁGINA DE PRODUTO & SEÇÃO DE AVALIAÇÕES (REVIEWS)
   Estilos baseados na referência visual fornecida:
   - Abas superiores (Descrição, Avaliações, Discussão)
   - Cabeçalho de Avaliações com Filtro
   - Cards de comentários com Avatar, Tag de Data, Estrelas, Like e Resposta
   ========================================================================== */

/* 1. BREADCRUMBS & ESTRUTURA GERAL */
.product-detail-wrapper {
  padding-top: 2.5rem;
  padding-bottom: 5rem;
}

.breadcrumbs-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.breadcrumbs-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.breadcrumbs-nav a:hover {
  color: var(--color-green-logo);
}

.breadcrumbs-nav span.current {
  color: var(--color-text-dark);
  font-weight: 600;
}

/* 2. GRID PRINCIPAL */
.product-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 3.5rem;
  align-items: flex-start;
  margin-bottom: 4.5rem;
}

/* 3. GALERIA DE MÍDIA DO PRODUTO */
.product-gallery-side {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.main-image-viewport {
  background: var(--cruz-paper, #ffffff);
  border-radius: var(--radius-md);
  position: relative;
  height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.main-image-viewport img {
  max-height: 85%;
  max-width: 85%;
  object-fit: contain;
  transition: transform 0.4s ease;
  filter: drop-shadow(0 15px 25px rgba(0,0,0,0.12));
}

.main-image-viewport:hover img {
  transform: scale(1.05);
}

.gallery-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1d1d1f;
  z-index: 10;
  transition: var(--transition);
}

.gallery-nav-arrow:hover {
  background: var(--bg-top-bar);
  color: #ffffff;
  border-color: var(--bg-top-bar);
}

.gallery-nav-arrow.prev {
  left: 1.25rem;
}

.gallery-nav-arrow.next {
  right: 1.25rem;
}

.thumbnails-strip {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.thumb-item {
  width: 78px;
  height: 78px;
  background: var(--cruz-paper, #ffffff);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 6px;
  transition: var(--transition);
}

.thumb-item:hover, .thumb-item.active {
  border-color: var(--color-green-logo);
  background: #ffffff;
  box-shadow: none;
}

.thumb-item img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.thumb-more-btn {
  width: 78px;
  height: 78px;
  background: var(--cruz-paper, #ffffff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.thumb-more-btn:hover {
  background: #e2ebe6;
  color: var(--color-green-logo);
}

/* 4. COLUNA DE DETALHES */
.product-info-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
}

.product-detail-title {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--color-text-title, #11171F);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.product-detail-desc {
  font-size: 0.95rem;
  color: var(--color-text-body);
  line-height: 1.7;
  margin-bottom: 1.4rem;
}

.product-meta-stats {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.88rem;
  margin-bottom: 1.4rem;
}

.sales-badge {
  font-weight: 700;
  color: var(--color-text-dark);
}

.stars-rating-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.stars-group {
  display: flex;
  gap: 2px;
  color: var(--color-gold-star);
}

.stars-group svg {
  width: 16px;
  height: 16px;
  fill: var(--color-gold-star);
}

.rating-text {
  color: var(--color-text-muted);
}

.pricing-block {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 1rem;
  margin-bottom: 2rem;
}

.price-current {
  font-family: var(--font-sans);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-text-dark);
}

.price-original {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  text-decoration: line-through;
  font-weight: 500;
}

.price-cash-label {
  width: 100%;
  margin-top: -0.35rem;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.price-installment-label {
  width: 100%;
  margin-top: -0.55rem;
  font-size: 0.95rem;
  color: #11171F;
  font-weight: 700;
}

.product-variants-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  align-items: flex-start;
}

.variant-group-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: 0.6rem;
  display: block;
}

.color-swatches {
  display: flex;
  gap: 0.65rem;
}

.color-swatch-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 2px solid #ffffff;
  outline: 1.5px solid transparent;
  transition: var(--transition);
}

.color-swatch-btn.active {
  outline-color: var(--color-green-logo);
  transform: scale(1.1);
}

.select-type-dropdown {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--color-text-dark);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.select-type-dropdown:focus {
  border-color: var(--color-green-logo);
  box-shadow: 0 0 0 3px rgba(17, 23, 31, 0.08);
}

.quantity-control-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.2rem;
}

.quantity-stepper {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 4px;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-dark);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  transition: var(--transition);
}

.qty-btn.action-plus {
  background: var(--color-green-btn);
  color: #ffffff;
}

.qty-btn:hover {
  transform: scale(1.08);
}

.qty-value {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0 1.2rem;
  color: var(--color-text-dark);
}

.purchase-buttons-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.purchase-buttons-group .btn-add-cart-outline,
.purchase-buttons-group .btn-buy-now-solid {
  flex: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.product-fav-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 12;
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.94);
  color: #5d7065;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(22, 36, 29, 0.14);
}

.product-fav-btn:hover {
  border-color: #e53e3e;
  color: #e53e3e;
  background: #fff7f7;
}

.product-fav-btn.favorited,
.product-fav-btn.favorited svg {
  color: #e53e3e;
}

.product-fav-btn.favorited svg {
  fill: #e53e3e;
}

.btn-add-cart-outline {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 1rem;
  background: #ffffff;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: var(--transition);
}

.btn-add-cart-outline > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-add-cart-outline:hover {
  border-color: var(--color-green-logo);
  background: #ffffff;
}

.cart-plus-icon {
  background: var(--color-primary, #11171F);
  color: #f6f3ec;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.btn-buy-now-solid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 1.05rem;
  background: var(--color-primary, #11171F);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition: var(--transition);
}

.btn-buy-now-solid:hover {
  background: var(--color-green-btn-hover, #1c2430);
  transform: none;
}

.security-guarantee-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.6rem;
  box-shadow: none;
}

.guarantee-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--color-text-dark);
  margin-bottom: 0.8rem;
}

.payment-badges-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.payment-badge {
  background: transparent;
  border: 0;
  border-radius: var(--radius-md);
  padding: 0;
  overflow: visible;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
}

.payment-badge img {
  display: block;
  width: auto;
  height: 40px;
  max-height: 40px;
  object-fit: contain;
  object-position: center;
}

.payment-badge--boleto {
  width: 64px;
  height: 40px;
  overflow: hidden;
}

.payment-badge--boleto img {
  width: 60px;
  height: 60px;
  max-height: none;
  object-fit: cover;
  object-position: center 62%;
}

.guarantee-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.guarantee-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-text-body);
}

.guarantee-item svg {
  width: 16px;
  height: 16px;
  color: var(--color-green-logo);
  flex-shrink: 0;
}

.guarantee-item a {
  color: var(--color-text-body);
  text-decoration: none;
  transition: var(--transition);
}

.guarantee-item a:hover {
  color: var(--color-green-logo);
}

/* ==========================================================================
   5. SEÇÃO DE AVALIAÇÕES (TABS, FILTROS E COMENTÁRIOS DA REFERÊNCIA)
   ========================================================================== */
.product-tabs-section {
  border-top: 1px solid var(--color-border);
  padding-top: 3.5rem;
}

/* Abas de Navegação Superiores (Descrição / Avaliações / Discussão) */
.pills-tabs-bar {
  background: var(--cruz-paper, #ffffff);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-around;
  padding: 0.4rem;
  margin-bottom: 3rem;
}

.pill-tab-item {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 0.75rem 2rem;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: var(--transition);
  position: relative;
}

.pill-tab-item.active {
  color: var(--color-text-dark);
  font-weight: 700;
}

.pill-tab-item.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 25%;
  width: 50%;
  height: 2px;
  background-color: var(--color-green-logo);
  border-radius: var(--radius-md);
}

/* Cabeçalho da Seção de Avaliações */
.reviews-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.reviews-main-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--color-text-dark);
}

.reviews-count-sub {
  font-size: 0.84rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

.reviews-filter-wrapper {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.filter-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-dark);
}

.filter-dropdown-pill {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-dark);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.filter-dropdown-pill svg.star-icon {
  width: 14px;
  height: 14px;
  fill: var(--color-gold-star);
  color: var(--color-gold-star);
}

.filter-dropdown-pill svg.chevron-icon {
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
}

/* Lista de Cards de Avaliação */
.reviews-list-stream {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.reviews-empty-state {
  background: #ffffff;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--color-text-muted);
}

.reviews-empty-state p {
  margin: 0;
  line-height: 1.6;
}

.reviews-empty-state p + p {
  margin-top: 0.4rem;
  font-size: 0.9rem;
}

.review-card-item {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
  transition: var(--transition);
}

.review-card-item:hover {
  border-color: #cbdad1;
  box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}

.review-card-left {
  display: flex;
  flex-direction: column;
}

.reviewer-profile-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.reviewer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--color-border);
}

.reviewer-name-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.reviewer-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text-dark);
}

.review-date-pill {
  background: #ffffff;
  color: #4b5e54;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.review-date-pill::before {
  content: '•';
  color: #7b8e85;
}

.review-stars-score {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.review-stars-score .stars-group svg {
  width: 14px;
  height: 14px;
}

.review-score-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-dark);
}

.review-body-text {
  font-size: 0.92rem;
  color: var(--color-text-body);
  line-height: 1.7;
}

/* Lado Direito: Eventos & Ações (Like, Resposta, Editar) */
.review-card-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  min-width: 140px;
}

.review-events-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-dark);
}

.review-actions-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-action-text {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #5d7065;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.btn-action-text:hover {
  color: var(--color-green-logo);
}

.btn-action-text svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   6. RESPONSIVIDADE COMPLETA DA PÁGINA DE PRODUTO
   ========================================================================== */

/* Tablets Grandes e Laptops (<= 1024px) */
@media (max-width: 1024px) {
  .product-layout-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  .product-gallery-side,
  .product-info-side {
    min-width: 0;
    max-width: 100%;
  }
  
  .main-image-viewport {
    height: 420px;
  }
  
  .product-detail-title {
    font-size: 2rem;
  }
}

/* Tablets e Smartphones Médios (<= 768px) */
@media (max-width: 768px) {
  .product-detail-wrapper {
    padding-top: 1.5rem;
    padding-bottom: 3.5rem;
    overflow-x: clip;
  }

  .product-layout-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .purchase-buttons-group {
    position: sticky;
    bottom: calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 15;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: 0;
    margin-right: 0;
    background: #ffffff;
    padding: 0.65rem 0 0;
    box-sizing: border-box;
  }

  .purchase-buttons-group .btn-add-cart-outline,
  .purchase-buttons-group .btn-buy-now-solid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .main-image-viewport {
    height: 340px;
    border-radius: var(--radius-md);
  }

  .gallery-nav-arrow {
    width: 38px;
    height: 38px;
  }

  .thumbnails-strip {
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .thumb-item, .thumb-more-btn {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
  }

  .product-detail-title {
    font-size: 1.7rem;
  }

  .pricing-block {
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
  }

  .price-current {
    font-size: 1.85rem;
  }

  .product-variants-row {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .pills-tabs-bar {
    display: flex;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    -webkit-overflow-scrolling: touch;
  }

  .pill-tab-item {
    white-space: nowrap;
    padding: 0.6rem 1.2rem;
    font-size: 0.88rem;
    flex-shrink: 0;
  }

  .reviews-head-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .review-card-item {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }

  .review-card-right {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    border-top: 1px solid var(--color-border);
    padding-top: 0.8rem;
  }
}

/* Smartphones Pequenos (<= 480px) */
@media (max-width: 480px) {
  .main-image-viewport {
    height: 280px;
  }

  .product-meta-stats {
    flex-wrap: wrap;
    gap: 0.8rem;
  }

  .btn-add-cart-outline, .btn-buy-now-solid {
    padding: 0.85rem;
    font-size: 0.95rem;
  }

  .quantity-control-wrap {
    flex-wrap: wrap;
    gap: 0.8rem;
  }

  .security-guarantee-card {
    padding: 1.2rem;
    border-radius: var(--radius-md);
  }

  .payment-badges-row {
    flex-wrap: wrap;
  }

  .product-fav-btn {
    top: 0.75rem;
    right: 0.75rem;
    width: 42px;
    min-width: 42px;
    height: 42px;
  }

  .shipping-calc-card {
    padding: 1rem;
  }

  .shipping-calc-label {
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .shipping-calc-input-group {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.5rem;
  }

  .shipping-calc-input-group .form-control {
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
    max-width: none;
  }

  .shipping-calc-input-group .btn-calc-shipping {
    width: auto !important;
    flex: 0 0 auto;
    min-width: 5.75rem;
    padding: 0 0.9rem;
  }
}
