/* ==========================================================================
   vitrine/public/assets/css/main.css
   Versão Final - Moderna, limpa e responsiva (2026) - CORRIGIDA
   Duplicatas removidas e seções agrupadas por correspondência com o site
   ========================================================================== */

:root {
  --primary: #0066cc;
  --primary-dark: #004c99;
  --primary-light: #e6f0ff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-600: #6c757d;
  --dark: #2c3e50;
  --success: #28a745;
  --danger: #dc3545;
  --radius: 18px;
  --shadow-sm: 0 8px 25px rgba(0,0,0,0.12);
  --shadow-md: 0 30px 45px -15px rgba(0,0,0,0.20);
}

/* =============================================
   RESET GLOBAL
   ============================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 100%; /* 16px base */
}
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--gray-100);
  color: var(--dark);
  line-height: 1.3;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* =============================================
   CONTAINER PRINCIPAL
   ============================================= */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* =============================================
   HEADER (Logo + Navegação + Dropdown)
   ============================================= */
.site-header {
  background: white;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 0;
}
.site-header .container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.logo a {
  color: var(--primary);
  font-size: 1.7rem;
  font-weight: 800;
  text-decoration: none;
}
.logo img {
  width: 100px;
  height: 100px;
  object-fit: contain;
}
.site-header nav a {
  color: var(--dark);
  text-decoration: none;
  margin-left: 1.5rem;
  font-weight: 500;
}
.site-header nav a:hover {
  color: var(--primary);
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-toggle {
  color: var(--dark);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  cursor: pointer;
  transition: color 0.2s;
}
.dropdown-toggle:hover {
  color: var(--primary);
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  min-width: 240px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  border-radius: 8px;
  padding: 8px 0;
  z-index: 1000;
  margin-top: 4px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}
.dropdown:hover .dropdown-menu {
  display: block;
  opacity: 1;
  visibility: visible;
}
.dropdown-menu a {
  display: block;
  padding: 10px 18px;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
}
.dropdown-menu a:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.site-main {
  padding: 1.5rem 0 3rem;
  flex: 1 0 auto;
}

/* =============================================
   BREADCRUMB
   ============================================= */
.breadcrumb {
  background: #f8fafc;
  padding: 1rem 0;
  margin: 1.5rem 0 2rem;
  font-size: 1rem;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}
.breadcrumb .container {
  display: flex;
  align-items: center;
}
.breadcrumb ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
  align-items: center;
}
.breadcrumb li {
  display: flex;
  align-items: center;
}
.breadcrumb li + li::before {
  content: "›";
  margin: 0 0.85rem;
  color: #94a3b8;
  font-size: 1.1rem;
  font-weight: 300;
}
.breadcrumb a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}
.breadcrumb a:hover {
  color: #1e40af;
  text-decoration: underline;
}
.breadcrumb .current {
  color: #1f2937;
  font-weight: 700;
  pointer-events: none;
}

/* =============================================
   PRODUTOS - GRID + LISTA + CARDS + ROTATOR
   ============================================= */
.products-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
  margin-top: 1.5rem;
}
.product-card {
  background: #ffffff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transform: scale(0.96);
  transform-origin: top left;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 800px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}
.product-card .small-rotating-container {
  aspect-ratio: 1 / 1;
}
.product-card .product-info {
  padding: 1rem 1.2rem;
}
.product-card:hover {
  transform: translateY(1px) scale(1);
  box-shadow: var(--shadow-md);
}

/* Rotator (quadrado e otimizado) */
.small-rotating-container {
  margin-bottom: 1rem;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  position: relative;
  background: #f8f9fa;
}
.small-rotator {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.45s ease-in-out;
  opacity: 1;
}

