/* Piripiri Shop — Radar de Ofertas
   Tokens brand-guidelines + gatilhos de urgência/escassez.
   Ordem: tokens → base → header → hero → criteria → bands → cards → estados */

:root {
  --bg: #0b0d10;
  --surface: #14171d;
  --surface-2: #1c212b;
  --border: #282f3d;

  --orange: #ff5500;
  --orange-hover: #ff6a1a;
  --orange-deep: #e04800;
  --orange-glow: rgba(255, 85, 0, 0.35);
  --orange-soft: rgba(255, 85, 0, 0.12);

  --cyan: #00e5ff;
  --cyan-glow: rgba(0, 229, 255, 0.22);

  --text: #ffffff;
  --muted: #94a3b8;
  --dim: #64748b;

  --urgency: #ff3344;
  --urgency-bg: rgba(255, 51, 68, 0.14);
  --trust: #10b981;
  --trust-bg: rgba(16, 185, 129, 0.12);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, monospace;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--orange);
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* ── Header ─────────────────────────────────────── */

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 13, 16, 0.94);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.brand-name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand-name span { color: var(--orange); }

.live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--cyan);
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  margin-left: auto;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.45);
  animation: radar-pulse 2s infinite;
}

@keyframes radar-pulse {
  70% { box-shadow: 0 0 0 8px rgba(0, 229, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); }
}

.header-cta {
  text-decoration: none;
  background: var(--orange);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  border-radius: var(--r-sm);
}

.header-cta:hover { background: var(--orange-hover); }

@media (max-width: 560px) {
  .live { display: none; }
}

/* ── Buttons ────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.8rem 1.35rem;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 0 24px var(--orange-glow);
}

.btn-primary:hover { background: var(--orange-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--orange);
  color: var(--orange);
}

/* ── Hero (logo + urgência) ────────────────────── */

.hero {
  position: relative;
  padding: 3rem 0 2.75rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 70% at 50% -20%, rgba(255, 85, 0, 0.28), transparent 60%),
    radial-gradient(ellipse 40% 50% at 0% 100%, rgba(255, 85, 0, 0.1), transparent 50%),
    radial-gradient(ellipse 35% 40% at 100% 80%, rgba(0, 229, 255, 0.06), transparent 50%),
    var(--bg);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 18px,
      rgba(255, 85, 0, 0.025) 18px,
      rgba(255, 85, 0, 0.025) 19px
    );
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.hero-logo {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 0.25rem;
}

.hero-logo img {
  width: 140px;
  height: 140px;
  border-radius: 28px;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 3px rgba(255, 85, 0, 0.45), 0 0 48px var(--orange-glow);
}

.hero-logo-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 85, 0, 0.45);
  animation: spin-slow 24s linear infinite;
}

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

.hero-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.hero h1 em {
  font-style: normal;
  color: var(--orange);
  text-shadow: 0 0 40px var(--orange-glow);
}

.hero-lead {
  margin: 0;
  color: var(--muted);
  max-width: 34rem;
  font-size: 1.05rem;
}

/* Barra de escassez/urgência */
.urgency-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.urgency-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--urgency-bg);
  border: 1px solid rgba(255, 51, 68, 0.4);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
}

.urgency-pill strong {
  color: var(--urgency);
  font-variant-numeric: tabular-nums;
}

.urgency-pill--sync {
  background: var(--orange-soft);
  border-color: rgba(255, 85, 0, 0.45);
}

.urgency-pill--sync strong { color: var(--orange); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  width: 100%;
  max-width: 720px;
  margin: 1.25rem 0 0;
}

@media (max-width: 700px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}

