/* ─── Design System ──────────────────────────────────────────────────────── */
:root {
  --bg:        #0f1117;
  --bg2:       #1a1d27;
  --bg3:       #222638;
  --border:    #2e3347;
  --green:     #00c853;
  --green-dim: #00963e;
  --shopee:    #ee4d2d;
  --shopee-bg: #2a1210;
  --blue:      #4f8ef7;
  --orange:    #ff9800;
  --text:      #eef0f6;
  --text2:     #9aa3b8;
  --text3:     #5c6480;
  --radius:    10px;
  --radius-sm: 6px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ─── Topbar ────────────────────────────────────────────────────────────── */
.topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,.5);
}

.topbar-inner {
  max-width: 1280px; margin: 0 auto;
  padding: .65rem 1rem;
  display: flex; align-items: center; gap: 1rem;
}

.brand {
  display: flex; align-items: center; gap: .6rem;
  flex-shrink: 0;
  text-decoration: none;
}
.brand img {
  width: 44px; height: 44px; border-radius: 10px; object-fit: cover;
}
.brand-name {
  font-size: .95rem; font-weight: 700; color: var(--green);
  white-space: nowrap;
  display: none;
}
@media (min-width: 480px) { .brand-name { display: block; } }

/* ─── Search bar (topbar) ───────────────────────────────────────────────── */
.search-box {
  flex: 1; position: relative; max-width: 600px;
}
.search-box input {
  width: 100%;
  padding: .6rem 1rem .6rem 2.6rem;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text); font-size: .9rem;
  outline: none; transition: border-color .15s, background .15s;
}
.search-box input:focus {
  border-color: var(--green); background: var(--bg2);
}
.search-box input::placeholder { color: var(--text3); }
.search-icon {
  position: absolute; left: .75rem; top: 50%;
  transform: translateY(-50%); font-size: .95rem;
  color: var(--text3); pointer-events: none;
}

