/* ============================================================
   POUPAX — style.css
   Design tokens → layout → components → utilities
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  --c-bg:        #F8FAFC;
  --c-surface:   #FFFFFF;
  --c-border:    #E2E8F0;
  --c-text:      #0F172A;
  --c-muted:     #64748B;
  --c-accent:    #10B981;
  --c-accent-dk: #059669;
  --c-accent-lt: #D1FAE5;
  --c-dark:      #0F172A;
  --c-dark-2:    #1E293B;

  --ff-display: 'Sora', system-ui, sans-serif;
  --ff-body:    'Inter', system-ui, sans-serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md: 0 4px 16px rgba(15,23,42,.08), 0 1px 4px rgba(15,23,42,.04);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.12);

  --transition: 200ms cubic-bezier(.4,0,.2,1);
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--ff-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
address { font-style: normal; }

/* ---------- LAYOUT ---------- */
.container {
  width: min(100%, 1200px);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 48px);
}

/* ---------- ACCESSIBILITY ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 60px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--c-accent);
  color: #fff;
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 8px;
}
.logo-text {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--c-dark);
  letter-spacing: -.02em;
}
.logo-light .logo-text { color: #fff; }
.logo-light .logo-mark { background: var(--c-accent); }

/* Desktop nav */
.main-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.main-nav a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--c-muted);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  transition: color var(--transition), background var(--transition);
}
.main-nav a:hover {
  color: var(--c-text);
  background: var(--c-border);
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  margin-left: auto;
}
.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.mobile-menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mobile-menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 99;
  padding: 24px;
  overflow-y: auto;
}
.mobile-nav nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-nav a {
  font-size: 1.1rem;
  font-weight: 500;
  padding: 14px 16px;
  border-radius: var(--r-md);
  color: var(--c-text);
  transition: background var(--transition);
}
.mobile-nav a:hover { background: var(--c-bg); }
.mobile-nav.open { display: block; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: clamp(56px, 10vw, 100px) 0 clamp(48px, 8vw, 80px);
  text-align: center;
}

/* Compact hero variant — só a barra de pesquisa, sem texto */
.hero--compact {
  padding: clamp(28px, 5vw, 40px) 0 clamp(20px, 4vw, 32px);
}

.hero-eyebrow {
  display: inline-block;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-accent-dk);
  background: var(--c-accent-lt);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--ff-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.03em;
  color: var(--c-dark);
  margin-bottom: 36px;
}
.hero h1 em {
  font-style: normal;
  color: var(--c-accent);
}

/* Search */
.search-wrapper {
  position: relative;
  max-width: 640px;
  margin-inline: auto;
}

.search-input {
  width: 100%;
  height: 56px;
  padding: 0 56px 0 20px;
  font-family: var(--ff-body);
  font-size: 1rem;
  color: var(--c-text);
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
.search-input::placeholder { color: var(--c-muted); }
.search-input:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(16,185,129,.12), var(--shadow-md);
}
.search-input::-webkit-search-cancel-button { display: none; }

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: var(--c-accent);
  color: #fff;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
}
.search-btn:hover { background: var(--c-accent-dk); transform: translateY(-50%) scale(1.05); }

/* Suggestions */
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 50;
}
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: .9375rem;
  cursor: pointer;
  transition: background var(--transition);
}
.suggestion-item:hover { background: var(--c-bg); }
.suggestion-icon { color: var(--c-muted); flex-shrink: 0; }

/* Hero stats */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.stat strong {
  font-family: var(--ff-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
}
.stat span {
  font-size: .75rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.stat-divider {
  width: 1px;
  height: 28px;
  background: var(--c-border);
}

/* Hero stats when used below the banner grid (secondary position) */
.hero-stats--secondary {
  margin-top: 20px;
}

/* ============================================================
   BANNER GRID (espaço para banners de afiliados)
   ============================================================ */
.banner-section {
  padding: 4px 0 clamp(36px, 7vw, 64px);
}

.banner-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: repeat(2, 1fr);
  gap: 16px;
  min-height: 280px;
}

.banner-slot {
  display: block;
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  transition: box-shadow var(--transition), transform var(--transition);
}
.banner-slot:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.banner-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Slot grande (ocupa as 2 linhas à esquerda) */
.banner-slot--lg {
  grid-row: 1 / 3;
}

/* Placeholder visual enquanto não há imagem/link configurado */
.banner-slot--placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  min-height: 130px;
  padding: 16px;
  text-align: center;
  background:
    repeating-linear-gradient(45deg, var(--c-bg), var(--c-bg) 10px, var(--c-surface) 10px, var(--c-surface) 20px);
  border: 2px dashed var(--c-border);
  color: var(--c-muted);
}
.banner-slot--placeholder .placeholder-title {
  font-family: var(--ff-display);
  font-size: .8125rem;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -.01em;
}
.banner-slot--placeholder .placeholder-size {
  font-size: .75rem;
  color: var(--c-muted);
}

@media (max-width: 640px) {
  .banner-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
  .banner-slot--lg { grid-row: auto; aspect-ratio: 16 / 8; }
  .banner-slot { aspect-ratio: 16 / 8; }
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: clamp(40px, 7vw, 72px) 0; }
.section-alt { background: var(--c-surface); }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.section-header h2,
.section h2 {
  font-family: var(--ff-display);
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 28px;
}
.section-header h2 { margin-bottom: 0; }