.stat {
  background: rgba(20, 23, 29, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.85rem 0.65rem;
  text-align: center;
}

.stat dt {
  font-size: 0.7rem;
  color: var(--dim);
  order: 2;
  margin-top: 0.2rem;
}

.stat dd {
  margin: 0;
  order: 1;
}

.stat-value {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-value.accent { color: var(--orange); }

.stat-value--sm {
  font-size: 1.15rem;
  color: var(--cyan);
}

.stat {
  display: flex;
  flex-direction: column;
}

/* ── Criteria (segmentação) ────────────────────── */

.criteria {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.criteria-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

@media (max-width: 900px) {
  .criteria-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .criteria-grid { grid-template-columns: 1fr; }
}

.criteria-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--orange);
  border-radius: var(--r-md);
  padding: 1rem 1rem 1.1rem;
}

.criteria-num {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--bg);
  background: var(--orange);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-bottom: 0.55rem;
}

.criteria-card h2 {
  margin: 0 0 0.35rem;
  font-size: 0.98rem;
  font-weight: 700;
}

.criteria-card p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ── Band sections ─────────────────────────────── */

.band {
  padding: 2.75rem 0 0.5rem;
}

.band--hot {
  background:
    linear-gradient(180deg, rgba(255, 85, 0, 0.07), transparent 40%),
    var(--bg);
}

.band--trust {
  background:
    linear-gradient(180deg, rgba(16, 185, 129, 0.05), transparent 40%),
    var(--bg);
}

.band-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.band-kicker {
  margin: 0 0 0.2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
}

.band-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  letter-spacing: -0.025em;
  font-weight: 800;
}

.band-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--dim);
  font-family: var(--mono);
}

/* ── Toolbar ────────────────────────────────────── */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.toolbar-label {
  font-size: 0.8rem;
  color: var(--dim);
}

.search {
  flex: 1 1 220px;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 0.9rem;
}

.search::placeholder { color: var(--dim); }
.search:focus { border-color: var(--orange); outline: none; }

.select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.65rem 0.75rem;
}

/* ── Grid / Cards ──────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
  padding-bottom: 2.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: rgba(255, 85, 0, 0.55);
  transform: translateY(-2px);
}

.card-media {
  position: relative;
  aspect-ratio: 1;
  background: #0e1116;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.75rem;
}

.badge-discount {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.22rem 0.5rem;
  border-radius: var(--r-sm);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 12px var(--orange-glow);
  z-index: 1;
}

.badge-hot {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  background: var(--urgency);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: var(--r-sm);
  z-index: 1;
}

.badge-official {
  position: absolute;
  bottom: 0.55rem;
  left: 0.55rem;
  background: var(--trust-bg);
  color: var(--trust);
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--r-sm);
  z-index: 1;
}

.card-body {
  padding: 0.85rem 0.9rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.card-name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.45em;
}

.card-price {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.price-now {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.price-was {
  font-size: 0.8rem;
  color: var(--dim);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  font-size: 0.76rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.card-meta .trust { color: var(--trust); }
.card-meta .scarcity { color: var(--urgency); font-weight: 600; }

.card-shop {
  font-size: 0.76rem;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-cta {
  margin-top: auto;
  display: block;
  text-align: center;
  text-decoration: none;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.65rem 0.7rem;
  border-radius: var(--r-sm);
  transition: background 0.15s ease;
}

.card-cta:hover { background: var(--orange-hover); }

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding-bottom: 2.5rem;
}

/* ── Estados ────────────────────────────────────── */

.state {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  margin-bottom: 2rem;
  background: var(--surface);
}

.state strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.35rem;
}

.state.error {
  border-color: rgba(255, 85, 0, 0.55);
  background: var(--orange-soft);
  color: #fed7aa;
}

.state.error code {
  display: inline-block;
  margin-top: 0.5rem;
  background: var(--bg);
  padding: 0.35rem 0.55rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
}

/* ── Footer ────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.5rem;
  color: var(--dim);
  font-size: 0.85rem;
  background: var(--surface);
}

.site-footer .wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
}

.footer-brand img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.site-footer p { margin: 0; max-width: 52rem; }
.site-footer a { color: var(--orange); }

/* ── Skeleton ──────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
  border-radius: var(--r-md);
  min-height: 320px;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot,
  .hero-logo-ring,
  .skeleton { animation: none; }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
