/* site.css — Hệ thiết kế ShopContent. Ưu tiên điện thoại, co giãn tới máy tính bảng / máy tính. */
:root {
  --brand: #f4511e; --brand-600: #e64a19; --brand-700: #c63c11; --brand-50: #fff3ee; --brand-100: #ffe1d6;
  --ink: #1f2328; --ink-2: #3b4350; --muted: #5f6b7a; --line: #e6e8eb; --line-2: #d5d9de;
  --bg: #f7f8fa; --card: #ffffff;
  --ok: #15803d; --ok-bg: #ecfdf3; --warn: #b45309; --warn-bg: #fffbeb; --danger: #b91c1c; --danger-bg: #fef2f2;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-lg: 0 10px 30px rgba(16,24,40,.12);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --bottom-nav-h: 64px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--bg);
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 900px) { body { padding-bottom: 0; } }
img, svg { display: block; max-width: 100%; }
a { color: var(--brand-600); text-underline-offset: 2px; }
a:hover { color: var(--brand-700); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; color: var(--ink); }
p { margin: 0 0 1em; }
b, strong { font-weight: 650; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(244,81,30,.45); outline-offset: 2px; border-radius: 6px; }
main:focus { outline: none; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.row-end { text-align: right; margin: -4px 0 16px; font-size: 14px; }

.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; color: #fff; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 760px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }

.ico { width: 20px; height: 20px; flex: none; }
.ico-lg { width: 28px; height: 28px; }
.ico-xl { width: 48px; height: 48px; margin: 0 auto 12px; color: var(--brand); }
.ico-xl.ok { color: var(--ok); }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s; white-space: nowrap;
}
.btn:disabled, .btn[aria-busy="true"] { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(244,81,30,.3); }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: #f3f4f6; color: var(--ink); }
.btn-soft { background: var(--brand-50); color: var(--brand-700); }
.btn-soft:hover { background: var(--brand-100); color: var(--brand-700); }
.btn-light { background: #fff; color: var(--brand-700); }
.btn-light:hover { background: var(--brand-50); color: var(--brand-700); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.btn-sm { min-height: 38px; padding: 8px 12px; font-size: 14px; }
.btn-lg { min-height: 52px; padding: 14px 22px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Form ---------- */
.field { margin-bottom: 16px; }
.label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input:not([type]), select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(244,81,30,.18); }
input[aria-invalid="true"] { border-color: var(--danger); }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; min-width: 0; }
.pw-toggle { min-width: 48px; padding: 0 12px; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.field-error { color: var(--danger); font-size: 14px; margin: 6px 0 0; min-height: 0; }
.field-error:empty { display: none; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; margin: 4px 0 18px; cursor: pointer; min-height: 44px; padding: 4px 0; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Thẻ, cảnh báo, huy hiệu ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); background: #f3f4f6; font-size: 14px; margin-bottom: 16px; border: 1px solid var(--line); }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: #bbf7d0; }
.alert-warn { background: var(--warn-bg); color: #7c2d12; border-color: #fde68a; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; vertical-align: middle; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-muted { background: #f1f3f5; color: var(--muted); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.96); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.logo:hover { color: var(--ink); }
.logo-mark { width: 32px; height: 32px; }
.main-nav { display: none; gap: 4px; margin-left: 12px; }
.main-nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.main-nav a:hover { background: #f3f4f6; }
.main-nav a[aria-current="page"] { color: var(--brand-700); background: var(--brand-50); }
.header-auth { margin-left: auto; display: flex; gap: 8px; align-items: center; }
@media (min-width: 900px) { .main-nav { display: flex; } }
@media (max-width: 380px) { .header-auth .btn-ghost { display: none; } }

/* ---------- Hero + ô dán link ---------- */
.hero { background: linear-gradient(135deg, #fff5f0 0%, #ffe8dd 55%, #ffd9c9 100%); padding: 28px 0 36px; }
.hero-inner { display: grid; gap: 24px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--brand-700); font-weight: 600; font-size: 13px; padding: 6px 12px; border-radius: 999px; margin-bottom: 14px; box-shadow: var(--shadow); }
.eyebrow .ico { width: 16px; height: 16px; }
.hero h1 { font-size: clamp(28px, 6vw, 46px); letter-spacing: -.02em; margin-bottom: 14px; }
.hl { color: var(--brand); }
.lead { font-size: clamp(16px, 2.4vw, 19px); color: var(--ink-2); max-width: 560px; }
.check-card { padding: 20px; }
.check-form .btn-lg { margin-top: 16px; }
.trust { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; color: var(--ink-2); }
.trust li { display: inline-flex; align-items: center; gap: 6px; }
.trust .ico { width: 18px; height: 18px; color: var(--ok); }
@media (min-width: 900px) {
  .hero { padding: 56px 0 64px; }
  .hero-inner { grid-template-columns: 1.05fr .95fr; align-items: center; gap: 48px; }
  .check-card { padding: 28px; }
}

/* Kết quả kiểm tra link */
.result { margin-top: 18px; border-top: 1px dashed var(--line-2); padding-top: 18px; }
.product-name { font-weight: 600; margin-bottom: 12px; overflow-wrap: anywhere; }
.cashback-box { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: var(--radius-sm); padding: 14px; text-align: center; margin-bottom: 14px; }
.cashback-box .amount { display: block; font-size: 30px; font-weight: 800; color: var(--brand-700); line-height: 1.2; margin: 4px 0; }
.cashback-box small { color: var(--muted); }
.result .btn { margin-top: 8px; }
.tips { font-size: 14px; color: var(--ink-2); background: #fafafa; border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 14px; }
.tips ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Khối nội dung ---------- */
.section { padding: 48px 0; }
.section-tight { padding: 28px 0 48px; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { font-size: clamp(24px, 4vw, 32px); text-align: center; margin-bottom: 28px; letter-spacing: -.01em; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.steps li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.steps h3 { font-size: 18px; margin: 12px 0 6px; }
.steps p { color: var(--muted); margin: 0; font-size: 15px; }
.step-n { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; }
.features { display: grid; gap: 16px; }
.feature { padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); }
.feature .ico { color: var(--brand); margin-bottom: 10px; }
.feature h3 { font-size: 18px; margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; font-size: 15px; }
@media (min-width: 640px) { .steps, .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .steps, .features { grid-template-columns: repeat(4, 1fr); } }

.faq { display: grid; gap: 10px; margin-bottom: 20px; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 16px; }
.faq-item summary { cursor: pointer; font-weight: 600; padding: 14px 28px 14px 0; list-style: none; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 0; top: 10px; font-size: 22px; color: var(--brand); font-weight: 400; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { color: var(--ink-2); margin: 0 0 14px; }

.cta-band { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-700) 100%); color: #fff; padding: 44px 0; text-align: center; }
.cta-band h2 { color: #fff; font-size: clamp(22px, 4vw, 30px); }
.cta-band p { opacity: .92; }

.page-hero { background: linear-gradient(135deg, #fff5f0, #ffe8dd); padding: 32px 0 24px; }
.page-hero h1 { font-size: clamp(26px, 5vw, 38px); }
.prose h2 { font-size: 21px; margin-top: 1.6em; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.callout { background: var(--brand-50); border-left: 4px solid var(--brand); border-radius: var(--radius-sm); padding: 14px 16px; margin: 16px 0; }
.callout ul { margin: 8px 0 0; }
.contact-card { display: flex; gap: 16px; align-items: center; padding: 20px; margin-bottom: 20px; }
.contact-card .ico { color: var(--brand); }
.contact-card h2 { margin: 0 0 4px; font-size: 17px; }
.big-text { font-size: 22px; font-weight: 700; margin: 0; }
.big-404 { font-size: 72px; font-weight: 800; color: var(--brand); margin: 0; line-height: 1; }

/* ---------- Đăng nhập / đăng ký ---------- */
.auth-wrap { padding: 28px 16px 48px; display: flex; justify-content: center; }
.auth-card { width: 100%; max-width: 440px; padding: 24px; }
@media (min-width: 640px) { .auth-wrap { padding: 56px 16px 72px; } .auth-card { padding: 32px; } }
.auth-title { font-size: 26px; margin-bottom: 6px; }
.auth-sub { color: var(--muted); margin-bottom: 20px; }
.done { text-align: center; }
.done h2 { font-size: 20px; }
.done .btn { margin-top: 10px; }

/* ---------- Trang tài khoản ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; margin: 0; }
.page-head p { margin: 2px 0 0; }
/* Ví: điện thoại → "Khả dụng" to ở trên, 2 ô còn lại nằm cạnh nhau; máy tính → 3 cột */
.stats { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.stat-ok { grid-column: 1 / -1; order: -1; background: linear-gradient(135deg, #f0fdf4, #fff); border-color: #bbf7d0; }
.stat-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.stat-label .ico { width: 16px; height: 16px; }
.stat b { display: block; font-size: 19px; font-weight: 800; margin: 4px 0 0; overflow-wrap: anywhere; }
.stat-ok b { font-size: 28px; color: var(--ok); }
.stat small { display: none; color: var(--muted); font-size: 13px; }
.stat-ok small { display: block; }
@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .stat { padding: 16px; }
  .stat-ok { grid-column: auto; order: 0; }
  .stat b, .stat-ok b { font-size: 26px; margin: 6px 0 2px; }
  .stat small { display: block; }
}
/* Tab: điện thoại → 4 ô chia đều, luôn thấy đủ; máy tính → dạng viên thuốc */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.tabs [role=tab] { min-height: 44px; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; font: inherit; font-weight: 600; font-size: 13px; line-height: 1.2; color: var(--ink-2); cursor: pointer; }
.tabs [role=tab][aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (min-width: 640px) {
  .tabs { display: flex; gap: 8px; }
  .tabs [role=tab] { padding: 10px 18px; border-radius: 999px; font-size: 15px; }
}
.panel { padding: 20px; }
.panel-title { font-size: 19px; }
.sub-title { font-size: 16px; margin: 24px 0 10px; }
.kv { display: grid; grid-template-columns: 1fr; gap: 2px 16px; font-size: 15px; }
.kv > div:nth-child(odd) { color: var(--muted); font-size: 13px; margin-top: 8px; }
@media (min-width: 640px) { .kv { grid-template-columns: 160px 1fr; } .kv > div:nth-child(odd) { margin-top: 0; font-size: 15px; } }
.list { display: grid; gap: 10px; }
.list-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.list-item .li-title { font-weight: 600; overflow-wrap: anywhere; }
.list-item .li-meta { font-size: 13px; color: var(--muted); }
.list-item .li-amount { font-weight: 700; text-align: right; white-space: nowrap; }
.list-item .li-amount.neg { color: var(--ink-2); }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; }

/* ---------- Footer ---------- */
.site-footer { background: #111827; color: #cbd5e1; padding: 40px 0 20px; margin-top: 0; }
.site-footer a { color: #e5e7eb; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; }
.footer-brand { grid-column: 1 / -1; }
.footer-brand p { font-size: 14px; max-width: 420px; }
.footer-note { color: #94a3b8; font-size: 13px !important; }
.logo-light, .logo-light:hover { color: #fff; }
.footer-h { color: #fff; font-size: 15px; margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; font-size: 14px; display: grid; gap: 8px; }
.footer-bottom { border-top: 1px solid #1f2937; margin-top: 28px; padding-top: 16px; font-size: 13px; color: #94a3b8; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } .footer-brand { grid-column: auto; } }

/* ---------- Thanh điều hướng dưới (điện thoại) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(16,24,40,.06);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none; }
.bottom-nav a[aria-current="page"] { color: var(--brand); }
.bottom-nav .ico { width: 22px; height: 22px; }
@media (min-width: 900px) { .bottom-nav { display: none; } }

/* ---------- Thông báo nổi ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 15px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
