/* =========================================
   produtosResumo.css - Versão Profissional Otimizada e Responsiva
   Explicado para iniciantes, com feedback visual, responsividade e boas práticas
   ========================================= */

/*
  Definimos variáveis globais com as cores e configurações visuais principais
  Isso facilita a manutenção do layout e a padronização visual em todo o sistema
*/
:root {
  --primary-color: #2c3e50;        /* Cor principal */
  --primary-hover: #1a252f;        /* Cor ao passar o mouse */
  --primary-active: #0a1929;       /* Cor ao clicar */
  --secondary-color: #3498db;      /* Cor secundária */
  --danger-color: #e74c3c;         /* Cor de erro/alerta */
  --danger-hover: #c0392b;
  --success-color: #2ecc71;        /* Cor de sucesso */
  --gray-light: #f8f9fa;           /* Cinza claro */
  --gray-medium: #95a5a6;          /* Cinza médio */
  --gray-border: #ecf0f1;          /* Cor da borda */
  --text-dark: #2c3e50;            /* Texto escuro - CORREÇÃO: estava faltando esta variável */
  --text-light: #ecf0f1;           /* Texto claro */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
  --transition: all 0.3s ease;     /* Transição suave */
  --border-radius: 8px;            /* Arredondamento padrão */
  --border-radius-sm: 4px;
}

/*
  Classe auxiliar para acessibilidade (leitores de tela)
*/
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  margin: -1px;
}

/* Container principal responsivo */
.produtos-section {
  margin: 2rem auto;
  padding: 0 1rem;
  max-width: 1710px;
  width: 100%;
  box-sizing: border-box;
}

/* Cabeçalho da seção */
.section-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 0 1rem;
  overflow: visible;
}

/* Títulos das seções */
#destaques-title,
#novidades-title,
#promocoes-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  position: relative;
  display: inline-block;
  margin-top: 30px;
}

/* Container do carrossel */
.carrossel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Grade de produtos responsiva */
.produtos-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 1rem;
  padding: 0.5rem 0.25rem;
  margin-top: 1rem;
  scrollbar-width: none; /* Firefox */
  -webkit-overflow-scrolling: touch; /* Melhora a rolagem no iOS */
  scroll-behavior: smooth;
}

.produtos-grid::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

/* Cards dentro do grid horizontal */
.produto-card {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: 220px;
  margin-right: 0.25rem;
}

/* Cada coluna/cartão de produto */
.produtos-card-col {
  scroll-snap-align: start;
  min-height: 450px;
  max-width: 250px;
  width: 100%;
}

/* Card individual */
.card.h-100 {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: white;
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-border);
  transition: var(--transition);
  position: relative;
}

/* Imagem principal do produto */
.product-image {
  height: 220px;
  width: 100%;
  object-fit: contain;
  background: rgba(255, 255, 255, 0);
  padding: 1rem;
  transition: transform 0.5s;
}

.product-image:hover {
  transform: scale(1.2);
}

/* Área de informações textuais do produto */
.card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.8rem;
}

/* Selo de promoção no canto superior do card */
.promo-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: linear-gradient(135deg, var(--danger-color), var(--danger-hover));
  color: white;
  font-weight: 800;
  padding: 0.35rem 1rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  box-shadow: var(--shadow-sm);
  animation: float 3s ease-in-out infinite;
  z-index: 10;
}

/* Círculo de desconto */
.discount-circle {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #e53935;
  color: white;
  font-weight: bold;
  font-size: 0.85rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  z-index: 10;
}

/* Animação leve para selo */
@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
  100% {
    transform: translateY(0);
  }
}

/* Animação de entrada nos cards */
@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Container de preços */
.preco-container {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.preco-produto {
  font-size: 1.3rem;
  font-weight: 1000;
  text-align: center;
  display: block;
  width: 100%;
  color: #d11818;
  background-color: #0000000c;
}

.preco-indisponivel {
  font-style: italic;
  font-size: 1.3rem;
  text-align: center;
  display: block;
  width: 100%;
  color: #000000;
  background-color: #0000000c;
}

/* Preço original riscado */
.preco-original {
  font-size: 1rem;
  color: #6c757d;
  text-decoration: line-through;
}

/* Preço promocional em destaque */
.preco-promocional {
  font-size: 1.25rem;
  font-weight: bold;
  color: #dc3545;
}

/* Área de botões com ações e controle de quantidade */
.btn-acoes {
  display: flex;
  padding: 0.5rem;
  border-top: 1px solid var(--gray-border);
  background-color: white;
  margin-top: auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Formulário com alinhamento horizontal */
.form-carrinho {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
  flex-wrap: wrap;
}

/* Controle de quantidade */
.quantidade-controle {
  display: flex;
  align-items: center;
  background-color: var(--gray-light);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  height: 25px;
  width: 40px;
  min-width: 10px;
}

/* Botões de + e - */
.quantidade-btn {
  width: 35px;
  height: 100%;
  font-size: 0.8rem;
  background-color: var(--gray-light);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text-dark);
}

.quantidade-btn:hover {
  background-color: var(--primary-hover);
  color: white;
}

/* Input de quantidade */
.quantidade-input {
  width: 100%;
  height: 100%;
  border: none;
  border-left: 1px solid var(--gray-border);
  border-right: 1px solid var(--gray-border);
  text-align: center;
  font-size: 1rem;
  background-color: white;
  font-weight: 600;
  padding: 0;
  -moz-appearance: textfield;
}

.quantidade-input::-webkit-outer-spin-button,
.quantidade-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Botão de adicionar ao carrinho */
.btn-carrinho {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 6px 0.5rem;
  margin-bottom: 2px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
}

.btn-carrinho:hover {
  background-color: var(--primary-hover);
}

.btn-carrinho:active {
  background-color: var(--primary-active);
}

/* Container de navegação */
.grid-nav-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.5rem 10rem;
  margin-top: 30px;
}

