/* ============================================================
   ShoppingCompare — CSS Principal v2
   Design System moderno — Nossa cara!
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  background-color: #f1f5f9;
  color: #1e293b;
}

/* Esconde scrollbar mas mantém scroll */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ── HERO ─────────────────────────────────────────────────── */
.hero-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #1d4ed8 100%);
}

/* Orbs animados */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  pointer-events: none;
}
.hero-orb-1 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, #3b82f6, transparent);
  top: -80px; left: -80px;
  animation: floatOrb 8s ease-in-out infinite;
}
.hero-orb-2 {
  width: 220px; height: 220px;
  background: radial-gradient(circle, #6366f1, transparent);
  bottom: -60px; right: 8%;
  animation: floatOrb 10s ease-in-out infinite reverse;
}
.hero-orb-3 {
  width: 150px; height: 150px;
  background: radial-gradient(circle, #eab308, transparent);
  top: 30%; right: 25%;
  opacity: 0.15;
  animation: floatOrb 12s ease-in-out infinite;
}
@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -20px) scale(1.05); }
  66%       { transform: translate(-20px, 15px) scale(0.95); }
}

/* Gradiente no texto do título */
.hero-gradient-text {
  background: linear-gradient(90deg, #fbbf24, #f59e0b, #fcd34d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Tags rápidas do hero */
.quick-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.875rem;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  color: rgba(255,255,255,0.9);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  transition: all 0.2s;
}
.quick-tag:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.4);
  transform: translateY(-1px);
}

/* Painel glassmorphism de categorias no hero */
.hero-cats-panel {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 1.5rem;
  padding: 1.25rem;
}

/* Botão de categoria no hero */
.hero-cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.5rem;
  border-radius: 1rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer;
  text-align: center;
}
.hero-cat-btn:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.35);
  transform: translateY(-2px);
}
.hero-cat-icon {
  font-size: 1.75rem;
  line-height: 1;
  transition: transform 0.2s;
}
.hero-cat-btn:hover .hero-cat-icon { transform: scale(1.15); }
.hero-cat-name {
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  word-break: break-word;
}
.hero-cat-count {
  color: rgba(255,255,255,0.45);
  font-size: 0.65rem;
  font-weight: 500;
}

/* ── SUB-NAV DE CATEGORIAS ────────────────────────────────── */
.subnav-link {
  display: inline-flex;
  align-items: center;
  padding: 0 0.75rem;
  height: 100%;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  shrink: 0;
}
.subnav-link:hover {
  color: #1d4ed8;
  border-bottom-color: #3b82f6;
  background: #f0f7ff;
}
.subnav-hot {
  color: #dc2626 !important;
  font-weight: 700;
}
.subnav-hot:hover {
  border-bottom-color: #dc2626 !important;
  background: #fff5f5 !important;
}

/* ── FAIXA DE LOJAS ───────────────────────────────────────── */
.store-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  transition: all 0.2s;
  padding: 0.5rem 0.25rem;
  border-radius: 1rem;
}
.store-pill:hover {
  transform: translateY(-3px);
}
.store-pill:hover .store-pill-logo {
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.store-pill-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 0.85rem;
  font-weight: 900;
  color: white;
  letter-spacing: -0.5px;
}
.store-pill-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: #374151;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 64px;
}
.store-pill-tag {
  font-size: 0.6rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

/* ── BANNERS PROMOÇÕES ────────────────────────────────────── */
.promo-banner {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  padding: 1.75rem;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: all 0.25s;
}
.promo-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
.promo-banner-main {
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 50%, #3b82f6 100%);
  min-height: 200px;
}
.promo-banner-orb {
  position: absolute;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.15), transparent);
  border-radius: 50%;
  top: -60px; right: 80px;
  pointer-events: none;
}
.promo-banner-secondary {
  background: linear-gradient(135deg, #312e81, #4338ca);
}
.promo-banner-green {
  background: linear-gradient(135deg, #064e3b, #059669);
}

/* ── CATEGORIA BLOCOS ─────────────────────────────────────── */
.cat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1.125rem 0.5rem;
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 1rem;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  min-height: 96px;
}
.cat-block:hover {
  border-color: #93c5fd;
  background: linear-gradient(135deg, #eff6ff, #fff);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(37,99,235,0.1);
}
.cat-block-icon {
  font-size: 2rem;
  line-height: 1;
  transition: transform 0.2s;
}
.cat-block:hover .cat-block-icon { transform: scale(1.15); }
.cat-block-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  line-height: 1.2;
}
.cat-block-count {
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 500;
}

/* ── PRODUCT GRID ─────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
@media (max-width: 640px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 0.625rem; }
}

/* ── PRODUCT CARD ─────────────────────────────────────────── */
.product-card {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  border: 1.5px solid #e2e8f0;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer;
}
.product-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 10px 30px rgba(37,99,235,0.12);
  transform: translateY(-3px);
}
.product-card-img {
  position: relative;
  background: #f8fafc;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1rem;
}
.product-card-body {
  display: flex;
  flex-direction: column;
  padding: 0.875rem;
  flex: 1;
}
.product-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.25rem;
}
.offer-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #2563eb;
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
}
.btn-compare {
  display: block;
  text-align: center;
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.15s;
}
.product-card:hover .btn-compare {
  background: #2563eb;
  color: white;
}