/* Estilos adicionais dos cards (imagem, título, preço, lojas) */
.product-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3.05;
  background: #f8fafc;
  overflow: hidden;
}
.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}
.product-card:hover .product-image {
  transform: scale(1.12);
}
.product-image-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.35), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.product-card:hover .product-image-container::after {
  opacity: 1;
}
.product-info {
  padding: 1.6rem 1.7rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.product-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.8rem;
  color: #1f2937;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-price {
  font-size: 1.35rem;
  font-weight: 700;
  color: #e11d48;
  margin: 0.3rem 0 0.6rem;
  letter-spacing: -0.5px;
}
.product-stores {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: auto;
  padding-top: 1.1rem;
  border-top: 1px solid #f1f5f9;
  font-weight: 500;
}
.product-card:hover .product-price {
  color: #be123c;
  transform: scale(1.05);
  transition: all 0.3s ease;
}

/* Modo Lista */
.products-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.product-card.list-mode {
  flex-direction: row;
  height: auto;
  align-items: center;
}
.product-card.list-mode .small-rotating-container {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  margin-right: 1.2rem;
}
.product-card.list-mode .product-info {
  padding: 1rem 0;
  flex: 1;
}

/* Switch de Visualização (Grade / Lista) */
.view-mode-switch {
  display: flex;
  gap: 8px;
  margin: 1rem 0 1.5rem;
  justify-content: center;
}
.view-mode-btn {
  padding: 10px 16px;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.view-mode-btn.active,
.view-mode-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* =============================================
   BOTÃO GENÉRICO
   ============================================= */
.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
}
.btn:hover,
.btn:focus {
  background: var(--primary-dark);
}

/* =============================================
   PÁGINA DE DETALHE DO PRODUTO
   ============================================= */
.product-detail {
  max-width: 1100px;
}
.product-header h1 {
  margin-bottom: 3rem;
}
.product-meta {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}
.product-meta span {
  margin-right: 1.5rem;
}
.main-product-image {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.thumbnails {
  display: flex;
  gap: 12px;
  margin-top: 1rem;
  overflow-x: auto;
  padding-bottom: 8px;
}
.thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border 0.2s;
}
.thumbnail:hover,
.thumbnail.active {
  border-color: var(--primary);
}

/* Layout 60% / 40% (Galeria + Ofertas) */
.product-main-row {
  display: flex;
  gap: 2.5rem;
  margin: 2rem 0 3rem;
  align-items: flex-start;
}
.product-gallery-column {
  flex: 0 0 60%;
  max-width: 60%;
}
.offers-section {
  background: #f8f9fa;
  padding: 1.8rem;
  border-radius: 16px;
  flex: 0 0 40%;
  max-width: 40%;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  position: sticky;
  top: 20px;
}
.offer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
}
.offer-item:last-child {
  border-bottom: none;
}
.offer-store {
  font-weight: 600;
}
.offer-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: #2e7d32;
}
.offer-btn {
  background: var(--primary);
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
}
.offers-section h3 {
  margin-top: 0;
  font-size: 1.35rem;
  color: #1f2937;
}
.current-price {
  font-size: 2.2rem;
  font-weight: 700;
  color: #e63946;
}
.product-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: var(--dark);
  color: white;
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  margin-top: 3rem;
  flex-shrink: 0;
  margin-top: auto;
}
.site-footer .container {
  font-size: 0.95rem;
}

/* =============================================
   MEDIA QUERIES - RESPONSIVIDADE (CONSOLIDADAS)
   ============================================= */
@media (max-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.2rem;
  }
  .product-title { font-size: 1rem; }
  .product-price { font-size: 1.35rem; }
  .product-main-row {
    flex-direction: column;
    gap: 2rem;
  }
  .product-gallery-column,
  .offers-section {
    flex: 1 1 auto;
    max-width: 100%;
  }
  .offers-section {
    position: static;
  }
}

@media (max-width: 768px) {
  .site-header .container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }
  .logo {
    margin-bottom: 8px;
  }
  .logo img {
    width: 90px;
    height: 90px;
  }
  .site-header nav {
    width: 100%;
    text-align: center;
  }
  .site-header nav a {
    margin: 0 1rem;
    font-size: 0.95rem;
  }
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
  }
  .product-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
  .products-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .product-card {
    max-width: 100%;
    margin: 0 auto;
  }
  .product-title { font-size: 1.1rem; }
  .product-price { font-size: 1.5rem; }
  h1 { font-size: 1.7rem; }
  .small-rotating-container {
    height: 180px;
  }
}