/* Botões de navegação */
.grid-nav {
  background-color: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--gray-border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-dark);
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Ícones (Font Awesome) */
.grid-nav i {
  pointer-events: none;
}

/* Hover visual */
.grid-nav:hover {
  background-color: var(--primary-color);
  color: white;
  transform: scale(1.1);
  border-color: var(--primary-color);
}

/* ============ RESPONSIVIDADE ============ */

/* Tablets e telas médias */
@media (max-width: 1200px) {
  .grid-nav-buttons {
    padding: 0.5rem 5rem;
  }
}

@media (max-width: 992px) {
  .produtos-card-col {
    min-height: 420px;
  }
  
  .product-image {
    height: 200px;
  }
}

/* Tablets pequenos */
@media (max-width: 768px) {
  .produtos-section {
    margin: 1.5rem auto;
    padding: 0 0.5rem;
  }
  
  #destaques-title,
  #novidades-title,
  #promocoes-title {
    font-size: 1.5rem;
    margin-top: 20px;
  }
  
  .section-header h3 {
    font-size: 1.5rem;
    margin-top: 20px;
  }
  
  .grid-nav-buttons {
    display: none;
  }
  
  .produtos-card-col {
    min-height: 400px;
    max-width: 200px;
  }
  
  .product-image {
    height: 180px;
  }
  
  .btn-acoes {
    justify-content: center;
  }
  
  .form-carrinho {
    flex-direction: column;
    align-items: stretch;
  }
  
  .quantidade-controle {
    width: 100%;
    justify-content: space-between;
  }
  
  .btn-carrinho {
    width: 100%;
    min-width: unset;
    margin-left: 0;
    margin-top: 1rem;
  }
  
  .preco-produto,
  .preco-indisponivel {
    font-size: 1.2rem;
  }
}

/* Dispositivos móveis grandes */
@media (max-width: 576px) {
  .produtos-section {
    margin: 1rem auto;
  }
  
  #destaques-title,
  #novidades-title,
  #promocoes-title {
    font-size: 1.3rem;
    margin-top: 15px;
  }
  
  .section-header h3 {
    font-size: 1.3rem;
    padding: 0 0.5rem;
    word-break: break-word;
  }
  
  .produtos-grid {
    gap: 0.8rem;
  }
  
  .produtos-card-col {
    min-height: 380px;
    max-width: 180px;
  }
  
  .product-image {
    height: 160px;
    padding: 0.8rem;
  }
  
  .card-body {
    padding: 0.8rem;
  }
  
  .card-title {
    font-size: 0.9rem;
  }
  
  .preco-produto,
  .preco-indisponivel {
    font-size: 1.1rem;
  }
  
  .promo-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.8rem;
  }
  
  .discount-circle {
    width: 35px;
    height: 35px;
    font-size: 0.75rem;
  }
}

/* Dispositivos móveis pequenos */
@media (max-width: 400px) {
  .produtos-card-col {
    min-height: 360px;
    max-width: 160px;
  }
  
  .product-image {
    height: 140px;
  }
  
  .card-title {
    font-size: 0.85rem;
  }
  
  .preco-produto,
  .preco-indisponivel {
    font-size: 1rem;
  }
  
  .quantidade-btn {
    width: 28px;
    font-size: 0.8rem;
  }
  
  .quantidade-input {
    font-size: 0.8rem;
  }
  
  .btn-carrinho {
    font-size: 0.85rem;
    padding: 0.5rem;
  }
}

/* Ajuste para manter alinhamento em telas maiores */
@media (min-width: 600px) {
  .form-carrinho {
    flex-wrap: nowrap;
  }

  .quantidade-controle {
    flex: 1 1 auto;
  }

  .btn-carrinho {
    flex: 1 1 auto;
  }
}