.topbar-actions {
  display: flex; align-items: center; gap: .5rem; flex-shrink: 0;
}
.tg-btn {
  display: flex; align-items: center; gap: .35rem;
  background: #1d7ec9; color: #fff;
  border-radius: 8px; padding: .5rem .85rem;
  font-size: .8rem; font-weight: 600;
  white-space: nowrap; transition: background .15s;
}
.tg-btn:hover { background: #1569aa; }
.tg-btn .icon { font-size: 1rem; }

/* ─── Category nav ──────────────────────────────────────────────────────── */
.catnav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.catnav-inner {
  max-width: 1280px; margin: 0 auto;
  padding: .25rem .75rem;
  display: flex; flex-wrap: wrap; gap: .25rem;
}

.catnav-item {
  display: flex; align-items: center; gap: .4rem;
  padding: .65rem .85rem;
  font-size: .82rem; font-weight: 500;
  color: var(--text2);
  border-bottom: 2.5px solid transparent;
  transition: color .15s, border-color .15s;
  cursor: pointer;
}
.catnav-item:hover { color: var(--text); }
.catnav-item.active {
  color: var(--green); border-bottom-color: var(--green);
}
.catnav-item .cat-icon { font-size: 1rem; }

/* ─── Hero search (homepage only) ──────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #12162e 0%, #0f1117 60%);
  padding: 2.5rem 1rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800; color: var(--text);
  margin-bottom: .5rem;
  letter-spacing: -.5px;
}
.hero h1 span { color: var(--green); }
.hero p {
  color: var(--text2); font-size: .9rem; margin-bottom: 1.5rem;
}
.hero-search {
  max-width: 560px; margin: 0 auto; position: relative;
}
.hero-search input {
  width: 100%; padding: .9rem 4.5rem .9rem 1.25rem;
  background: var(--bg2); border: 2px solid var(--border);
  border-radius: 12px; color: var(--text); font-size: 1rem;
  outline: none; transition: border-color .15s;
}
.hero-search input:focus { border-color: var(--green); }
.hero-search input::placeholder { color: var(--text3); }
.hero-search-btn {
  position: absolute; right: .4rem; top: 50%;
  transform: translateY(-50%);
  background: var(--green-dim); color: #fff;
  border: none; border-radius: 8px;
  padding: .55rem .9rem; font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.hero-search-btn:hover { background: var(--green); }

/* ─── Main layout ───────────────────────────────────────────────────────── */
.page-wrap {
  max-width: 1280px; margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.section-header {
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: 1.1rem;
}
.section-header h2 {
  font-size: 1rem; font-weight: 700; color: var(--text);
}
.section-header .badge {
  background: var(--bg3); color: var(--text2);
  border-radius: 20px; font-size: .72rem; padding: .15rem .55rem;
}
.section-divider {
  width: 3px; height: 1.1rem; border-radius: 2px;
  background: var(--green); flex-shrink: 0;
}
.section-divider.shopee { background: var(--shopee); }
.section-divider.campaign { background: var(--orange); }
.section-divider.ml { background: #ffe600; }

section.offer-section { margin-bottom: 2.5rem; }

/* ─── Cards grid ────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .875rem;
}

/* ─── Product card ──────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  position: relative;
  cursor: pointer;
}
.card:hover {
  transform: translateY(-4px);
  border-color: #3d4460;
  box-shadow: var(--shadow);
}
.card a {
  display: flex; flex-direction: column; height: 100%;
  text-decoration: none; color: inherit;
}

/* Image area */
.card-img {
  aspect-ratio: 1/1;
  background: #13151f;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .25s;
}
.card:hover .card-img img { transform: scale(1.04); }
.no-img { font-size: 2.5rem; color: var(--text3); }
.no-img-placeholder { width: 100%; height: 100%; object-fit: cover; opacity: .65; }

/* Campaign image is wider */
.card--campaign .card-img { aspect-ratio: 16/9; }

/* Discount badge */
.discount-badge {
  position: absolute; top: .5rem; left: .5rem;
  background: var(--shopee); color: #fff;
  border-radius: var(--radius-sm);
  font-size: .68rem; font-weight: 800;
  padding: .15rem .4rem;
  z-index: 1; letter-spacing: .3px;
}
.discount-badge.green { background: var(--green-dim); }

/* Store badge (top-right) */
.store-badge {
  position: absolute; top: .5rem; right: .5rem;
  border-radius: var(--radius-sm);
  font-size: .62rem; font-weight: 700;
  padding: .15rem .45rem; z-index: 1;
  backdrop-filter: blur(6px);
}
.store-badge.shopee  { background: rgba(238,77,45,.85); color: #fff; }
.store-badge.parceiro { background: rgba(0,150,62,.8); color: #fff; }
.store-badge.campaign { background: rgba(255,152,0,.85); color: #fff; }
.store-badge.ml      { background: rgba(255,230,0,.9); color: #333; }

/* Body */
.card-body {
  padding: .75rem;
  display: flex; flex-direction: column; gap: .3rem;
  flex: 1;
}
.card-body h3 {
  font-size: .8rem; font-weight: 500;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

/* Pricing */
.price-row {
  display: flex; align-items: baseline; gap: .4rem;
  flex-wrap: wrap; margin-top: auto; padding-top: .4rem;
}
.price {
  font-size: 1rem; font-weight: 800;
  color: var(--green);
}
.card--shopee .price { color: var(--shopee); }
.card--campaign .price { color: var(--orange); }
.original-price {
  font-size: .72rem; color: var(--text3);
  text-decoration: line-through;
}

/* Rating */
.rating {
  font-size: .72rem; color: var(--text2);
  display: flex; align-items: center; gap: .2rem;
}

/* Coupon code */
.coupon-code {
  font-size: .75rem;
  background: rgba(0,200,83,.08);
  border: 1px dashed var(--green-dim);
  border-radius: var(--radius-sm);
  padding: .25rem .45rem; color: var(--green);
}

/* CTA button */
.card-cta {
  display: block; text-align: center;
  background: var(--bg3);
  color: var(--text2);
  border-radius: var(--radius-sm);
  padding: .42rem; font-size: .77rem; font-weight: 600;
  margin-top: .4rem;
  transition: background .15s, color .15s;
}
.card:hover .card-cta { background: var(--green-dim); color: #fff; }
.card--shopee:hover .card-cta { background: var(--shopee); color: #fff; }
.card--campaign:hover .card-cta { background: var(--orange); color: #fff; }

/* ─── Skeleton loading ──────────────────────────────────────────────────── */
.skeleton {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.skeleton-img {
  aspect-ratio: 1/1;
  background: linear-gradient(90deg, var(--bg3) 25%, #2a2e42 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-body { padding: .75rem; display: flex; flex-direction: column; gap: .5rem; }
.skeleton-line {
  height: .7rem;
  background: linear-gradient(90deg, var(--bg3) 25%, #2a2e42 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite; border-radius: 4px;
}
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; height: .85rem; margin-top: .25rem; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Empty / error states ──────────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem; color: var(--text2);
}
.empty-state .icon { font-size: 2.5rem; display: block; margin-bottom: .75rem; }
.empty-state h3 { font-size: 1rem; margin-bottom: .4rem; color: var(--text); }
.empty-state p  { font-size: .85rem; }
.error-state {
  grid-column: 1 / -1;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; text-align: center;
  color: var(--text2); font-size: .85rem;
}

/* ─── Page title (category / search) ───────────────────────────────────── */
.page-hero {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1rem;
}
.page-hero-inner {
  max-width: 1280px; margin: 0 auto;
}
.page-hero h1 {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 800; margin-bottom: .25rem;
}
.page-hero p { color: var(--text2); font-size: .85rem; }

/* ─── Busca page ────────────────────────────────────────────────────────── */
.search-page-box {
  max-width: 680px; margin: 1.5rem auto; padding: 0 1rem;
}
.search-page-box .search-box input {
  padding: .8rem 1rem .8rem 2.75rem;
  font-size: .95rem; border-radius: 10px;
}
.search-hint {
  text-align: center; padding: 4rem 1rem; color: var(--text2);
}
.search-hint .icon { font-size: 3rem; display: block; margin-bottom: 1rem; }
.search-hint h2 { font-size: 1.1rem; color: var(--text); margin-bottom: .5rem; }

/* ─── Footer ────────────────────────────────────────────────────────────── */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text2); font-size: .78rem; line-height: 2;
}
footer a { color: var(--green); }
footer .footer-logo {
  display: flex; align-items: center; justify-content: center;
  gap: .5rem; margin-bottom: .75rem;
}
footer .footer-logo img { width: 28px; height: 28px; border-radius: 6px; }
footer .footer-logo span { font-size: .95rem; font-weight: 700; color: var(--text); }

/* ─── Prose pages (termos, privacidade, cookies) ────────────────────────── */
.prose-wrap {
  max-width: 780px; margin: 0 auto;
  padding: 2rem 0 4rem;
  color: var(--text2); line-height: 1.8;
}
.prose-wrap h2 {
  font-size: 1.1rem; font-weight: 700;
  color: var(--text); margin: 2rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}
.prose-wrap h3 {
  font-size: .95rem; font-weight: 600;
  color: var(--text); margin: 1.5rem 0 .5rem;
}
.prose-wrap p { margin-bottom: .85rem; font-size: .9rem; }
.prose-wrap ul, .prose-wrap ol {
  padding-left: 1.5rem; margin-bottom: .85rem;
}
.prose-wrap li { font-size: .9rem; margin-bottom: .3rem; }
.prose-wrap a { color: var(--green); }
.prose-wrap a:hover { text-decoration: underline; }
.prose-wrap strong { color: var(--text); font-weight: 600; }
.prose-wrap hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* Markdown tables */
.prose-wrap table {
  width: 100%; border-collapse: collapse;
  font-size: .82rem; margin: 1rem 0 1.5rem;
  overflow-x: auto; display: block;
}
.prose-wrap th {
  background: var(--bg3); color: var(--text);
  padding: .6rem .75rem; text-align: left;
  font-weight: 600; border-bottom: 2px solid var(--border);
}
.prose-wrap td {
  padding: .55rem .75rem; border-bottom: 1px solid var(--border);
  color: var(--text2); vertical-align: top;
}
.prose-wrap tr:last-child td { border-bottom: none; }
.prose-wrap tr:hover td { background: rgba(255,255,255,.02); }

/* ─── Product Page ───────────────────────────────────────────────────────── */
.product-page {
  max-width: 1080px; margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
.product-page-inner { width: 100%; }
.product-page .breadcrumb { margin-bottom: 1.25rem; }

.expired-product {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
}
.expired-icon { font-size: 3rem; margin-bottom: 1rem; }
.expired-product h1 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.expired-product p { color: var(--muted); margin-bottom: 0.5rem; }
.expired-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.product-cta.secondary { background: var(--bg3); color: var(--text); }
.product-cta.secondary:hover { background: var(--border); }

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.product-image {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  min-height: 280px;
  overflow: hidden;
}
.product-image img {
  max-width: 100%; max-height: 400px;
  object-fit: contain;
}
.product-image .discount-badge {
  position: absolute; top: .75rem; left: .75rem;
  background: #e53935; color: #fff;
  font-weight: 700; font-size: .85rem;
  padding: .25rem .6rem; border-radius: var(--radius-sm);
  z-index: 2;
}
.product-image .store-badge {
  position: absolute; top: .75rem; right: .75rem;
  font-size: .75rem; font-weight: 600;
  padding: .2rem .5rem; border-radius: var(--radius-sm);
  z-index: 2;
}

.product-info { display: flex; flex-direction: column; gap: .75rem; }
.product-info h1 {
  font-size: 1.35rem; font-weight: 700;
  line-height: 1.35; color: var(--text);
}
.product-rating { font-size: .95rem; color: var(--text2); }
.product-brand { font-size: .9rem; color: var(--text2); }

.product-price-block {
  display: flex; align-items: baseline; gap: .75rem;
  flex-wrap: wrap; margin: .5rem 0;
}
.product-original-price {
  font-size: .9rem; color: var(--text3);
  text-decoration: line-through;
}
.product-price {
  font-size: 1.8rem; font-weight: 800;
  color: var(--green);
}
.product-discount-label {
  background: #e53935; color: #fff;
  font-size: .75rem; font-weight: 700;
  padding: .2rem .5rem; border-radius: var(--radius-sm);
}

.product-coupon {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg3); padding: .6rem .75rem;
  border-radius: var(--radius-sm); width: fit-content;
}
.coupon-label { font-size: .85rem; color: var(--text2); }
.coupon-value {
  font-size: .95rem; font-weight: 700;
  color: var(--orange); background: var(--bg);
  padding: .2rem .5rem; border-radius: 4px;
}

.product-cta {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green); color: #fff;
  font-size: 1.05rem; font-weight: 700;
  padding: .85rem 2rem; border-radius: var(--radius);
  text-decoration: none; margin-top: .5rem;
  transition: background .15s, transform .1s;
  text-align: center;
}
.product-cta:hover { background: #00e65b; transform: translateY(-1px); }

.product-disclaimer {
  font-size: .75rem; color: var(--text3);
  margin-top: .25rem;
}

.related-products {
  margin-top: 2.5rem;
}
.related-products h2 {
  font-size: 1.15rem; font-weight: 700;
  margin-bottom: 1rem; color: var(--text);
}

@media (max-width: 768px) {
  .product-detail {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .product-info h1 { font-size: 1.15rem; }
  .product-price { font-size: 1.5rem; }
}

/* ─── Cookie consent banner ──────────────────────────────────────────────── */
#cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  z-index: 9999;
  box-shadow: 0 -4px 24px rgba(0,0,0,.5);
  animation: slideUp .3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.cookie-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center;
  flex-wrap: wrap; gap: .75rem;
}
.cookie-text {
  flex: 1; min-width: 240px;
  font-size: .82rem; color: var(--text2); line-height: 1.5;
}
.cookie-text a { color: var(--green); }
.cookie-actions {
  display: flex; gap: .5rem; flex-wrap: wrap; flex-shrink: 0;
}
.cookie-btn {
  padding: .5rem 1.1rem; border-radius: 8px;
  font-size: .82rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: background .15s, opacity .15s;
}
.cookie-btn.accept  { background: var(--green-dim); color: #fff; }
.cookie-btn.accept:hover  { background: var(--green); }
.cookie-btn.reject  { background: var(--bg3); color: var(--text2); }
.cookie-btn.reject:hover  { background: var(--border); color: var(--text); }
.cookie-btn.manage  { background: transparent; color: var(--text3); border: 1px solid var(--border); }
.cookie-btn.manage:hover  { color: var(--text); border-color: var(--text2); }

/* ─── Breadcrumb ─────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: .35rem;
  font-size: .8rem; color: var(--text3); margin-bottom: .75rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text2); text-decoration: none; transition: color .15s; }
.breadcrumb a:hover { color: var(--green); }
.breadcrumb-sep { color: var(--text3); }
.breadcrumb span:last-child { color: var(--text); }

/* Footer manage link */
.cookie-manage-link {
  color: var(--text3); font-size: .75rem; cursor: pointer;
  transition: color .15s;
}
.cookie-manage-link:hover { color: var(--green); }

/* ─── 404 ───────────────────────────────────────────────────────────────── */
.error-404 {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh; padding: 2rem 1rem; text-align: center;
}
.error-404-content { max-width: 480px; }
.error-404-code {
  font-size: 6rem; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, var(--green), var(--blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.error-404 h1 { font-size: 1.5rem; margin: .75rem 0 .5rem; color: var(--text); }
.error-404 p { color: var(--text2); margin-bottom: 1.25rem; }
.error-404-btn {
  display: inline-block; padding: .75rem 1.5rem;
  background: var(--green); color: #fff; font-weight: 600;
  border-radius: var(--radius); transition: background .2s;
}
.error-404-btn:hover { background: var(--green-dim); }
.error-404-redirect { font-size: .85rem; color: var(--text3); margin-top: 1rem; }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .hero { padding: 1.75rem 1rem 1.5rem; }
  .hero h1 { font-size: 1.3rem; }
}
@media (max-width: 360px) {
  .grid { grid-template-columns: 1fr; }
}