.link-all {
  font-size: .875rem;
  font-weight: 600;
  color: var(--c-accent-dk);
  white-space: nowrap;
  transition: color var(--transition);
}
.link-all:hover { color: var(--c-accent); }

/* ============================================================
   DEALS GRID
   ============================================================ */
.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* ============================================================
   PRODUCT CARD
   ============================================================ */
.product-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-img-wrap {
  aspect-ratio: 1;
  background: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}
.card-img-wrap img {
  object-fit: contain;
  width: 100%;
  height: 100%;
}
.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}
.card-badge.deal {
  background: #FEF3C7;
  color: #92400E;
}
.card-badge.new {
  background: var(--c-accent-lt);
  color: var(--c-accent-dk);
}

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.card-store {
  font-size: .75rem;
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.card-name {
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--c-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}
.card-price {
  font-family: var(--ff-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-accent-dk);
}
.card-price-old {
  font-size: .8125rem;
  color: var(--c-muted);
  text-decoration: line-through;
}
.card-stores-count {
  font-size: .75rem;
  color: var(--c-muted);
  margin-top: 4px;
}

.card-cta {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  text-align: center;
  padding: 10px;
  background: var(--c-accent);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  border-radius: var(--r-md);
  transition: background var(--transition);
}
.card-cta:hover { background: var(--c-accent-dk); }

/* ============================================================
   RESULTS SECTION
   ============================================================ */
.results-section {
  padding: 32px 0;
  border-bottom: 1px solid var(--c-border);
}
.results-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
}
.results-header h2 {
  font-family: var(--ff-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.results-count {
  font-size: .875rem;
  color: var(--c-muted);
}
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* ============================================================
   CATEGORIES
   ============================================================ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.cat-card:hover {
  border-color: var(--c-accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.cat-icon { font-size: 2rem; line-height: 1; }
.cat-name {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--c-text);
}
.cat-count {
  font-size: .75rem;
  color: var(--c-muted);
}

/* ============================================================
   STORES
   ============================================================ */
.stores-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.store-pill {
  padding: 8px 18px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--c-muted);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--c-dark);
  color: rgba(255,255,255,.7);
  margin-top: auto;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  padding-top: 56px;
  padding-bottom: 48px;
  align-items: start;
}

.footer-brand {
  max-width: 300px;
}
.footer-tagline {
  margin-top: 12px;
  font-size: .9375rem;
  color: rgba(255,255,255,.5);
  line-height: 1.6;
}
.footer-address {
  margin-top: 16px;
  font-size: .8125rem;
  color: rgba(255,255,255,.4);
  line-height: 1.8;
}

.footer-nav {
  display: flex;
  gap: 48px;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col h3 {
  font-family: var(--ff-display);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: 4px;
}
.footer-col a {
  font-size: .875rem;
  color: rgba(255,255,255,.6);
  transition: color var(--transition);
}
.footer-col a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 20px 0;
}
.footer-bottom p {
  font-size: .78125rem;
  color: rgba(255,255,255,.3);
  line-height: 1.6;
}
.footer-bottom a {
  color: rgba(255,255,255,.5);
  text-decoration: underline;
  transition: color var(--transition);
}
.footer-bottom a:hover { color: rgba(255,255,255,.8); }

/* ============================================================
   MODAL (Ürün Detayı)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .18s ease;
}
.modal-overlay[hidden] { display: none; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp .22s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-lg);
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-muted);
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--c-border); color: var(--c-text); }

.modal-body { padding: 32px; }

.modal-product-header {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  margin-bottom: 28px;
  align-items: start;
}

.modal-img-wrap {
  aspect-ratio: 1;
  background: var(--c-bg);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-img-wrap img {
  object-fit: contain;
  width: 100%;
  height: 100%;
}

.modal-product-name {
  font-family: var(--ff-display);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}

.modal-best-price {
  font-size: .8125rem;
  color: var(--c-muted);
}
.modal-best-price strong {
  font-family: var(--ff-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--c-accent-dk);
  display: block;
  margin-top: 4px;
}

/* Price comparison table */
.price-table-title {
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: 12px;
}

.price-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.price-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  transition: border-color var(--transition);
}
.price-row:first-child {
  border-color: var(--c-accent);
  background: var(--c-accent-lt);
}
.price-row:hover { border-color: var(--c-accent); }

.price-row-store {
  font-size: .9375rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.price-row-store .best-tag {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--c-accent);
  color: #fff;
  padding: 2px 6px;
  border-radius: 999px;
}

.price-row-price {
  font-family: var(--ff-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--c-text);
  white-space: nowrap;
}

.price-row-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--c-accent);
  color: #fff;
  font-size: .8125rem;
  font-weight: 600;
  border-radius: var(--r-sm);
  white-space: nowrap;
  transition: background var(--transition);
}
.price-row-cta:hover { background: var(--c-accent-dk); }
.price-row-cta svg { flex-shrink: 0; }

/* Schema hidden data */
.schema-data { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .mobile-menu-btn { display: flex; }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-nav {
    gap: 24px;
    flex-wrap: wrap;
  }
  .footer-brand { max-width: 100%; }

  .modal-product-header {
    grid-template-columns: 1fr;
  }
  .modal-img-wrap {
    max-width: 200px;
  }
}

@media (max-width: 480px) {
  .hero-stats { gap: 16px; }
  .stat-divider { display: none; }
  .footer-nav { flex-direction: column; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
