/* Reset & CSS Variables */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --primary-navy: #0f172a;
  --primary-deep: #1e3a8a;
  --primary-blue: #2563eb;
  --primary-light: #3b82f6;
  --accent-cyan: #0284c7;
  --bg-gradient: linear-gradient(135deg, #f0f7ff 0%, #e2e8f0 100%);
  --bg-body: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-white: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #93c5fd;
  --shadow-sm: 0 4px 6px -1px rgba(37, 99, 235, 0.06), 0 2px 4px -2px rgba(37, 99, 235, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(37, 99, 235, 0.1), 0 4px 6px -4px rgba(37, 99, 235, 0.1);
  --shadow-hover: 0 20px 25px -5px rgba(37, 99, 235, 0.18), 0 8px 10px -6px rgba(37, 99, 235, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-body);
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

/* Header & Navbar */
.navbar {
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--primary-deep) 100%);
  color: var(--text-white);
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-white);
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-light));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.brand-text {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-text span {
  color: var(--primary-light);
}

/* Language Switcher */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
}

.lang-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 0.3rem 0.65rem;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.25s ease;
  font-family: inherit;
}

.lang-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

.lang-btn.active {
  background: var(--primary-blue);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.flag-icon {
  font-size: 1.05rem;
  line-height: 1;
}

/* Search Box */
.search-box {
  position: relative;
  min-width: 280px;
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.search-input:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

/* Main Container */
.container {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  width: 100%;
  flex: 1;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: white;
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  opacity: 0.9;
  max-width: 600px;
}

/* Group Section */
.group-section {
  margin-bottom: 3rem;
}

.group-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid #dbeafe;
}

.group-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-deep);
}

.group-badge {
  background: #dbeafe;
  color: var(--primary-deep);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

/* Team Section */
.team-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.team-section:hover {
  box-shadow: var(--shadow-md);
}

.team-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary-navy);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.team-title::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 20px;
  background: var(--primary-blue);
  border-radius: 4px;
}

/* Grid de Produtos por Time - 5 por linha no PC */
.items-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
}

/* Fluxo contínuo de times no PC: um painel por grupo com grade única de 5 colunas */
.teams-flow {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s ease;
}

.teams-flow:hover {
  box-shadow: var(--shadow-md);
}

/* Linhas ímpares = títulos dos times, linhas pares = cards
   (posicionamento de cada elemento é definido inline pelo JS) */
.flow-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  column-gap: 1.25rem;
  row-gap: 1.25rem;
}

/* Um título pode ocupar apenas 1 coluna, então precisa quebrar linha sem vazar */
.flow-grid .flow-title {
  margin-bottom: 0;
  align-self: end;
  min-width: 0;
  line-height: 1.25;
  word-break: break-word;
}

.flow-grid .flow-title::before {
  flex: 0 0 auto;
}

/* Respiro extra entre uma linha de cards e o título da linha seguinte */
.flow-grid .flow-title-stacked {
  margin-top: 0.75rem;
}

/* Cover Card Item */
.item-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.item-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-focus);
}

.thumbnail-container {
  width: 100%;
  aspect-ratio: 3 / 4;
  background-color: #f1f5f9;
  overflow: hidden;
  position: relative;
}

.thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.item-card:hover .thumbnail-img {
  transform: scale(1.08);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.7) 0%, rgba(15, 23, 42, 0) 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
}

.item-card:hover .card-overlay {
  opacity: 1;
}

.btn-view-details {
  background: var(--primary-blue);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
}

.card-info {
  padding: 0.85rem 1rem;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  border-top: 1px solid #f1f5f9;
}

.item-name {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-align: center;
  width: 100%;
}

.item-badge {
  font-size: 0.88rem;
  color: var(--primary-deep);
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

/* Details Page Specifics */
.breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  color: var(--primary-deep);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-back:hover {
  background: #f1f5f9;
  transform: translateX(-3px);
  color: var(--primary-blue);
  border-color: var(--border-focus);
}

.details-header-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.details-title-container h1 {
  font-size: 2rem;
  color: var(--primary-navy);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.details-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.details-gallery-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-navy);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.gallery-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-focus);
}

.gallery-card-img-wrapper {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #f8fafc;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-card:hover img {
  transform: scale(1.06);
}

.gallery-card-caption {
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-top: 1px solid #f1f5f9;
  background: white;
}

.gallery-card-caption.is-cover {
  color: var(--primary-blue);
  background: #eff6ff;
}

/* Lightbox Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 85vw;
  max-height: 85vh;
}

.modal-content {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  color: white;
  font-size: 2.5rem;
  font-weight: 300;
  cursor: pointer;
  line-height: 1;
  z-index: 1020;
  transition: color 0.2s ease, transform 0.2s ease;
}

.modal-close:hover {
  color: var(--primary-light);
  transform: scale(1.15);
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 1.6rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1010;
  transition: all 0.25s ease;
  backdrop-filter: blur(4px);
  user-select: none;
}

.modal-nav:hover {
  background: var(--primary-blue);
  border-color: var(--primary-light);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.modal-prev {
  left: 2rem;
}

.modal-next {
  right: 2rem;
}

.modal-counter {
  margin-top: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.85rem;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* Footer */
footer {
  background: var(--primary-navy);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 2rem;
  margin-top: auto;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Loading & Empty State */
.loading-state, .error-state, .empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #dbeafe;
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* WhatsApp Button */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #25d366;
  color: #ffffff;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
}

.btn-whatsapp:hover {
  background: #128c7e;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(18, 140, 126, 0.45);
}

.whatsapp-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Pagination Controls */
.pagination-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 2.5rem 0 1.5rem 0;
}

.pagination-info {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
}

.page-btn {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover:not(:disabled) {
  background: #eff6ff;
  border-color: var(--primary-light);
  color: var(--primary-blue);
  transform: translateY(-1px);
}

.page-btn.active {
  background: var(--primary-blue);
  color: #ffffff;
  border-color: var(--primary-blue);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .navbar-container {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    width: 100%;
  }
  .hero {
    padding: 1.75rem;
  }
  .hero-title {
    font-size: 1.5rem;
  }
  .team-section,
  .teams-flow {
    padding: 1.25rem;
    margin-bottom: 1.25rem;
  }
  .team-title {
    font-size: 1.15rem;
    margin-bottom: 1rem;
  }
  .items-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
  }
  .details-header-card {
    padding: 1.25rem;
  }
}