/* ── OFFER CARDS (Página de Produto) ──────────────────────── */
.offer-card {
  border-radius: 1rem;
  padding: 1.125rem 1.25rem;
  transition: all 0.2s;
}
.offer-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

/* ── BOTÕES ───────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: #2563eb;
  color: white;
  font-weight: 700;
  padding: 0.75rem 1.75rem;
  border-radius: 0.75rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.9375rem;
}
.btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); }

.btn-buy {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: white !important;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  text-decoration: none !important;
  font-size: 0.9375rem;
  transition: all 0.2s;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  animation: pulse-green 2s infinite;
}
.btn-buy:hover {
  background: linear-gradient(135deg, #15803d, #166534);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(22,163,74,0.4);
  animation: none;
}

/* ── BADGES ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}
.badge-green  { background: #dcfce7; color: #166534; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-yellow { background: #fef9c3; color: #854d0e; }

/* ── SECTION TITLES ───────────────────────────────────────── */
.section-title {
  font-size: 1.375rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

/* ── COMO FUNCIONA ────────────────────────────────────────── */
.how-section {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  padding: 4rem 1rem;
}
.how-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1.25rem;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
}
.how-step:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-4px);
}
.how-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #2563eb;
  color: white;
  font-size: 0.8rem;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  align-self: flex-start;
}
.how-step-icon {
  font-size: 2.5rem;
  margin: 0.5rem 0;
}

/* ── NAV LINKS ────────────────────────────────────────────── */
.nav-link {
  padding: 0.4rem 0.75rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-link:hover { background: #f1f5f9; color: #1e40af; }

/* ── SORT SELECT ──────────────────────────────────────────── */
.sort-select {
  padding: 0.5rem 0.875rem;
  border-radius: 0.625rem;
  border: 1px solid #e2e8f0;
  background: white;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}
.sort-select:focus { border-color: #93c5fd; }

/* ── PRICE TABLE ──────────────────────────────────────────── */
.price-table { width: 100%; border-collapse: collapse; }
.price-table th {
  background: #f8fafc;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}
.price-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9375rem;
}
.price-table tr:hover td { background: #f8fafc; }

/* ── CATEGORY CARD (páginas de produto/categoria) ─────────── */
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.5rem;
  background: white;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  transition: all 0.2s;
  min-height: 90px;
  gap: 0.25rem;
}
.category-card:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(37,99,235,0.1);
}

/* ── SUGGESTIONS ──────────────────────────────────────────── */
#suggestions { box-shadow: 0 10px 40px rgba(0,0,0,0.12); }
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  cursor: pointer;
  transition: background 0.1s;
  text-decoration: none;
  color: inherit;
}
.suggestion-item:hover { background: #f1f5f9; }
.suggestion-item img {
  width: 40px; height: 40px;
  object-fit: contain;
  border-radius: 0.375rem;
  background: #f8fafc;
}

/* ── SKELETON ─────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.5rem;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── TOAST ────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: white;
  padding: 0.75rem 1.75rem;
  border-radius: 9999px;
  font-size: 0.9375rem;
  font-weight: 600;
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  white-space: nowrap;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ── SCROLL TO TOP ────────────────────────────────────────── */
#scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px; height: 44px;
  background: #2563eb;
  color: white;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(37,99,235,0.4);
  transition: all 0.2s;
  font-size: 1.125rem;
  z-index: 100;
}
#scroll-top.show { display: flex; }
#scroll-top:hover { transform: translateY(-2px); }

/* ── ANIMATIONS ───────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.4s ease forwards; }

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(22,163,74,0); }
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-section h1 { font-size: 1.75rem; }
  .section-title { font-size: 1.125rem; }
  .product-card-img { height: 140px; }
  .btn-buy { padding: 0.625rem 1rem; font-size: 0.875rem; }
  .promo-banner { min-height: 130px; padding: 1.25rem; }
  .store-pill-logo { width: 44px; height: 44px; }
  .hero-cats-panel { padding: 1rem; }
}

/* ── HEADER SHADOW ON SCROLL ──────────────────────────────── */
header { transition: box-shadow 0.2s; }
header.scrolled { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
