:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --primary: #0f766e;
  --primary-hover: #0d5e57;
  --wa: #16a34a;
  --wa-hover: #15803d;
  --coupon-bg: #fef9c3;
  --coupon-border: #eab308;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.4; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.container { max-width: 1240px; margin: 0 auto; padding: 0 14px; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand-block { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { width: 52px; height: 52px; border-radius: 999px; object-fit: cover; border: 2px solid var(--primary); background: #e2e8f0; flex-shrink: 0; }
.site-title { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--text); }
.site-tagline { margin: 2px 0 0; font-size: 0.85rem; color: var(--muted); }
.wa-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border-radius: 999px; background: var(--wa); color: #ffffff; font-weight: 700; font-size: 0.92rem; text-decoration: none; white-space: nowrap; box-shadow: 0 2px 6px rgba(22, 163, 74, 0.28); }
.wa-cta:hover { background: var(--wa-hover); }

.filters-bar { position: sticky; top: 0; z-index: 20; background: rgba(246, 247, 251, 0.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); padding: 10px 0; }
.filters-inner { display: flex; flex-direction: column; gap: 10px; }
.filters-top { display: flex; flex-direction: column; gap: 10px; }
.search-wrap { width: 100%; }
.search-wrap input { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 0.96rem; }
.store-pills, .category-pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.store-pills::-webkit-scrollbar, .category-pills::-webkit-scrollbar { display: none; }
.pill { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 0.86rem; white-space: nowrap; cursor: pointer; }
.pill.active { background: var(--primary); border-color: var(--primary); color: #ffffff; }
.cat-pill { min-height: 34px; padding: 5px 12px; font-size: 0.8rem; }
.cat-pill.active { background: #0f172a; border-color: #0f172a; color: #ffffff; }
.cat-tag { display: inline-block; padding: 2px 7px; border-radius: 999px; font-size: 0.68rem; font-weight: 600; background: #f1f5f9; color: var(--muted); }
.sort-pill.active { background: #ea580c; border-color: #ea580c; color: #ffffff; }
.trend-badge { position: absolute; top: 8px; left: 8px; padding: 3px 9px; border-radius: 999px; background: #ea580c; color: #ffffff; font-size: 0.72rem; font-weight: 800; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16); }

.main-content { padding-top: 14px; padding-bottom: 40px; }
.live-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #ecfdf5; border: 1px solid #10b981; color: #065f46; padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; font-weight: 600; font-size: 0.9rem; }
.live-apply-btn { min-height: 36px; padding: 6px 12px; border: 0; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; }
.results-summary { margin: 0 0 12px; font-size: 0.86rem; color: var(--muted); }

.offers-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.offer-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.card-media { position: relative; aspect-ratio: 1 / 1; background: #f1f5f9; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 8px; }
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 0.75rem; color: var(--muted); }
.store-badge { padding: 2px 8px; border-radius: 999px; font-weight: 700; text-transform: uppercase; font-size: 0.68rem; background: #e2e8f0; color: #1e293b; }
.store-badge[data-store="amazon"] { background: #fef3c7; color: #92400e; }
.store-badge[data-store="mercadolivre"] { background: #fef9c3; color: #854d0e; }
.store-badge[data-store="shopee"] { background: #ffedd5; color: #9a3412; }
.store-badge[data-store="magalu"] { background: #dbeafe; color: #1e40af; }
.offer-title { margin: 0; font-size: 0.94rem; font-weight: 700; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.offer-copy { margin: 0; font-size: 0.82rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.offer-price { margin: 0; font-size: 1.25rem; font-weight: 800; color: var(--primary); }

.coupon-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--coupon-bg); border: 1px dashed var(--coupon-border); border-radius: 8px; padding: 6px 10px; }
.coupon-code { font-weight: 800; font-size: 0.82rem; color: #854d0e; overflow: hidden; text-overflow: ellipsis; }
.coupon-btn { min-height: 32px; padding: 4px 10px; border: 0; border-radius: 6px; background: #ca8a04; color: #fff; font-weight: 700; font-size: 0.78rem; cursor: pointer; flex-shrink: 0; }
.coupon-btn.copied { background: var(--wa); }

.offer-cta { margin-top: auto; display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 12px; border-radius: 10px; background: var(--primary); color: #ffffff; text-decoration: none; font-weight: 700; font-size: 0.94rem; text-align: center; }
.offer-cta:hover { background: var(--primary-hover); }

.empty-state { text-align: center; padding: 40px 16px; color: var(--muted); }
.load-more-wrap { display: flex; justify-content: center; margin-top: 20px; }
.load-more-btn { min-height: 46px; padding: 10px 24px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 700; cursor: pointer; }
.admin-login-card { max-width: 400px; margin: 48px auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.admin-login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.admin-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; font-weight: 600; color: var(--muted); }
.admin-field input { min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 0.95rem; color: var(--text); background: var(--surface); }
.admin-error { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: #fee2e2; color: #b91c1c; font-size: 0.86rem; font-weight: 600; }

@media (max-width: 390px) {
  .offers-grid { grid-template-columns: 1fr; }
  .wa-cta { width: 100%; }
}
@media (min-width: 720px) {
  .filters-top { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .search-wrap { flex: 1 1 280px; max-width: 420px; }
  .store-pills, .category-pills { flex-wrap: wrap; overflow-x: visible; }
  .offers-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}
@media (min-width: 1060px) {
  .offers-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
