/* Design system — theo UI UX Pro Max (E-commerce: Vibrant & Block-based, cam đỏ mua sắm + vàng CTA,
   xanh lá cho tiền hoàn, font Vietnamese Friendly) và Vercel Web Interface Guidelines. */

:root {
  color-scheme: light;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;

  --bg: #f7f4f2;
  --surface: #ffffff;
  --surface-2: #f4eee9;
  --surface-3: #eae1da;
  --text: #1d1410;
  --text-2: #3e322b;
  --muted: #6a5d56;
  --border: #e8ded7;
  --border-strong: #d5c7be;

  --primary: #d63d17;
  --primary-hover: #b5330f;
  --primary-soft: #ffede5;
  --primary-ink: #a9300c;
  --on-primary: #ffffff;
  --accent: #ffb020;
  --accent-hover: #f59e0b;
  --accent-soft: #fff4dc;
  --accent-ink: #8a4b00;
  --on-accent: #3a1c00;

  --success: #047857;
  --success-soft: #e1f5ec;
  --warning: #a16207;
  --warning-soft: #fdf3c4;
  --danger: #b91c1c;
  --danger-soft: #fde8e8;
  --info: #1d4ed8;
  --info-soft: #e3ebff;

  --hero: radial-gradient(120% 140% at 0% 0%, #f0582a 0%, #e2401f 45%, #b3172f 100%);
  --hero-ink: #ffffff;

  --ring: 0 0 0 3px rgb(214 61 23 / 0.26);
  --shadow-sm: 0 1px 2px rgb(40 20 10 / 0.06);
  --shadow-md: 0 1px 2px rgb(40 20 10 / 0.05), 0 8px 20px -6px rgb(40 20 10 / 0.12);
  --shadow-lg: 0 2px 4px rgb(40 20 10 / 0.05), 0 22px 48px -14px rgb(40 20 10 / 0.28);

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --sidebar-w: 252px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #120d0b; --surface: #1a1411; --surface-2: #221a16; --surface-3: #2c221d;
    --text: #f3ebe6; --text-2: #d6c8bf; --muted: #a8978d; --border: #33271f; --border-strong: #45362c;
    --primary: #ff8a5c; --primary-hover: #ffab8a; --primary-soft: #3a1a0e; --primary-ink: #ffab8a; --on-primary: #2a0d02;
    --accent: #fbbf24; --accent-hover: #fcd34d; --accent-soft: #2e2207; --accent-ink: #fcd34d; --on-accent: #2a1a00;
    --success: #6ee7b7; --success-soft: #0f2a20; --warning: #fcd34d; --warning-soft: #2a2209;
    --danger: #fca5a5; --danger-soft: #2e1515; --info: #a5c4ff; --info-soft: #14213b;
    --hero: radial-gradient(120% 140% at 0% 0%, #d9481f 0%, #a8301a 50%, #5c1420 100%);
    --ring: 0 0 0 3px rgb(255 138 92 / 0.3);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 20px -6px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.4), 0 22px 48px -14px rgb(0 0 0 / 0.7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #120d0b; --surface: #1a1411; --surface-2: #221a16; --surface-3: #2c221d;
  --text: #f3ebe6; --text-2: #d6c8bf; --muted: #a8978d; --border: #33271f; --border-strong: #45362c;
  --primary: #ff8a5c; --primary-hover: #ffab8a; --primary-soft: #3a1a0e; --primary-ink: #ffab8a; --on-primary: #2a0d02;
  --accent: #fbbf24; --accent-hover: #fcd34d; --accent-soft: #2e2207; --accent-ink: #fcd34d; --on-accent: #2a1a00;
  --success: #6ee7b7; --success-soft: #0f2a20; --warning: #fcd34d; --warning-soft: #2a2209;
  --danger: #fca5a5; --danger-soft: #2e1515; --info: #a5c4ff; --info-soft: #14213b;
  --hero: radial-gradient(120% 140% at 0% 0%, #d9481f 0%, #a8301a 50%, #5c1420 100%);
  --ring: 0 0 0 3px rgb(255 138 92 / 0.3);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 20px -6px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.4), 0 22px 48px -14px rgb(0 0 0 / 0.7);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.015em; font-weight: 700; text-wrap: balance; }
p { margin: 0; }
a { color: var(--primary-ink); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
::selection { background: var(--primary-soft); color: var(--primary-ink); }

.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.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; }
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 100; padding: 10px 14px; border-radius: var(--r-sm); background: var(--text); color: var(--surface); font-weight: 600; }
.skip-link:focus { top: 12px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 24px; }
.stack > *, .stack-lg > * { min-width: 0; }  /* con của grid không được nở theo nội dung (vd hàng tab cuộn ngang) */
.row-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-accent { color: var(--accent-ink); }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid transparent;
  font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap; user-select: none; text-decoration: none !important;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--muted); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { border-color: currentColor; }
.btn-light { background: #fff; color: #a9300c; }
.btn-light:hover { background: #ecfdf5; }
.btn-lg { height: 50px; padding: 0 22px; font-size: 15px; border-radius: var(--r); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-icon { width: 40px; padding: 0; }
.btn-sm.btn-icon { width: 34px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.btn[aria-busy="true"] .icon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.label { font-weight: 600; font-size: 14px; }
.hint { font-size: 13px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 15px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .8; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { display: flex; gap: 6px; align-items: center; color: var(--danger); font-size: 13px; font-weight: 500; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 48px; }
.input-wrap .btn-icon { position: absolute; right: 2px; top: 2px; height: 40px; width: 40px; }
.form-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.checkbox { display: flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px; }
@media (min-width: 768px) { .card-pad { padding: 24px; } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
@media (min-width: 768px) { .card-head { padding: 16px 24px; } }
.card-title { font-size: 16px; font-weight: 700; }
.lift { transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease); }
.lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); font-size: 14px; background: var(--info-soft); color: var(--text); }
.alert > .icon { color: var(--info); margin-top: 1px; }
.alert-warning { background: var(--warning-soft); } .alert-warning > .icon { color: var(--warning); }
.alert-danger { background: var(--danger-soft); } .alert-danger > .icon { color: var(--danger); }
.alert-success { background: var(--success-soft); } .alert-success > .icon { color: var(--success); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2);
}
.badge .icon { width: 14px; height: 14px; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- stats ---------- */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.stat { display: grid; gap: 6px; align-content: start; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.stat-label { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 500; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-foot { font-size: 13px; color: var(--muted); }
.stat-hero { background: var(--hero); color: var(--hero-ink); border-color: transparent; box-shadow: var(--shadow-md); }
.stat-hero .stat-label, .stat-hero .stat-foot { color: rgb(255 255 255 / 0.82); }
.stat-hero .stat-foot a { color: #fff; text-decoration: underline; }

/* ---------- app shell ---------- */
.shell { min-height: 100dvh; }
@media (min-width: 1024px) { .shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); } }
.sidebar-col { display: none; }
@media (min-width: 1024px) {
  .sidebar-col { display: block; background: var(--surface); border-right: 1px solid var(--border); }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; padding: 20px 14px; overflow-y: auto; }
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: var(--text); text-decoration: none !important; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--hero); color: #fff; box-shadow: var(--shadow-md); }
.brand-mark .icon { width: 19px; height: 19px; }
.sidebar .brand { padding: 0 8px; }
.nav { display: grid; gap: 2px; margin-top: 22px; }
.nav-label { padding: 18px 12px 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.nav a { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 14px; text-decoration: none; transition: background-color .15s var(--ease), color .15s var(--ease); }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.nav .nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent); color: var(--on-accent); }
.sidebar-foot { margin-top: auto; padding-top: 16px; display: grid; gap: 10px; }
.rate-pill { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
@media (min-width: 768px) { .topbar { padding: 0 28px; } }
@media (min-width: 1024px) { .topbar { padding: 0 40px; } .topbar .brand { display: none; } }
.content { width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px 16px 112px; }
@media (min-width: 768px) { .content { padding: 28px 28px 64px; } }
@media (min-width: 1024px) { .content { padding: 32px 40px 64px; } }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.page-title { font-size: 24px; }
@media (min-width: 768px) { .page-title { font-size: 28px; } }
.page-sub { color: var(--muted); margin-top: 4px; }

.bottom-nav {
  position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 1024px) { .bottom-nav { display: none; } }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 62px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.bottom-nav a[aria-current="page"] { color: var(--primary-ink); }
.bottom-nav a[aria-current="page"] .icon { stroke-width: 2.4; }

/* dropdown dùng <details> */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; border-radius: 999px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); z-index: 40; }
.menu-panel a, .menu-panel button { display: flex; width: 100%; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: none; font-size: 14px; color: var(--text); cursor: pointer; text-decoration: none; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); }
.menu-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; overflow: hidden; background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; font-size: 14px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- converter ---------- */
.hero-card { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 22px; background: var(--hero); color: var(--hero-ink); box-shadow: var(--shadow-md); }
@media (min-width: 768px) { .hero-card { padding: 30px 32px; } }
.hero-card::after { content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(closest-side, rgb(255 255 255 / .16), transparent); pointer-events: none; }
.hero-card h1, .hero-card h2 { color: #fff; }
.hero-card .lead { color: rgb(255 255 255 / .86); margin-top: 6px; }
.paste { position: relative; z-index: 1; display: grid; gap: 10px; margin-top: 18px; }
@media (min-width: 640px) { .paste { grid-template-columns: 1fr auto; } }
.paste .textarea { min-height: 56px; height: 56px; padding: 15px 16px; font-size: 16px; border: 0; color: #1d1410; background: #fff; resize: none; overflow: hidden; box-shadow: 0 8px 24px -10px rgb(0 0 0 / .35); }
.paste .textarea::placeholder { color: #6a5d56; }
.paste .textarea:focus { box-shadow: 0 0 0 3px rgb(255 255 255 / .55); }
.paste .btn { height: 56px; }
.paste-tools { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 12px; font-size: 13px; color: rgb(255 255 255 / .85); }
.paste-tools .btn-ghost { color: #fff; height: 32px; padding: 0 10px; background: rgb(255 255 255 / .12); }
.paste-tools .btn-ghost:hover { background: rgb(255 255 255 / .22); }
.chip-rate { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: rgb(255 255 255 / .16); color: #fff; font-weight: 600; font-size: 13px; }

.result { display: grid; gap: 14px; padding: 18px; }
@media (min-width: 768px) { .result { padding: 22px 24px; } }
.result + .result { border-top: 1px solid var(--border); }
.result-top { display: flex; gap: 12px; align-items: flex-start; }
.result-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary-ink); }
.result-icon.is-error { background: var(--danger-soft); color: var(--danger); }
.product-row { display: flex; gap: 12px; align-items: flex-start; }
.thumb.is-loading { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.price-now { font-weight: 700; color: var(--primary-ink); }
.price-old { text-decoration: line-through; }
.cashback-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding: 14px 16px; border-radius: var(--r); background: var(--success-soft); }
.cashback-label { display: block; font-size: 12px; font-weight: 700; color: var(--success); text-transform: uppercase; letter-spacing: .05em; }
.cashback-value { display: block; font-size: 26px; line-height: 1.2; font-weight: 800; color: var(--success); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.cashback-detail { flex: 1 1 260px; font-size: 13px; color: var(--text-2); }
/* Script Google Programmable Search khoá cuộn trang (body.gsc-overflow-hidden) khi hiện kết quả dạng nổi;
   mình tự vẽ kết quả nên mở khoá lại */
body.gsc-overflow-hidden { overflow: visible !important; }

/* trang Tìm: thanh tìm gọn 1 dòng, dính trên đầu khi cuộn */
.search-sticky { position: sticky; top: 60px; z-index: 15; margin: -10px -16px -8px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
@media (min-width: 768px) { .search-sticky { margin: -14px -28px -8px; padding: 12px 28px; } }
@media (min-width: 1024px) { .search-sticky { margin: -18px -40px -8px; padding: 14px 40px; } }
.paste.omni-compact { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 0; }
.paste.omni-compact .textarea { height: 48px; min-height: 48px; padding: 12px 14px 12px 44px; font-size: 16px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); box-shadow: none; }
.paste.omni-compact .textarea::placeholder { color: var(--muted); }
.paste.omni-compact .textarea:focus { border-color: var(--primary); box-shadow: var(--ring); }
.paste.omni-compact .omni-icon { left: 14px; top: 14px; color: var(--primary-ink); }
.paste.omni-compact .btn { height: 48px; padding: 0 16px; }

/* ô dùng chung: dán link hoặc tìm */
.omni-field { position: relative; min-width: 0; }
.omni-field .textarea { padding-left: 48px; }
.omni-icon { position: absolute; left: 16px; top: 18px; z-index: 1; color: #d63d17; pointer-events: none; }
.omni-hints { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.omni-hint { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgb(255 255 255 / .14); color: rgb(255 255 255 / .92); font-size: 13px; transition: background-color .15s var(--ease), color .15s var(--ease), opacity .15s var(--ease); }
.omni-hint strong { font-weight: 700; }
.omni-hint.is-active { background: #fff; color: #a9300c; }
.omni-hint.is-dim { opacity: .5; }
.hero-compact { padding: 18px; }
@media (min-width: 768px) { .hero-compact { padding: 22px 26px; } }
.hero-compact .paste { margin-top: 0; }

/* kết quả tìm kiếm */
.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.results-head .tabs { max-width: 100%; }
.results-title { font-size: 17px; min-width: 0; overflow-wrap: anywhere; }
.pcard { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease); }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.pcard-media { position: relative; display: block; }
.pcard-img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--surface-2); }
.pcard-badges { position: absolute; left: 8px; top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.pbadge { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 700; color: #fff; }
.pbadge-mall { background: #d0011b; }
.pbadge-flash { background: #ea580c; }
.pbadge-off { background: #fde68a; color: #92400e; }
.pcard-body { display: grid; gap: 4px; padding: 10px 12px 12px; align-content: start; flex: 1; }
.pcard-name { font-size: 13.5px; font-weight: 600; line-height: 1.35; min-height: 2.7em; color: var(--text); text-decoration: none !important; }
.pcard-name:hover { color: var(--primary-ink); }
.pcard-price { font-size: 16px; font-weight: 700; color: var(--primary-ink); font-variant-numeric: tabular-nums; }
.pcard-price .price-old { font-size: 12px; font-weight: 500; color: var(--muted); }
.pcard-cashback { justify-self: start; display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; padding: 3px 8px; border-radius: 6px; background: var(--success-soft); font-size: 13px; font-weight: 700; color: var(--success); font-variant-numeric: tabular-nums; }
.pcard-cashback b { white-space: nowrap; }
.pcard-cashback span { font-size: 11.5px; font-weight: 600; opacity: .8; }
.pcard-cashback.is-unknown { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.pcard-meta, .pcard-shop { font-size: 12.5px; color: var(--muted); }
.pcard-voucher { justify-self: start; margin-top: 2px; }
.pcard.is-loading .pcard-img, .pcard.is-loading .pcard-name, .pcard.is-loading .pcard-price { background: var(--surface-2); border-radius: 6px; animation: pulse 1.2s ease-in-out infinite; }
.pcard.is-loading:hover { transform: none; }

/* trang chi tiết sản phẩm */
.back-link { justify-self: start; margin-bottom: -8px; }
.product-layout { display: grid; gap: 16px; }
@media (min-width: 900px) { .product-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; } }
.gallery { padding: 12px; display: grid; gap: 10px; }
@media (min-width: 900px) { .gallery { position: sticky; top: 76px; } }
.gallery-main { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.gallery-thumb { flex: none; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: none; cursor: pointer; }
.gallery-thumb[aria-current="true"] { border-color: var(--accent); }
.gallery-thumb img { width: 60px; height: 60px; object-fit: cover; display: block; }
.product-name { font-size: 20px; line-height: 1.35; }
.product-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.product-price .price-now { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.product-price .price-old { color: var(--muted); }
.rating-summary { display: grid; gap: 16px; align-items: center; }
@media (min-width: 520px) { .rating-summary { grid-template-columns: auto minmax(0, 1fr); } }
.rating-score { display: grid; justify-items: start; gap: 2px; }
.rating-big { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.stars { display: inline-flex; gap: 2px; color: var(--border-strong); }
.stars .icon { fill: currentColor; stroke: none; }
.stars .is-on { color: #f59e0b; }
.rating-bars { display: grid; gap: 6px; }
.rating-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 56px; align-items: center; gap: 8px; }
.rating-row .num { text-align: right; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: #f59e0b; }

.result { min-width: 0; }
.similar { min-width: 0; display: grid; gap: 10px; padding-top: 14px; border-top: 1px dashed var(--border); }
.similar-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--success); }
.similar-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(158px, 46%); gap: 10px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding-bottom: 6px; }
@media (min-width: 900px) { .similar-list { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; } }
.sim-card { scroll-snap-align: start; display: grid; gap: 5px; align-content: start; padding: 10px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.sim-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.sim-card .btn { margin-top: 4px; }
.sim-card .badge { justify-self: start; }
.sim-img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.sim-name { font-size: 13px; font-weight: 600; line-height: 1.35; min-height: 2.7em; }
.sim-price { font-weight: 700; font-size: 14px; color: var(--primary-ink); font-variant-numeric: tabular-nums; }
.sim-cashback { font-weight: 700; font-size: 13px; color: var(--success); font-variant-numeric: tabular-nums; }
.search-bar { position: relative; display: flex; gap: 8px; }
.search-bar .input { height: 50px; padding-left: 46px; font-size: 16px; }
.search-bar .btn { height: 50px; padding: 0 22px; }
.search-icon { position: absolute; left: 15px; top: 15px; color: var(--muted); pointer-events: none; }
.product-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1100px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pcard-media { display: block; }
.sim-card.is-loading .sim-img, .sim-card.is-loading .sim-name { background: var(--surface-2); border-radius: 8px; animation: pulse 1.2s ease-in-out infinite; }
.sim-cashback.is-unknown { color: var(--muted); font-weight: 600; }
.section-title h2 { display: inline-flex; align-items: center; gap: 8px; }
.link-box { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px dashed var(--border-strong); font: 600 16px/1.4 var(--mono); color: var(--text); word-break: break-all; }
.result-actions { display: grid; gap: 8px; }
@media (min-width: 640px) { .result-actions { grid-template-columns: auto auto 1fr; } }

/* ---------- lists ---------- */
.list > * + * { border-top: 1px solid var(--border); }
.item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; }
@media (min-width: 768px) { .item { padding: 16px 24px; } }
a.item { color: inherit; text-decoration: none; transition: background-color .15s var(--ease); }
a.item:hover { background: var(--surface-2); }
.item-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.item-title { font-weight: 600; font-size: 14.5px; }
.item-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.item-side { display: grid; justify-items: end; gap: 6px; text-align: right; flex: none; }
.thumb { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); }
.thumb-sm { width: 44px; height: 44px; border-radius: 8px; }
.amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.amount-lg { font-size: 17px; }

.order { padding: 16px 18px; display: grid; gap: 12px; }
@media (min-width: 768px) { .order { padding: 18px 24px; } }
.order-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: var(--muted); }
.order-products { display: grid; gap: 10px; }
.order-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--border); }
.cashback-tag { display: inline-flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--muted); }
.cashback-tag .amount { font-size: 17px; color: var(--success); }
.cashback-tag.is-cancelled .amount { color: var(--muted); text-decoration: line-through; }

/* ---------- tabs / pagination ---------- */
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 13.5px; white-space: nowrap; text-decoration: none !important; transition: background-color .15s var(--ease), border-color .15s var(--ease); }
.tab:hover { border-color: var(--border-strong); background: var(--surface-2); }
.tab[aria-current="page"] { background: var(--text); color: var(--surface); border-color: var(--text); }
.tab .count { font-variant-numeric: tabular-nums; opacity: .7; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 10px 16px; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
.table .num, .table .td-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }

/* ---------- empty / misc ---------- */
.empty { display: grid; justify-items: center; gap: 8px; padding: 44px 20px; text-align: center; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); margin-bottom: 4px; }
.empty-title { color: var(--text); font-weight: 700; font-size: 16px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.steps { display: grid; gap: 12px; counter-reset: step; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; font-size: 14px; }
.faq details { border-top: 1px solid var(--border); }
.faq details:first-child { border-top: 0; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; cursor: pointer; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { transition: transform .2s var(--ease); color: var(--muted); }
.faq details[open] summary .icon { transform: rotate(90deg); }
.faq .faq-a { padding: 0 0 16px; color: var(--text-2); }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 12px; }
.section-title h2 { font-size: 18px; }

/* ---------- toast ---------- */
.toast-region { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 1024px) { .toast-region { bottom: 24px; } }
.toast { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; animation: toast-in .2s var(--ease); pointer-events: auto; }
.toast.is-error .icon { color: #fca5a5; }
.toast.is-success .icon { color: #6ee7b7; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- public site ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.site-header-in, .wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .site-header-in, .wrap { padding: 0 28px; } }
.site-header-in { display: flex; align-items: center; gap: 12px; height: 64px; }
.landing-hero { padding: 28px 0 8px; }
@media (min-width: 768px) { .landing-hero { padding: 48px 0 16px; } }
.landing-hero .hero-card { padding: 28px 22px 26px; }
@media (min-width: 768px) { .landing-hero .hero-card { padding: 56px 56px 48px; } }
.display { font-size: clamp(30px, 6vw, 52px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 800; max-width: 15ch; }
.display em { font-style: normal; color: #fff; background: linear-gradient(transparent 64%, rgb(255 176 32 / 0.7) 64%); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hero-lead { font-size: clamp(15px, 2.2vw, 18px); color: rgb(255 255 255 / .88); margin-top: 14px; max-width: 54ch; }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; font-size: 14px; color: rgb(255 255 255 / .9); }
.hero-points span { display: inline-flex; gap: 8px; align-items: center; }
.section { padding: 40px 0; }
@media (min-width: 768px) { .section { padding: 64px 0; } }
.section-head { max-width: 620px; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(22px, 3.4vw, 32px); }
.section-head p { color: var(--muted); margin-top: 8px; }
.feature-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.feature { padding: 22px; display: grid; gap: 10px; align-content: start; }
.feature-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); }
.feature-icon.is-accent { background: var(--accent-soft); color: var(--accent-ink); }
.feature h3 { font-size: 17px; }
.feature p { color: var(--muted); font-size: 14.5px; }
.cta-band { display: grid; gap: 16px; align-items: center; padding: 28px 24px; border-radius: var(--r-xl); background: var(--text); color: var(--surface); }
@media (min-width: 768px) { .cta-band { grid-template-columns: 1fr auto; padding: 40px 48px; } }
.cta-band h2 { font-size: clamp(20px, 3vw, 28px); }
.cta-band p { opacity: .75; margin-top: 6px; }
.site-footer { padding: 28px 0 40px; color: var(--muted); font-size: 13px; }
.site-footer a, .legal-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.legal-note { text-align: center; margin-top: -8px; }
.legal { max-width: 760px; padding-top: 28px; padding-bottom: 8px; display: grid; gap: 14px; line-height: 1.7; }
.legal h1 { font-size: clamp(26px, 4vw, 34px); margin-top: 8px; }
.legal h2 { font-size: 19px; margin-top: 14px; }
.legal ul, .legal ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.legal a { overflow-wrap: anywhere; }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; }
@media (min-width: 960px) { .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.auth-aside { display: none; }
@media (min-width: 960px) {
  .auth-aside { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 40px 48px; background: var(--hero); color: #fff; }
  .auth-aside .brand { color: #fff; }
  .auth-aside .brand-mark { background: rgb(255 255 255 / .16); box-shadow: none; }
}
.auth-quote { font-size: 30px; font-weight: 800; line-height: 1.15; letter-spacing: -0.025em; max-width: 16ch; }
.auth-list { display: grid; gap: 14px; margin-top: 24px; font-size: 15px; color: rgb(255 255 255 / .9); }
.auth-list li { display: flex; gap: 12px; align-items: center; }
.auth-list .icon { padding: 6px; width: 32px; height: 32px; border-radius: 10px; background: rgb(255 255 255 / .14); }
.auth-main { display: grid; place-items: center; padding: 32px 16px 48px; }
.auth-card { width: 100%; max-width: 400px; display: grid; gap: 22px; }
.auth-card h1 { font-size: 26px; }
@media (min-width: 960px) { .auth-mobile-brand { display: none !important; } }
.social-logins { display: grid; gap: 10px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.google-logo { width: 18px; height: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
