/* ==========================================================================
   AFFILIATE CASHBACK PRO — DESIGN SYSTEM & STYLESHEET
   Palette: Emerald Green + Shopee Orange #ee4d2d + TikTok #fe2c55
   Design: Glassmorphism · Zero-FOUC · Mobile-First · Dark/Light
   Fonts: Rubik (headings) + Nunito Sans (body) — UI/UX Pro Max match
   ========================================================================== */

/* --- Google Fonts: Be Vietnam Pro (optimal Vietnamese body) + Plus Jakarta Sans (headings) --- */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Plus+Jakarta+Sans:wght@500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* =========================================================
   CSS DESIGN TOKENS
   ========================================================= */
:root {
  /* — Emerald Green Brand — */
  --primary-50:  #ecfdf5;
  --primary-100: #d1fae5;
  --primary-200: #a7f3d0;
  --primary-300: #6ee7b7;
  --primary-400: #34d399;
  --primary-500: #10b981;
  --primary-600: #059669;
  --primary-700: #047857;
  --primary-800: #065f46;
  --primary-900: #064e3b;
  --primary-950: #022c22;

  /* — Platform Accent — */
  --shopee-orange: #ee4d2d;
  --shopee-light:  #fff2ee;
  --tiktok-pink:   #fe2c55;
  --tiktok-cyan:   #25f4ee;
  --tiktok-black:  #121212;
  --tiktok-light:  #fff0f3;

  /* — Status Colors — */
  --accent-gold:   #f59e0b;
  --accent-blue:   #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-red:    #ef4444;
  --destructive:   #ef4444;
  --success:       #10b981;

  /* — Light Mode Surface — */
  --bg-app:     #f0fdf9;
  --bg-gradient:
    radial-gradient(ellipse at 0% 0%, rgba(16,185,129,0.13) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(5,150,105,0.09) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 30%, rgba(52,211,153,0.06) 0%, transparent 40%),
    #f0fdf9;
  --surface-card:        #ffffff;
  --surface-card-subtle: #f1f5f9;
  --surface-glass:       rgba(255,255,255,0.85);
  --surface-glass-border:rgba(16,185,129,0.2);
  --surface-glass-hover: rgba(255,255,255,0.97);
  --surface-hero:        rgba(255,255,255,0.6);

  --text-main:    #0f172a;
  --text-muted:   #475569;
  --text-subtle:  #94a3b8;
  --text-inverse: #ffffff;

  --border-light: #e2e8f0;
  --border-focus: var(--primary-500);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 24px rgba(0,0,0,0.09), 0 3px 8px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.12), 0 6px 12px rgba(0,0,0,0.06);
  --shadow-glow: 0 0 30px -4px rgba(16,185,129,0.4);
  --shadow-glow-sm: 0 0 16px -3px rgba(16,185,129,0.3);

  /* — Typography (Tailored for Vietnamese Language) — */
  --font-heading: 'Plus Jakarta Sans', 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans:    'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* — Shape — */
  --radius-xs:   6px;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-xl:   24px;
  --radius-2xl:  32px;
  --radius-full: 9999px;

  /* — Motion — */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast:      150ms var(--ease-in-out);
  --t-normal:    250ms var(--ease-in-out);
  --t-smooth:    400ms var(--ease-out);
}

/* --- Dark Theme Overrides --- */
html.dark {
  --bg-app:     #060d18;
  --bg-gradient:
    radial-gradient(ellipse at 5% 10%, rgba(16,185,129,0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 95% 85%, rgba(5,150,105,0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(2,44,34,0.5) 0%, transparent 70%),
    #060d18;
  --surface-card:        #0f1f2e;
  --surface-card-subtle: #162435;
  --surface-glass:       rgba(10,20,35,0.82);
  --surface-glass-border:rgba(52,211,153,0.25);
  --surface-glass-hover: rgba(22,36,53,0.95);
  --surface-hero:        rgba(10,20,35,0.55);

  --text-main:    #f0fdf9;
  --text-muted:   #94a3b8;
  --text-subtle:  #64748b;
  --text-inverse: #0f172a;

  --border-light: rgba(255,255,255,0.08);
  --border-focus: var(--primary-400);

  --shopee-light: rgba(238,77,45,0.15);
  --tiktok-light: rgba(254,44,85,0.15);

  --shadow-xs: 0 1px 3px rgba(0,0,0,0.45);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.55);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.6);
  --shadow-lg: 0 10px 24px rgba(0,0,0,0.7);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.8);
  --shadow-glow: 0 0 35px -4px rgba(16,185,129,0.5);
}

/* =========================================================
   BASE & RESET
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-bottom: 72px; /* Mobile bottom nav */
}

@media (min-width: 768px) {
  body { padding-bottom: 0; }
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  line-height: 1.2;
}

::selection {
  background: var(--primary-500);
  color: #ffffff;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-app); }
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--primary-600); }

/* =========================================================
   LAYOUT
   ========================================================= */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
  .container { padding-left: 2rem; padding-right: 2rem; }
}

/* =========================================================
   TYPOGRAPHY UTILITIES
   ========================================================= */
.font-heading  { font-family: var(--font-heading); }
.font-mono     { font-family: var(--font-mono); }
.text-primary  { color: var(--primary-600); }
html.dark .text-primary { color: var(--primary-400); }
.text-shopee   { color: var(--shopee-orange); }
.text-tiktok   { color: var(--tiktok-pink); }
.text-muted    { color: var(--text-muted); }
.text-subtle   { color: var(--text-subtle); }
.text-success  { color: var(--success); }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.font-extrabold{ font-weight: 800; }

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 60%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =========================================================
   BADGES
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-heading);
  border-radius: var(--radius-full);
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-shopee {
  background: var(--shopee-light);
  color: var(--shopee-orange);
  border: 1px solid rgba(238,77,45,0.3);
}

.badge-tiktok {
  background: var(--tiktok-light);
  color: var(--tiktok-pink);
  border: 1px solid rgba(254,44,85,0.3);
}

.badge-cashback {
  background: var(--primary-100);
  color: var(--primary-800);
  border: 1px solid var(--primary-300);
}
html.dark .badge-cashback {
  background: rgba(16,185,129,0.2);
  color: var(--primary-300);
  border-color: rgba(52,211,153,0.3);
}

.badge-discount {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}
html.dark .badge-discount {
  background: rgba(239,68,68,0.18);
  color: #f87171;
  border-color: rgba(239,68,68,0.3);
}

/* AI badge */
.badge-ai {
  background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(59,130,246,0.15));
  color: var(--accent-purple);
  border: 1px solid rgba(139,92,246,0.3);
}
html.dark .badge-ai {
  background: rgba(139,92,246,0.2);
  color: #c4b5fd;
  border-color: rgba(139,92,246,0.4);
}

/* =========================================================
   GLASS CARD  (core reusable surface)
   ========================================================= */
.glass-card {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: border-color var(--t-normal), box-shadow var(--t-normal), transform var(--t-smooth);
}

.glass-card:hover {
  border-color: rgba(16,185,129,0.38);
  box-shadow: var(--shadow-lg), var(--shadow-glow-sm);
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  background: var(--surface-glass);
  border-bottom: 1px solid var(--surface-glass-border);
  transition: box-shadow var(--t-normal);
}

.site-header.scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
  gap: 1rem;
}

/* Brand Logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  flex-shrink: 0;
}

.logo-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-400) 0%, var(--primary-700) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16,185,129,0.45);
  flex-shrink: 0;
}

/* Header Search Bar (Compact & Sleek) */
.header-search-bar {
  flex-grow: 0;
  width: 220px;
  max-width: 240px;
  position: relative;
  display: none;
}

@media (min-width: 768px) {
  .header-search-bar { display: block; }
}

@media (min-width: 1200px) {
  .header-search-bar { width: 250px; max-width: 270px; }
}

.header-search-input {
  width: 100%;
  height: 42px;
  padding: 0 1rem 0 2.75rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-light);
  background: var(--surface-card);
  color: var(--text-main);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.header-search-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}

.header-search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}

/* Desktop Nav */
.nav-menu {
  display: none;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

@media (min-width: 1024px) {
  .nav-menu { display: flex; }
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-heading);
  transition: color var(--t-fast), background var(--t-fast);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
}

.nav-link:hover {
  color: var(--primary-600);
  background: rgba(16,185,129,0.08);
}
.nav-link.active {
  color: var(--primary-600);
  background: rgba(16,185,129,0.1);
}
html.dark .nav-link:hover,
html.dark .nav-link.active {
  color: var(--primary-400);
  background: rgba(52,211,153,0.1);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wallet-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.875rem;
  background: linear-gradient(135deg, var(--primary-50), rgba(209,250,229,0.6));
  border: 1.5px solid var(--primary-300);
  border-radius: var(--radius-full);
  text-decoration: none;
  color: var(--primary-800);
  font-size: 0.875rem;
  font-weight: 700;
  font-family: var(--font-heading);
  transition: all var(--t-fast);
}
html.dark .wallet-badge-btn {
  background: rgba(16,185,129,0.15);
  border-color: rgba(52,211,153,0.35);
  color: var(--primary-300);
}
.wallet-badge-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow-sm);
}

/* User dropdown menu item hover */
#userDropdown a:hover,
#userDropdown button:hover {
  background: var(--surface-card-subtle);
}

.btn-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: var(--surface-card);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-icon:hover {
  background: var(--surface-card-subtle);
  color: var(--primary-600);
  border-color: var(--primary-400);
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  padding: 0.625rem 1.375rem;
  min-height: 44px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--t-normal);
  text-decoration: none;
  border: 1.5px solid transparent;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--t-fast);
}

.btn:hover::before { background: rgba(255,255,255,0.08); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16,185,129,0.38);
}
.btn-primary:hover {
  box-shadow: 0 6px 22px rgba(16,185,129,0.55);
  transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0); }

.btn-shopee {
  background: linear-gradient(135deg, #ff6c4b 0%, #ee4d2d 50%, #d73211 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(238,77,45,0.38);
}
.btn-shopee:hover {
  box-shadow: 0 6px 22px rgba(238,77,45,0.55);
  transform: translateY(-2px);
}

.btn-tiktok {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #ffffff;
  border-color: rgba(254,44,85,0.5);
  box-shadow: 0 4px 14px rgba(254,44,85,0.25);
}
.btn-tiktok:hover {
  border-color: var(--tiktok-cyan);
  box-shadow: 0 6px 22px rgba(37,244,238,0.3);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--surface-card-subtle);
  color: var(--text-main);
  border-color: var(--border-light);
}
.btn-secondary:hover {
  background: var(--surface-card);
  border-color: var(--primary-400);
  color: var(--primary-600);
}

.btn-danger {
  background: #ef4444 !important;
  color: #ffffff !important;
  border: 1px solid #dc2626 !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.38) !important;
}
.btn-danger:hover {
  background: #dc2626 !important;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5) !important;
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--surface-card-subtle);
  color: var(--text-main);
}

.btn-sm {
  min-height: 36px;
  padding: 0.35rem 0.875rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  min-height: 54px;
  padding: 0.9rem 2rem;
  font-size: 1.0625rem;
  border-radius: var(--radius-lg);
  letter-spacing: 0.01em;
}

.btn-xl {
  min-height: 60px;
  padding: 1rem 2.5rem;
  font-size: 1.125rem;
  border-radius: var(--radius-xl);
}

/* =========================================================
   HERO SECTION
   ========================================================= */
.hero-section {
  position: relative;
  overflow: hidden;
}

/* Animated gradient orbs behind hero */
.hero-section::before {
  content: '';
  position: absolute;
  top: -120px;
  left: -100px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16,185,129,0.18) 0%, transparent 70%);
  animation: heroOrb1 8s ease-in-out infinite alternate;
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -80px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(238,77,45,0.12) 0%, transparent 70%);
  animation: heroOrb2 10s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes heroOrb1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(60px, 40px) scale(1.15); }
}

@keyframes heroOrb2 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-40px, -60px) scale(1.1); }
}

.hero-header {
  text-align: center;
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto 2rem auto;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(5,150,105,0.08));
  border: 1.5px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--primary-700);
  margin-bottom: 1.25rem;
  animation: pillFade 0.6s var(--ease-out) both;
}
html.dark .hero-pill {
  background: rgba(16,185,129,0.15);
  border-color: rgba(52,211,153,0.35);
  color: var(--primary-300);
}

@keyframes pillFade {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.875rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 1rem;
  animation: heroTitleUp 0.7s var(--ease-out) 0.1s both;
}

@keyframes heroTitleUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-desc {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.7;
  animation: heroTitleUp 0.7s var(--ease-out) 0.2s both;
}

/* Converter Card */
.converter-card {
  padding: 1.75rem;
  position: relative;
  z-index: 2;
  animation: heroTitleUp 0.7s var(--ease-out) 0.3s both;
}

.input-group-hero {
  display: flex;
  gap: 0.75rem;
  flex-direction: column;
}

@media (min-width: 640px) {
  .input-group-hero {
    flex-direction: row;
    align-items: center;
  }
}

.input-hero-wrapper {
  position: relative;
  flex-grow: 1;
}

.input-hero-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}

.input-hero {
  width: 100%;
  height: 54px;
  padding: 0 1.25rem 0 3.25rem;
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-light);
  background: var(--surface-card);
  color: var(--text-main);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.input-hero:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px rgba(16,185,129,0.15);
}

/* Converted result preview box */
.converted-result-box {
  border-top: 1px solid var(--surface-glass-border);
  padding-top: 1.25rem;
}

.result-card-inner {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.result-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}

.result-info { flex: 1; min-width: 0; }

.result-title {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.price-tag {
  color: var(--destructive);
  font-weight: 800;
}

.commission-badge {
  color: var(--primary-600);
  font-weight: 800;
}
html.dark .commission-badge { color: var(--primary-400); }

.result-link-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--surface-card-subtle);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-family: var(--font-mono);
}

.result-link-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
  color: var(--text-subtle);
}

.result-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* =========================================================
   MOBILE BOTTOM NAV
   ========================================================= */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  height: 64px;
  background: var(--surface-glass);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border-top: 1px solid var(--surface-glass-border);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}

@media (min-width: 768px) {
  .mobile-bottom-nav { display: none; }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-subtle);
  text-decoration: none;
  font-size: 0.6875rem;
  font-weight: 700;
  font-family: var(--font-heading);
  min-width: 56px;
  flex: 1;
  transition: color var(--t-fast);
  position: relative;
}

.bottom-nav-item svg {
  transition: transform var(--t-smooth);
}

.bottom-nav-item.active,
.bottom-nav-item:hover { color: var(--primary-600); }
html.dark .bottom-nav-item.active,
html.dark .bottom-nav-item:hover { color: var(--primary-400); }

.bottom-nav-item.active svg {
  transform: scale(1.1);
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
  border-radius: 0 0 var(--radius-full) var(--radius-full);
}

/* =========================================================
   SECTION HEADINGS
   ========================================================= */
.section-header-bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .section-header-bar {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

@media (min-width: 640px) {
  .section-title { font-size: 1.5rem; }
}

/* =========================================================
   CATEGORY GRID
   ========================================================= */
.category-strip { padding: 1.5rem 0; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.625rem;
}

@media (min-width: 480px) {
  .category-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 640px) {
  .category-grid { grid-template-columns: repeat(6, 1fr); gap: 0.875rem; }
}

.category-item-card {
  padding: 1rem 0.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius-lg);
  cursor: pointer;
}

.category-item-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-400);
}

.cat-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-50), rgba(209,250,229,0.6));
  color: var(--primary-700);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-normal);
  border: 1.5px solid rgba(16,185,129,0.15);
}
html.dark .cat-icon-circle {
  background: rgba(16,185,129,0.12);
  color: var(--primary-300);
  border-color: rgba(52,211,153,0.2);
}

.category-item-card:hover .cat-icon-circle {
  background: linear-gradient(135deg, var(--primary-100), rgba(167,243,208,0.5));
  box-shadow: var(--shadow-glow-sm);
  transform: scale(1.08);
}

.cat-name {
  font-size: 0.78125rem;
  font-weight: 700;
  font-family: var(--font-heading);
  line-height: 1.3;
  color: var(--text-muted);
}

.category-item-card:hover .cat-name { color: var(--primary-700); }
html.dark .category-item-card:hover .cat-name { color: var(--primary-300); }

/* =========================================================
   FLASH SALE & COUNTDOWN
   ========================================================= */
.flash-sale-box {
  background: linear-gradient(135deg, rgba(238,77,45,0.07) 0%, rgba(254,44,85,0.04) 50%, rgba(245,158,11,0.04) 100%);
  border: 1.5px solid rgba(238,77,45,0.25);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.flash-sale-box::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(238,77,45,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.flash-sale-header {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
  .flash-sale-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.flash-sale-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--shopee-orange);
  letter-spacing: -0.01em;
}

.countdown-box {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 700;
}

.countdown-digit {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #f8fafc;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
  min-width: 2.2em;
  text-align: center;
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.04em;
}
html.dark .countdown-digit {
  background: linear-gradient(135deg, #0f172a, #080c14);
  border: 1px solid rgba(255,255,255,0.08);
}

/* =========================================================
   PRODUCT CARDS GRID
   ========================================================= */
.products-grid-feed {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .products-grid-feed { gap: 1rem; }
}

@media (min-width: 640px) {
  .products-grid-feed { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .products-grid-feed { grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
}

/* 3x3 Grid Modifier (Exactly 3 Columns on Desktop/Tablet) */
.products-grid-feed-3col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .products-grid-feed-3col { gap: 1rem; }
}

@media (min-width: 768px) {
  .products-grid-feed-3col { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}

/* Individual Product Card */
.feed-product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  position: relative;
  cursor: pointer;
}

.card-media-wrapper {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface-card-subtle);
  background: linear-gradient(90deg, var(--surface-card-subtle) 0%, rgba(255,255,255,0.05) 50%, var(--surface-card-subtle) 100%);
  background-size: 200% 100%;
  animation: cardImgShimmer 1.8s infinite ease-in-out;
}

@keyframes cardImgShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.card-media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out), opacity 0.3s ease;
  content-visibility: auto;
}

.feed-product-card:hover .card-media-img {
  transform: scale(1.07);
}

.card-platform-badge-float {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
  pointer-events: none;
}

.card-discount-badge-float {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
  pointer-events: none;
}

/* Hover overlay on image */
.card-media-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.18) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--t-normal);
  pointer-events: none;
}
.feed-product-card:hover .card-media-wrapper::after { opacity: 1; }

.card-body-content {
  padding: 0.875rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
  gap: 0.5rem;
}

.card-product-name {
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  min-height: 2.9em;
}

.card-product-name a {
  color: var(--text-main);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  transition: color 150ms ease-in-out;
}

.card-product-name a:hover,
.feed-product-card:hover .card-product-name a {
  color: var(--primary-600);
}

html.dark .card-product-name a:hover,
html.dark .feed-product-card:hover .card-product-name a {
  color: var(--primary-400);
}

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

.card-current-price {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--shopee-orange);
  letter-spacing: -0.01em;
}

.card-original-price {
  font-size: 0.75rem;
  text-decoration: line-through;
  color: var(--text-subtle);
}

.card-cashback-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.625rem;
  background: linear-gradient(135deg, var(--primary-50), rgba(209,250,229,0.4));
  border: 1px dashed rgba(16,185,129,0.4);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--primary-800);
}
html.dark .card-cashback-pill {
  background: rgba(16,185,129,0.1);
  border-color: rgba(52,211,153,0.3);
  color: var(--primary-300);
}

.card-meta-sales {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-subtle);
}

/* =========================================================
   PRODUCT CARD DUAL ACTION BUTTONS (BUY & CONVERT)
   ========================================================= */
.card-action-group {
  display: flex;
  align-items: stretch;
  gap: 0.375rem;
  margin-top: 0.625rem;
  width: 100%;
}

.btn-card-buy {
  flex: 1;
  min-width: 0;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 0.75rem;
  background: linear-gradient(135deg, #ee4d2d 0%, #ff5722 100%);
  color: #ffffff !important;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(238, 77, 45, 0.28);
  transition: all var(--t-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.btn-card-buy:hover {
  background: linear-gradient(135deg, #e03c1a 0%, #ee4d2d 100%);
  box-shadow: 0 4px 14px rgba(238, 77, 45, 0.42);
  transform: translateY(-1px);
  color: #ffffff !important;
}

.btn-card-buy:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(238, 77, 45, 0.25);
}

.btn-buy-icon {
  flex-shrink: 0;
  opacity: 0.95;
}

.btn-arrow-icon {
  flex-shrink: 0;
  opacity: 0.85;
  transition: transform var(--t-fast);
}

.btn-card-buy:hover .btn-arrow-icon {
  transform: translate(1px, -1px);
  opacity: 1;
}

.btn-card-reconvert {
  width: 38px;
  height: 38px;
  min-width: 38px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.08);
  color: var(--primary-600);
  border: 1.5px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 0;
  transition: all var(--t-normal);
  position: relative;
}

html.dark .btn-card-reconvert {
  background: rgba(16, 185, 129, 0.12);
  color: var(--primary-400);
  border-color: rgba(52, 211, 153, 0.3);
}

.btn-card-reconvert:hover {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-card-reconvert:hover .reconvert-icon {
  transform: rotate(180deg);
}

.reconvert-icon {
  transition: transform 0.4s var(--ease-out);
}

.btn-card-reconvert.is-converting .reconvert-icon {
  animation: reconvertSpin 0.8s linear infinite;
}

@keyframes reconvertSpin {
  100% { transform: rotate(360deg); }
}

/* =========================================================
   VOUCHER / COUPON CARDS
   ========================================================= */
.voucher-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
}

@media (min-width: 480px) {
  .voucher-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .voucher-grid { grid-template-columns: repeat(4, 1fr); }
}

.coupon-card {
  padding: 1.125rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  position: relative;
  border-left: 4px solid var(--primary-500);
  transition: all var(--t-normal);
}

.coupon-card::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -4px;
  width: 4px;
  background: var(--primary-500);
  border-radius: var(--radius-full) 0 0 var(--radius-full);
}

.coupon-card.shopee { border-left-color: var(--shopee-orange); }
.coupon-card.shopee::before { background: var(--shopee-orange); }
.coupon-card.tiktok { border-left-color: var(--tiktok-pink); }
.coupon-card.tiktok::before { background: var(--tiktok-pink); }

.coupon-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.coupon-code-box {
  background: var(--surface-card-subtle);
  border: 1px dashed var(--border-light);
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  letter-spacing: 0.05em;
}

/* =========================================================
   CASHBACK WALLET
   ========================================================= */
.wallet-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.125rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .wallet-hero-grid { grid-template-columns: 2fr 1fr; }
}

.wallet-balance-card {
  padding: 1.75rem;
  background: linear-gradient(135deg, rgba(16,185,129,0.1) 0%, rgba(5,150,105,0.05) 100%);
  border: 1.5px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.wallet-balance-card::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(16,185,129,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.balance-numbers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .balance-numbers { grid-template-columns: repeat(4, 1fr); }
}

.balance-item-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.balance-item-value {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* =========================================================
   FORMS
   ========================================================= */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-field label {
  font-size: 0.8125rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 0.875rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  background: var(--surface-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.form-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}

textarea.form-input {
  height: auto;
  padding: 0.75rem 0.875rem;
  resize: vertical;
}

/* Compact Search & Filter Toolbar Styles */
.platform-segment {
  display: inline-block;
  padding: 0.35rem 0.875rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-muted);
  transition: all var(--t-fast);
  user-select: none;
}

.platform-segment:hover {
  color: var(--text-main);
}

.platform-segment.active {
  background: var(--surface-card);
  color: var(--primary-600);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.platform-segment.active.shopee {
  color: var(--shopee-orange);
  background: var(--surface-card);
}

.platform-segment.active.tiktok {
  color: var(--tiktok-pink);
  background: var(--surface-card);
}

.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-heading);
  background: var(--surface-card);
  border: 1.5px solid var(--border-light);
  color: var(--text-muted);
  transition: all var(--t-fast);
  user-select: none;
}

.quick-chip:hover {
  border-color: var(--primary-400);
  color: var(--text-main);
}

.quick-chip.active.cashback {
  background: var(--primary-100);
  color: var(--primary-800);
  border-color: var(--primary-400);
}
html.dark .quick-chip.active.cashback {
  background: rgba(16,185,129,0.2);
  color: var(--primary-300);
  border-color: rgba(52,211,153,0.4);
}

.quick-chip.active.discount {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}
html.dark .quick-chip.active.discount {
  background: rgba(239,68,68,0.2);
  color: #f87171;
  border-color: rgba(239,68,68,0.4);
}

/* =========================================================
   MODAL
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
}

.modal-overlay.open { display: flex; }

.modal-container {
  background: var(--surface-card);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.35s var(--ease-out);
}

@media (min-width: 640px) {
  .modal-container {
    border-radius: var(--radius-xl);
    animation: scaleIn 0.3s var(--ease-out);
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.94); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  margin: 0.875rem auto 0 auto;
  display: block;
}

@media (min-width: 640px) { .sheet-handle { display: none; } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 800;
}

.modal-body { padding: 1.25rem 1.5rem; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* =========================================================
   TOAST NOTIFICATIONS
   ========================================================= */
.toast-container {
  position: fixed;
  bottom: 5.5rem;
  right: 1rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  pointer-events: none;
  max-width: calc(100vw - 2rem);
}

@media (min-width: 768px) {
  .toast-container { bottom: 1.5rem; right: 1.5rem; }
}

.toast {
  background: var(--surface-card);
  color: var(--text-main);
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-heading);
  pointer-events: auto;
  animation: toastIn 0.35s var(--ease-out) forwards;
  min-width: 260px;
}

.toast.success { border-left: 4px solid var(--primary-500); }
.toast.error   { border-left: 4px solid var(--destructive); }
.toast.info    { border-left: 4px solid var(--accent-blue); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(16px) scale(0.96); }
}

/* =========================================================
   LUXURY FLOATING SMART ALERTS (TOP-RIGHT STACK)
   ========================================================= */
.floating-alerts-container {
  position: fixed;
  top: 5rem;
  right: 1.25rem;
  z-index: 160;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
  width: calc(100vw - 2.5rem);
  pointer-events: none;
}

@media (max-width: 640px) {
  .floating-alerts-container {
    top: 4.5rem;
    right: 0.75rem;
    width: calc(100vw - 1.5rem);
  }
}

.floating-smart-alert {
  pointer-events: auto;
  border-radius: 16px;
  padding: 1rem 1.15rem;
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.2);
  animation: slideInRightAlert 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.floating-smart-alert::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
}

/* 1. Amber / Gold Warning: Chưa xác thực Email */
.floating-smart-alert.alert-theme-warning {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  color: #78350f;
}
.floating-smart-alert.alert-theme-warning::before {
  background: linear-gradient(180deg, #f59e0b, #d97706);
}
.floating-smart-alert.alert-theme-warning .alert-icon-wrap {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.floating-smart-alert.alert-theme-warning .alert-heading {
  color: #92400e;
}
.floating-smart-alert.alert-theme-warning .alert-paragraph {
  color: #78350f;
}
.floating-smart-alert.alert-theme-warning .alert-action-btn {
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}
.floating-smart-alert.alert-theme-warning .alert-action-btn:hover {
  background: #d97706;
}

html.dark .floating-smart-alert.alert-theme-warning {
  background: #1c1917;
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  color: #fef3c7;
  box-shadow: 0 18px 40px -6px rgba(0, 0, 0, 0.7);
}
html.dark .floating-smart-alert.alert-theme-warning .alert-icon-wrap {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}
html.dark .floating-smart-alert.alert-theme-warning .alert-heading {
  color: #fbbf24;
}
html.dark .floating-smart-alert.alert-theme-warning .alert-paragraph {
  color: #f5f5f4;
}

/* 2. Emerald Green: Khách chưa đăng nhập */
.floating-smart-alert.alert-theme-guest {
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  color: #064e3b;
}
.floating-smart-alert.alert-theme-guest::before {
  background: linear-gradient(180deg, #10b981, #059669);
}
.floating-smart-alert.alert-theme-guest .alert-icon-wrap {
  background: #d1fae5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.floating-smart-alert.alert-theme-guest .alert-heading {
  color: #065f46;
}
.floating-smart-alert.alert-theme-guest .alert-paragraph {
  color: #064e3b;
}
.floating-smart-alert.alert-theme-guest .alert-action-btn {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}
.floating-smart-alert.alert-theme-guest .alert-action-btn:hover {
  background: #059669;
}

html.dark .floating-smart-alert.alert-theme-guest {
  background: #062e24;
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  color: #ecfdf5;
  box-shadow: 0 18px 40px -6px rgba(0, 0, 0, 0.7);
}
html.dark .floating-smart-alert.alert-theme-guest .alert-icon-wrap {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}
html.dark .floating-smart-alert.alert-theme-guest .alert-heading {
  color: #6ee7b7;
}
html.dark .floating-smart-alert.alert-theme-guest .alert-paragraph {
  color: #f0fdf4;
}

/* 3. Blue Sapphire: Săn Deal Hoàn Tiền Nhanh */
.floating-smart-alert.alert-theme-tip {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #1e3a8a;
}
.floating-smart-alert.alert-theme-tip::before {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
}
.floating-smart-alert.alert-theme-tip .alert-icon-wrap {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.floating-smart-alert.alert-theme-tip .alert-heading {
  color: #1e40af;
}
.floating-smart-alert.alert-theme-tip .alert-paragraph {
  color: #1e3a8a;
}
.floating-smart-alert.alert-theme-tip .alert-action-btn {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.floating-smart-alert.alert-theme-tip .alert-action-btn:hover {
  background: #1d4ed8;
}

html.dark .floating-smart-alert.alert-theme-tip {
  background: #0f172a;
  border: 1.5px solid rgba(59, 130, 246, 0.4);
  color: #eff6ff;
  box-shadow: 0 18px 40px -6px rgba(0, 0, 0, 0.7);
}
html.dark .floating-smart-alert.alert-theme-tip .alert-icon-wrap {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.35);
}
html.dark .floating-smart-alert.alert-theme-tip .alert-heading {
  color: #93c5fd;
}
html.dark .floating-smart-alert.alert-theme-tip .alert-paragraph {
  color: #f8fafc;
}

/* Common inner elements */
.alert-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.alert-heading {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.alert-paragraph {
  font-size: 0.8125rem;
  line-height: 1.45;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.alert-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  font-size: 0.775rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.alert-dismiss-btn {
  background: transparent;
  border: none;
  color: currentColor;
  opacity: 0.6;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s, background 0.2s;
  margin: -0.25rem -0.25rem 0 0;
}

.alert-dismiss-btn:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.08);
}
html.dark .alert-dismiss-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

@keyframes slideInRightAlert {
  from { opacity: 0; transform: translateX(50px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* =========================================================
   SPINNER
   ========================================================= */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

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

/* =========================================================
   ADMIN / DATA TABLES
   ========================================================= */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  border-bottom: 1.5px solid var(--border-light);
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td { background: rgba(16,185,129,0.03); }
html.dark .data-table tr:hover td { background: rgba(52,211,153,0.04); }

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

.kpi-card {
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.kpi-label {
  font-size: 0.8125rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  background: var(--surface-card);
}

/* =========================================================
   UTILITY CLASSES
   ========================================================= */
.hidden-sm { display: none; }
@media (min-width: 640px) { .hidden-sm { display: unset; } }

.text-center { text-align: center; }
.w-full { width: 100%; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }

/* =========================================================
   SEARCH & FILTER PAGE
   ========================================================= */
.filter-sidebar {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
}

.filter-group { margin-bottom: 1.5rem; }

.filter-group-title {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  margin-bottom: 0.875rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-light);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
  color: var(--text-muted);
  background: var(--surface-card);
}

.filter-chip:hover,
.filter-chip.active {
  border-color: var(--primary-500);
  color: var(--primary-600);
  background: rgba(16,185,129,0.08);
}
html.dark .filter-chip:hover,
html.dark .filter-chip.active {
  color: var(--primary-400);
  background: rgba(52,211,153,0.1);
}

/* =========================================================
   PRODUCT DETAIL PAGE
   ========================================================= */
.product-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .product-hero-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .product-hero-grid { grid-template-columns: 5fr 4fr; gap: 2.5rem; }
}

.product-image-main {
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--surface-card-subtle);
}

.product-image-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.product-price-box {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.product-current-price {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  color: var(--shopee-orange);
  letter-spacing: -0.03em;
}

.product-original-price {
  font-size: 1.0625rem;
  text-decoration: line-through;
  color: var(--text-subtle);
}

.cashback-highlight-box {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(52,211,153,0.06));
  border: 1.5px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-xl);
  margin: 1.25rem 0;
}

.cashback-highlight-amount {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary-600);
  letter-spacing: -0.02em;
}
html.dark .cashback-highlight-amount { color: var(--primary-400); }

/* =========================================================
   AI STUDIO PAGE
   ========================================================= */
.ai-studio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .ai-studio-grid { grid-template-columns: 1fr 1fr; }
}

.ai-result-box {
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  background: var(--surface-glass);
  border: 1px solid var(--surface-glass-border);
}

/* Pros / Cons list */
.pros-cons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.pros-list, .cons-list { list-style: none; }
.pros-list li, .cons-list li {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
  padding: 0.35rem 0;
}

.pros-list li::before {
  content: '✓';
  color: var(--primary-500);
  font-weight: 800;
  flex-shrink: 0;
}

.cons-list li::before {
  content: '✕';
  color: var(--destructive);
  font-weight: 800;
  flex-shrink: 0;
}

/* =========================================================
   SKELETON LOADER ANIMATION
   ========================================================= */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface-card-subtle) 25%,
    var(--border-light) 50%,
    var(--surface-card-subtle) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}

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

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  background: var(--surface-card);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

.footer-brand { max-width: 320px; }

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--t-fast);
}

.footer-links a:hover { color: var(--primary-600); }
html.dark .footer-links a:hover { color: var(--primary-400); }

.footer-bottom {
  border-top: 1px solid var(--border-light);
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* =========================================================
   BLOG & EDITORIAL PROSE STYLES
   ========================================================= */
.blog-prose-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-main);
}

.blog-prose-content h2 {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-top: 2rem;
  margin-bottom: 0.875rem;
  padding-bottom: 0.375rem;
  border-bottom: 2px solid rgba(16,185,129,0.2);
}

.blog-prose-content h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--text-main);
  margin-top: 1.5rem;
  margin-bottom: 0.625rem;
}

.blog-prose-content p {
  margin-bottom: 1.25rem;
}

.blog-prose-content ul,
.blog-prose-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.blog-prose-content li {
  margin-bottom: 0.5rem;
}

.blog-prose-content blockquote {
  border-left: 4px solid var(--primary-500);
  background: var(--surface-card-subtle);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-muted);
}

.blog-prose-content img {
  border-radius: var(--radius-lg);
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-md);
}

.blog-prose-content strong {
  color: var(--text-main);
  font-weight: 700;
}

/* =========================================================
   REDUCED MOTION ACCESSIBILITY
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .hero-section::before,
  .hero-section::after { animation: none; }
}

/* =========================================================
   2-COLUMN HOW-IT-WORKS & LIVE STATS SHOWCASE
   ========================================================= */
.steps-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
  align-items: stretch;
}

@media (min-width: 992px) {
  .steps-stats-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2.5rem;
  }
}

/* =========================================================
   FLATICON ANIMATED ICONS & MICRO-INTERACTIONS
   ========================================================= */
i[class^="fi-"], i[class*=" fi-"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: -0.125em;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

/* 1. Pulse Animation (Lightning, Fire, Live Beacon, Hot Deals) */
.fi-pulse,
.badge-flash-sale i,
.badge-cashback i,
.live-beacon i {
  animation: fiPulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}
@keyframes fiPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: 0.85; filter: drop-shadow(0 0 6px currentColor); }
}

/* 2. Bounce Animation (Cart, Gift, Wallet, Reward) */
.fi-bounce {
  animation: fiBounce 2.2s infinite ease-in-out;
}
@keyframes fiBounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
  60% { transform: translateY(-2.5px); }
}

/* 3. Float Animation (Hero Coins, Gems, Stars) */
.fi-float {
  animation: fiFloat 3s infinite ease-in-out;
}
@keyframes fiFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(3deg); }
}

/* 4. Spin Animation (Refresh, Gear, Sync) */
.fi-spin {
  animation: fiSpin 3s linear infinite;
}
@keyframes fiSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 5. Hover Interactive Wiggle */
.btn:hover i[class^="fi-"],
.btn:hover i[class*=" fi-"],
.glass-card:hover i.fi-interactive {
  transform: scale(1.15) rotate(-6deg);
}

.fi-wiggle:hover {
  animation: fiWiggle 0.6s ease-in-out;
}
@keyframes fiWiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-10deg) scale(1.15); }
  75% { transform: rotate(10deg) scale(1.15); }
}

/* 6. Gold Star Shimmer */
.fi-star-shimmer {
  color: #f59e0b;
  animation: fiStarGlow 2.5s infinite alternate;
}
@keyframes fiStarGlow {
  0% { filter: drop-shadow(0 0 1px rgba(245, 158, 11, 0.4)); }
  100% { filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.9)); }
}

/* =========================================================
   GLOBAL TOP PROGRESS PAGE LOADER & TRANSITIONS
   ========================================================= */
#global-page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3.5px;
  background: linear-gradient(90deg, #059669, #10b981, #34d399, #a7f3d0);
  background-size: 200% 100%;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.8), 0 0 4px rgba(52, 211, 153, 1);
  z-index: 999999;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
}

#global-page-loader.active {
  animation: shimmerLoader 1.5s infinite linear;
}

@keyframes shimmerLoader {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

#global-page-loader.loaded {
  width: 100% !important;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.35s 0.2s ease;
}

/* =========================================================
   CUSTOM GLASSMORPHISM PAGINATION
   ========================================================= */
.pagination-custom .page-link-btn:not(.active):not(.disabled):hover {
  background: var(--surface-card-subtle);
  color: var(--primary-600) !important;
  transform: translateY(-2px);
}

.pagination-custom .page-link-btn.active {
  cursor: default;
}

/* =========================================================
   MODAL SYSTEM & DIALOGS
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.open,
.modal-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.modal-container {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-2xl);
  position: relative;
  overflow: hidden;
  animation: modalScaleIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalScaleIn {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.modal-body {
  padding: 1.5rem;
  max-height: calc(85vh - 120px);
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  background: var(--surface-card-subtle);
}

/* =========================================================
   ADMIN FLOATING BULK ACTION BAR
   ========================================================= */
.bulk-floating-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4), 0 0 24px rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-full);
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  z-index: 99999;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  max-width: 92vw;
  flex-wrap: wrap;
}

.bulk-floating-bar.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.bulk-badge-counter {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  color: #fff;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.bulk-action-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.bulk-btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.bulk-btn-danger:hover {
  background: #ef4444;
  color: #fff;
  transform: translateY(-1px);
}

.bulk-btn-success {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.bulk-btn-success:hover {
  background: #10b981;
  color: #fff;
  transform: translateY(-1px);
}

.bulk-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.bulk-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* ══════════════════════════════════════════════════════════════════
   HERO TWO-COLUMN & TOP 3 CASHBACK LEADERBOARD (UI/UX PRO MAX)
   ══════════════════════════════════════════════════════════════════ */
.hero-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: stretch;
  max-width: 1240px;
  margin: 0 auto;
}

@media (min-width: 992px) {
  .hero-layout-grid {
    grid-template-columns: 1.35fr 1fr;
    gap: 1.75rem;
  }
}

.hero-converter-pane {
  display: flex;
  flex-direction: column;
}

/* Converter Card Luxury Glassmorphism */
.converter-card-pro {
  background: var(--surface-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(16, 185, 129, 0.08);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--t-normal), border-color var(--t-normal);
}
html.dark .converter-card-pro {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.5);
}

.converter-card-pro::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #10b981, #3b82f6, #8b5cf6);
}

.converter-header-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

.converter-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(5, 150, 105, 0.08));
  color: var(--primary-600);
  border: 1px solid rgba(16, 185, 129, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}
html.dark .converter-icon-badge {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}

.converter-title-text {
  font-size: 1.125rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--text-main);
  line-height: 1.3;
  margin: 0;
  letter-spacing: -0.02em;
}

.converter-subtitle-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0 0;
}

/* Custom Input Wrapper */
.input-hero-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .input-hero-container {
    flex-direction: row;
    align-items: stretch;
  }
}

.input-hero-field-wrap {
  position: relative;
  flex-grow: 1;
}

.input-hero-field-wrap .field-icon {
  position: absolute;
  left: 1.125rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.input-hero-field {
  width: 100%;
  height: 54px;
  padding: 0 1.25rem 0 3.125rem;
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-light);
  background: var(--surface-card-subtle);
  color: var(--text-main);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.input-hero-field:focus {
  background: var(--surface-card);
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

.btn-convert-submit {
  height: 54px;
  padding: 0 1.75rem;
  font-size: 0.9375rem;
  font-weight: 800;
  font-family: var(--font-heading);
  border-radius: var(--radius-lg);
  border: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
}

.btn-convert-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
}
.btn-convert-submit:active {
  transform: translateY(0);
}

.converter-trust-badges {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.trust-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.trust-badge-item svg {
  color: var(--primary-500);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════════
   LEADERBOARD PRO FINTECH CARD
   ══════════════════════════════════════════════════════════════════ */
.hero-leaderboard-card-pro {
  background: var(--surface-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(245, 158, 11, 0.08);
  position: relative;
  overflow: hidden;
}
html.dark .hero-leaderboard-card-pro {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.5);
}

.hero-leaderboard-card-pro::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f59e0b, #fbbf24, #10b981);
}

.leaderboard-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.125rem;
  gap: 0.5rem;
}

.leaderboard-headline {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.leaderboard-headline .trophy-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.leaderboard-title-pro {
  font-size: 0.9375rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.01em;
}

.leaderboard-subtitle-pro {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.live-indicator-chip {
  font-size: 0.6875rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: var(--primary-600);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
html.dark .live-indicator-chip {
  color: #34d399;
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.35);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
  animation: pulseGlow 1.5s infinite;
}

.leaderboard-rows-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

/* Clean Professional Row Item */
.rank-card-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-lg);
  background: var(--surface-card-subtle);
  border: 1px solid var(--border-light);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  position: relative;
}

.rank-card-row:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

/* Rank 1 - Champion */
.rank-card-row.rank-1 {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(251, 191, 36, 0.03) 100%);
  border-color: rgba(245, 158, 11, 0.4);
}
html.dark .rank-card-row.rank-1 {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14) 0%, rgba(251, 191, 36, 0.05) 100%);
  border-color: rgba(245, 158, 11, 0.5);
}

/* Rank 2 - Silver */
.rank-card-row.rank-2 {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.08) 0%, rgba(203, 213, 225, 0.03) 100%);
  border-color: rgba(148, 163, 184, 0.35);
}

/* Rank 3 - Bronze */
.rank-card-row.rank-3 {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.06) 0%, rgba(180, 83, 9, 0.02) 100%);
  border-color: rgba(217, 119, 6, 0.3);
}

/* Rank Badge Avatar */
.rank-pos-wrap {
  position: relative;
  flex-shrink: 0;
}

.rank-pos-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8125rem;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.rank-1 .rank-pos-avatar {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: 1.5px solid #fef3c7;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
}

.rank-2 .rank-pos-avatar {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  border: 1.5px solid #f8fafc;
}

.rank-3 .rank-pos-avatar {
  background: linear-gradient(135deg, #d97706, #9a3412);
  border: 1.5px solid #ffedd5;
}

.rank-pill-tag {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 900;
  border: 1.5px solid var(--surface-card);
}

.rank-1 .rank-pill-tag { background: #f59e0b; color: #ffffff; }
.rank-2 .rank-pill-tag { background: #64748b; color: #ffffff; }
.rank-3 .rank-pill-tag { background: #b45309; color: #ffffff; }

.rank-details-col {
  flex: 1;
  min-width: 0;
}

.rank-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.rank-user-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tier-pill {
  font-size: 0.5625rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.tier-vip {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #ffffff;
}

.tier-member {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

.rank-value-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.cashback-stat-number {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--primary-600);
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}
html.dark .cashback-stat-number {
  color: #34d399;
}

.orders-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.leaderboard-card-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.leaderboard-card-footer a {
  font-weight: 700;
  color: var(--primary-600);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color var(--t-fast);
}

.leaderboard-card-footer a:hover {
  color: var(--primary-500);
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════════════
   ACCOUNT SETTINGS & SECURITY TAB (UI/UX PRO MAX)
   ══════════════════════════════════════════════════════════════════ */
.settings-grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.125rem;
}

@media (min-width: 900px) {
  .settings-grid-layout {
    grid-template-columns: 1fr 1fr;
  }
  .settings-grid-full {
    grid-column: 1 / -1;
  }
}

.settings-section-card {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.125rem 1.25rem;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color var(--t-normal), box-shadow var(--t-normal), transform 0.2s ease;
}
.settings-section-card:hover {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: var(--shadow-md);
}

.settings-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.settings-card-title-group {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.settings-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(5, 150, 105, 0.06));
  color: var(--primary-600);
  border: 1px solid rgba(16, 185, 129, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
html.dark .settings-card-icon {
  color: #34d399;
}

.settings-card-title {
  font-size: 0.9375rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.01em;
}

.settings-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.1rem 0 0 0;
  line-height: 1.35;
}

.verified-pill {
  font-size: 0.71875rem;
  font-weight: 700;
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
html.dark .verified-pill {
  color: #34d399;
  background: rgba(16, 185, 129, 0.18);
}

.unverified-pill {
  font-size: 0.71875rem;
  font-weight: 700;
  color: #d97706;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.input-addon-group {
  display: flex;
  gap: 0.5rem;
}

.otp-digit-input {
  font-family: var(--font-mono, monospace);
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-align: center;
}

.pin-security-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(59, 130, 246, 0.04));
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  color: var(--text-main);
  margin-bottom: 0.875rem;
  line-height: 1.4;
}

/* Floating Email Verification Top-Right Corner Alert */
.unverified-email-banner {
  position: fixed;
  top: 5.5rem;
  right: 1.5rem;
  z-index: 105;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 4px solid #f59e0b;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  max-width: 380px;
  animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark .unverified-email-banner {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(245, 158, 11, 0.4);
}

.unverified-email-banner .alert-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.unverified-email-banner .alert-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.unverified-email-banner .alert-desc {
  font-size: 0.71875rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.unverified-email-banner .alert-link {
  display: inline-block;
  margin-top: 0.25rem;
  color: #fbbf24;
  font-weight: 600;
  font-size: 0.71875rem;
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.unverified-email-banner .alert-link:hover {
  color: #f59e0b;
}

.unverified-email-banner .close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem;
  margin-left: auto;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.unverified-email-banner .close-btn:hover {
  color: #ffffff;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .unverified-email-banner {
    top: 4.5rem;
    right: 0.75rem;
    left: 0.75rem;
    max-width: none;
  }
}

/* ==========================================================================
   UI/UX PRO MAX - RESPONSIVE ENHANCEMENTS FOR TABLET & MOBILE
   Breakpoints: Mobile (<= 640px), Tablet (641px - 1024px)
   Features: Touch targets >= 44px, Safe Areas, Card Grids, Zero Horizontal Overflow
   ========================================================================== */

/* ── 1. Header & Navigation Ergonomics ── */
@media (max-width: 768px) {
  .site-header {
    height: 3.75rem;
  }
  .header-inner {
    height: 3.75rem;
    gap: 0.5rem;
  }
  .brand-logo {
    font-size: 1.125rem;
    gap: 0.4rem;
  }
  .brand-logo img {
    height: 28px !important;
  }
  .logo-icon-wrapper {
    width: 32px;
    height: 32px;
  }
  .header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }
  .header-auth-btn {
    min-height: 34px !important;
    padding: 0.25rem 0.65rem !important;
    font-size: 0.78125rem !important;
    border-radius: var(--radius-sm) !important;
  }
  /* Trên màn hình điện thoại (<520px), ẩn bớt nút Đăng ký trên header để giao diện thoáng sạch vì đã có ở Bottom Nav / Form */
  .header-register-btn {
    display: none !important;
  }
  .wallet-badge-btn {
    padding: 0.25rem 0.55rem;
    font-size: 0.75rem;
  }
  .btn-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }
}


/* ── 2. Hero Section & Converter Card (Mobile & Tablet) ── */
@media (max-width: 991px) {
  .hero-layout-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .hero-converter-pane {
    width: 100%;
  }
  .hero-leaderboard-card-pro {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .hero-section {
    padding: 1.25rem 0 1.5rem 0 !important;
  }
  .hero-header {
    margin-bottom: 1.25rem;
  }
  .hero-title {
    font-size: 1.625rem;
    line-height: 1.25;
    margin-bottom: 0.5rem;
  }
  .hero-desc {
    font-size: 0.875rem;
    line-height: 1.5;
  }
  .converter-card-pro {
    padding: 1.125rem;
    border-radius: var(--radius-lg);
  }
  .converter-header-row {
    gap: 0.625rem;
    margin-bottom: 0.875rem;
  }
  .converter-icon-badge {
    width: 38px;
    height: 38px;
  }
  .converter-title-text {
    font-size: 1rem;
  }
  .converter-subtitle-text {
    font-size: 0.75rem;
  }
  .input-hero-container {
    flex-direction: column;
    gap: 0.625rem;
  }
  .input-hero-field {
    height: 48px;
    padding-left: 2.75rem;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
  }
  .input-hero-field-wrap .field-icon {
    left: 0.875rem;
  }
  .btn-convert-submit {
    height: 48px;
    width: 100%;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    min-height: 48px;
  }
  .converter-trust-badges {
    gap: 0.625rem;
    margin-top: 0.875rem;
    padding-top: 0.75rem;
  }
  .trust-badge-item {
    font-size: 0.6875rem;
  }
  
  /* Leaderboard on mobile */
  .hero-leaderboard-card-pro {
    padding: 1.125rem;
    border-radius: var(--radius-lg);
  }
  .rank-card-row {
    padding: 0.625rem 0.75rem;
    gap: 0.625rem;
  }
  .rank-pos-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
  }
  .rank-user-title {
    font-size: 0.75rem;
  }
  .cashback-stat-number {
    font-size: 0.8125rem;
  }
  .orders-stat-label {
    font-size: 0.625rem;
  }
}

/* ── 3. Category Grid Touch Tuning (Mobile & Tablet) ── */
@media (max-width: 640px) {
  .category-strip {
    padding: 1rem 0;
  }
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
  .category-item-card {
    padding: 0.75rem 0.35rem;
    border-radius: var(--radius-md);
  }
  .cat-icon-circle {
    width: 44px;
    height: 44px;
  }
  .cat-name {
    font-size: 0.71875rem;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
  }
}

/* ── 4. Product Cards Grid & Touch Targets (Tablet 3-col / Mobile 2-col) ── */
@media (max-width: 640px) {
  .products-grid-feed {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .card-body-content {
    padding: 0.625rem;
    gap: 0.35rem;
  }
  .card-product-name {
    font-size: 0.8125rem;
    min-height: 2.6em;
    line-height: 1.35;
    margin-bottom: 0.25rem;
  }
  .card-current-price {
    font-size: 0.9375rem;
  }
  .card-original-price {
    font-size: 0.6875rem;
  }
  .card-cashback-pill {
    padding: 0.25rem 0.45rem;
    font-size: 0.6875rem;
    margin-bottom: 0.4rem;
  }
  .card-meta-sales {
    font-size: 0.6875rem;
  }
  .card-action-group {
    margin-top: 0.4rem !important;
  }
  .card-action-group .btn-shopee {
    font-size: 0.71875rem !important;
    padding: 0.45rem 0.2rem !important;
    min-height: 38px;
  }
  .btn-reconvert-card {
    padding: 0.45rem !important;
    min-width: 38px;
    min-height: 38px;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .products-grid-feed {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  .card-product-name {
    font-size: 0.84375rem;
  }
}

/* ── 5. Steps & Transparent Statistics Layout ── */
.steps-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: stretch;
}

@media (min-width: 992px) {
  .steps-stats-grid {
    grid-template-columns: 1.25fr 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 640px) {
  .steps-stats-grid {
    gap: 1.5rem;
  }
}

/* ── 6. CSKH / Contact Center Grid (Mobile & Tablet) ── */
.cskh-office-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 992px) {
  .cskh-office-grid {
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
  }
}

.cskh-form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .cskh-form-row {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

/* ── 7. Account Dashboard & Wallet Grid (Mobile & Tablet) ── */
@media (max-width: 991px) {
  .wallet-hero-grid {
    grid-template-columns: 1fr;
  }
  .balance-numbers {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }
  .wallet-balance-card {
    padding: 1.25rem;
  }
}

@media (max-width: 640px) {
  .balance-numbers {
    grid-template-columns: 1fr 1fr !important;
  }
  .balance-item-value {
    font-size: 1.0625rem;
  }
  .balance-item-label {
    font-size: 0.71875rem;
  }
  .account-tab-btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
  }
}

/* ── 8. Mobile Bottom Navigation Touch Optimizations ── */
.mobile-bottom-nav {
  height: 60px;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--surface-glass-border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

.bottom-nav-item {
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

/* ── 9. Form Inputs & Touch Targets on iOS / Android ── */
@media (max-width: 640px) {
  input, select, textarea, button {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
  }
  .form-input {
    height: 44px;
  }
  .btn-sm {
    min-height: 40px;
    padding: 0.4rem 0.875rem;
  }
  .section-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.625rem;
  }
  .section-header-bar .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── 10. Precision Micro-tuning for 375px (iPhone SE, 7, 8) and Narrow Mobile ── */
@media (max-width: 390px) {
  .container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  .header-actions {
    gap: 0.35rem;
  }
  .brand-logo {
    gap: 0.35rem;
    font-size: 1.0625rem;
  }
  .brand-logo span {
    font-size: 1.0625rem !important;
  }
  .btn-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }
  .products-grid-feed {
    gap: 0.45rem !important;
  }
  .card-body-content {
    padding: 0.5rem !important;
  }
  .card-product-name {
    font-size: 0.75rem !important;
    min-height: 2.5em !important;
  }
  .card-current-price {
    font-size: 0.875rem !important;
  }
  .card-cashback-pill {
    padding: 0.2rem 0.35rem !important;
    font-size: 0.625rem !important;
  }
  .card-action-group .btn-shopee {
    font-size: 0.6875rem !important;
    padding: 0.4rem 0.15rem !important;
  }
  .btn-reconvert-card {
    min-width: 34px !important;
    padding: 0.35rem !important;
  }
  .cat-name {
    font-size: 0.6875rem !important;
  }
  .cat-icon-circle {
    width: 40px !important;
    height: 40px !important;
  }
  .cat-icon-circle svg {
    width: 18px !important;
    height: 18px !important;
  }
}

/* ── 11. Strict Zero-Overflow & Complete Viewport Shield (WEBSITE_ANALYSIS_AND_AI_GUIDE.md) ── */
html, body {
  max-width: 100vw !important;
  overflow-x: hidden !important;
  position: relative;
}

body {
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0 !important;
  }
}

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

img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

.container {
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Float Bubbles Avoid Bottom Nav & Content Cut-off */
@media (max-width: 768px) {
  #floating-bubbles-container {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    right: 12px !important;
    gap: 8px !important;
  }
  #contactBubbleBtn, #chatbotBubbleBtn {
    width: 46px !important;
    height: 46px !important;
  }
  #contactPopupCard, #chatbotPopupCard {
    width: calc(100vw - 24px) !important;
    max-width: 340px !important;
    bottom: calc(65px + env(safe-area-inset-bottom, 0px)) !important;
    right: 0 !important;
  }
}

/* Safe Area Inset for Mobile Bottom Nav */
.mobile-bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  height: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   12. MOBILE & TABLET RESPONSIVE — ĐẦY ĐỦ MỌI KÍCH THƯỚC MÀN HÌNH
   ═══════════════════════════════════════════════════════════════════════
   320×568 | 360×640 | 360×800 | 375×667 | 375×812 | 390×844
   393×873 | 412×915 | 414×896 | 428×926 | 430×932 | 480×960
   ═══════════════════════════════════════════════════════════════════════ */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BASE RESET — Ngăn tràn ngang tuyệt đối trên mọi element
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
*, *::before, *::after { box-sizing: border-box; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ACCOUNT PAGE TABS — Scroll ngang không thanh cuộn
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.account-tabs-nav-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
  width: 100%;
}
.account-tabs-nav-scroll::-webkit-scrollbar { display: none; }
.account-tab-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   DATA TABLES — Wrapper cuộn ngang (áp dụng toàn site)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.table-responsive-card {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table, .admin-table {
  min-width: 560px;
  width: 100%;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ADMIN SIDEBAR BACKDROP
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.admin-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 95;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  display: none;
}
.admin-sidebar-backdrop.active { opacity: 1; visibility: visible; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ACCOUNT PAGE — Fix VIP progress card text wrap & overflow
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.vip-progress-header {
  flex-wrap: wrap !important;
  gap: 0.25rem !important;
}
.vip-progress-desc {
  white-space: normal !important;
  word-break: break-word !important;
  overflow: visible !important;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SAFE AREA (iPhone notch / Dynamic Island)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mobile-bottom-nav {
  padding-bottom: max(0px, env(safe-area-inset-bottom)) !important;
  height: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
}
body.admin-body {
  padding-bottom: 0 !important;
}

/* ════════════════════════════════════════════════════════════════════
   ≤ 1024px — Tablet / Màn hình lớn: sidebar ẩn
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .admin-sidebar-backdrop { display: block; }

  .admin-sidebar {
    position: fixed !important;
    top: 0 !important; left: 0 !important; bottom: 0 !important;
    width: 272px !important;
    max-width: 85vw !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1) !important;
    z-index: 100 !important;
    overflow-y: auto !important;
  }
  .admin-sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 4px 0 40px rgba(0,0,0,0.45) !important;
  }
  .admin-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }
  .admin-topbar { padding: 0 1rem !important; }

  /* Tables cuộn ngang trong glass-card */
  .glass-card > div[style*="overflow"],
  .glass-card > form > div[style*="overflow"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
   ≤ 768px — Mobile & Tablet nhỏ
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Container padding ── */
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ── Account header ── */
  .account-header-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }
  .account-header-row .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* ── Wallet hero card ── */
  .wallet-balance-card {
    padding: 1rem !important;
    gap: 0.875rem !important;
  }
  .balance-numbers {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.625rem !important;
  }
  .balance-item-value { font-size: 0.9375rem !important; }
  .balance-item-label { font-size: 0.6875rem !important; }

  /* ── Account tabs ── */
  .account-tab-btn {
    padding: 0.4rem 0.65rem !important;
    font-size: 0.78125rem !important;
    gap: 0.3rem !important;
  }
  .account-tab-btn svg { width: 14px !important; height: 14px !important; }

  /* ── VIP card text wrap fix ── */
  .glass-card [style*="justify-content: space-between"][style*="font-size: 0.8125rem"] {
    flex-wrap: wrap !important;
    gap: 0.25rem !important;
  }
  .glass-card [style*="0.725rem"] {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  /* ── Admin topbar ── */
  .admin-topbar {
    height: 56px !important;
    padding: 0 0.875rem !important;
    gap: 0.5rem !important;
  }
  .admin-topbar > div:first-child { min-width: 0 !important; overflow: hidden !important; }
  .admin-topbar .page-title-text {
    font-size: 0.9rem !important;
    max-width: 160px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .admin-topbar-actions { gap: 0.35rem !important; }
  .admin-topbar-actions .btn-label { display: none !important; }
  .admin-topbar-actions .btn {
    height: 34px !important;
    padding: 0 0.5rem !important;
    min-width: 34px !important;
    justify-content: center !important;
    font-size: 0 !important; /* hide any leftover text */
  }
  .admin-topbar-actions .btn svg { font-size: initial !important; }

  /* ── Admin content padding ── */
  .admin-content-body { padding: 0 0.875rem 2rem 0.875rem !important; }
  .admin-alerts-wrap  { padding: 0.75rem 0.875rem 0 !important; }

  /* ── Admin glass cards ── */
  .glass-card { padding: 0.875rem !important; }

  /* ── Settings tabs scroll ── */
  .settings-tabs-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  .settings-tabs-wrapper::-webkit-scrollbar { display: none !important; }
  .settings-tab-btn {
    white-space: nowrap !important;
    padding: 0.4rem 0.65rem !important;
    font-size: 0.75rem !important;
  }

  /* ── Stats / metric grids ── */
  .stats-grid, .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.625rem !important;
  }

  /* ── Modal ── */
  .modal-box {
    width: calc(100vw - 1.5rem) !important;
    max-width: 100% !important;
    margin: 0.75rem auto !important;
    max-height: calc(100dvh - 1.5rem) !important;
    overflow-y: auto !important;
    border-radius: var(--radius-xl) !important;
  }

  /* ── Section / card header rows ── */
  .section-header, .card-header-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  /* ── Data table cells ── */
  .data-table th, .admin-table th {
    padding: 0.45rem 0.55rem !important;
    font-size: 0.6875rem !important;
    white-space: nowrap !important;
  }
  .data-table td, .admin-table td {
    padding: 0.55rem 0.55rem !important;
    font-size: 0.78125rem !important;
  }

  /* ── Floating bubbles above bottom nav ── */
  #floating-bubbles-container {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    right: 10px !important;
    gap: 8px !important;
  }
  #contactBubbleBtn, #chatbotBubbleBtn {
    width: 44px !important; height: 44px !important;
  }
  #contactPopupCard, #chatbotPopupCard {
    width: calc(100vw - 20px) !important;
    max-width: 340px !important;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
    right: 0 !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
   ≤ 640px — iPhone SE, Galaxy A, small Android
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* ── Account ── */
  .wallet-balance-card { padding: 0.875rem !important; }
  .balance-numbers {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
  .balance-item-value { font-size: 0.9rem !important; }
  .account-tab-btn {
    padding: 0.375rem 0.55rem !important;
    font-size: 0.73125rem !important;
  }

  /* ── Admin topbar ── */
  .admin-topbar { height: 50px !important; padding: 0 0.625rem !important; }
  .admin-topbar .page-title-text {
    font-size: 0.85rem !important;
    max-width: 130px !important;
  }
  .admin-topbar-actions .btn {
    height: 32px !important;
    padding: 0 0.4rem !important;
    min-width: 32px !important;
  }

  /* ── Admin body ── */
  .admin-content-body { padding: 0 0.625rem 2rem !important; }
  .admin-alerts-wrap  { padding: 0.625rem 0.625rem 0 !important; }

  /* ── Settings tabs ── */
  .settings-tab-btn {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.6875rem !important;
  }

  /* ── Stats ── */
  .stats-grid, .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  /* ── Cards ── */
  .glass-card { padding: 0.75rem !important; border-radius: var(--radius-lg) !important; }

  /* ── Buttons ── */
  .btn-sm { height: 34px !important; padding: 0 0.55rem !important; font-size: 0.78125rem !important; }

  /* ── Tables ── */
  .data-table th, .admin-table th {
    padding: 0.375rem 0.45rem !important; font-size: 0.625rem !important;
  }
  .data-table td, .admin-table td {
    padding: 0.45rem 0.45rem !important; font-size: 0.73125rem !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
   ≤ 480px — Extra small (360×640, 360×800, 320×568)
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

  /* ── Wallet ── */
  .wallet-balance-card { padding: 0.75rem !important; }
  .balance-numbers { grid-template-columns: 1fr 1fr !important; gap: 0.4rem !important; }
  .balance-item-value { font-size: 0.875rem !important; }
  .balance-item-label { font-size: 0.625rem !important; }

  /* ── Products ── */
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  /* ── Cards ── */
  .glass-card { padding: 0.625rem !important; }

  /* ── Stats ── */
  .stats-grid, .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.4rem !important;
  }

  /* ── Admin sidebar narrower ── */
  .admin-sidebar {
    width: 255px !important;
    max-width: 86vw !important;
  }

  /* ── Account tab buttons smaller ── */
  .account-tab-btn {
    padding: 0.3rem 0.45rem !important;
    font-size: 0.6875rem !important;
    gap: 0.2rem !important;
  }
  .account-tab-btn svg { width: 13px !important; height: 13px !important; }
}

/* ════════════════════════════════════════════════════════════════════
   ≤ 375px — iPhone SE 1st/2nd gen (375×667)
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 375px) {
  .admin-topbar .page-title-text {
    max-width: 110px !important;
    font-size: 0.8125rem !important;
  }
  .balance-item-value { font-size: 0.8125rem !important; }
  .glass-card { padding: 0.5625rem !important; }
}

/* ════════════════════════════════════════════════════════════════════
   ≤ 360px — Small Android (360×640, 360×800)
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  .admin-topbar { padding: 0 0.5rem !important; }
  .admin-topbar .page-title-text { max-width: 95px !important; }
  .account-tab-btn { padding: 0.25rem 0.4rem !important; font-size: 0.625rem !important; }
  .container { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
  .glass-card { padding: 0.5rem !important; }
  .balance-item-value { font-size: 0.75rem !important; }
}

/* ════════════════════════════════════════════════════════════════════
   ≤ 320px — Tiny screens (320×568)
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 320px) {
  .admin-topbar { padding: 0 0.375rem !important; height: 46px !important; }
  .admin-topbar .page-title-text { max-width: 75px !important; font-size: 0.75rem !important; }
  .admin-topbar-actions .btn { min-width: 28px !important; height: 28px !important; padding: 0 0.3rem !important; }
  .container { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
  .glass-card { padding: 0.4375rem !important; border-radius: var(--radius-md) !important; }
  .account-tab-btn { padding: 0.2rem 0.35rem !important; font-size: 0.5625rem !important; }
  .balance-numbers { gap: 0.3rem !important; }
  .balance-item-value { font-size: 0.6875rem !important; }
  .balance-item-label { font-size: 0.5625rem !important; }
  .stats-grid, .metrics-grid { gap: 0.3rem !important; }
}

/* ════════════════════════════════════════════════════════════════════
   UTILITY: Force table scroll inside glass-card on all mobiles
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .glass-card .table-wrap,
  .glass-card > div > table,
  .glass-card > form > div > table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
}

/* ════════════════════════════════════════════════════════════════════
   ACCESSIBILITY: Reduced motion
   ════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .admin-sidebar, .admin-sidebar-backdrop, .mobile-bottom-nav {
    transition: none !important;
  }
}


/* ────────────────────────────────────────────────────────────────
   BASE: Chống tràn ngang tuyệt đối, áp dụng toàn bộ elements
   ──────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

/* ────────────────────────────────────────────────────────────────
   ACCOUNT PAGE: Tab Navigation Scrollable
   ──────────────────────────────────────────────────────────────── */
.account-tabs-nav-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
  width: 100%;
}
.account-tabs-nav-scroll::-webkit-scrollbar { display: none; }
.account-tab-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ────────────────────────────────────────────────────────────────
   DATA TABLES: Horizontal scroll wrapper (áp dụng mọi trang)
   ──────────────────────────────────────────────────────────────── */
.table-responsive-card {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table,
.admin-table {
  min-width: 580px;
  width: 100%;
}

/* ────────────────────────────────────────────────────────────────
   ADMIN SIDEBAR BACKDROP
   ──────────────────────────────────────────────────────────────── */
.admin-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 95;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  display: none;
}
@media (max-width: 1024px) {
  .admin-sidebar-backdrop { display: block; }
}
.admin-sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* ════════════════════════════════════════════════════════════════
   BREAKPOINT ≤ 1024px — Tablet & Large Mobile
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  /* Admin: Sidebar slides off-screen */
  .admin-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 272px !important;
    max-width: 85vw !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1) !important;
    z-index: 100 !important;
    box-shadow: 4px 0 32px rgba(0,0,0,0.35) !important;
    overflow-y: auto !important;
  }
  .admin-sidebar.open {
    transform: translateX(0) !important;
  }
  /* Admin main takes full width */
  .admin-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
  }
  .admin-topbar {
    padding: 0 1rem !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   BREAKPOINT ≤ 768px — Mobile & Small Tablet
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── GLOBAL CONTAINERS ── */
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ── ACCOUNT PAGE HERO WALLET CARD ── */
  .wallet-balance-card {
    padding: 1.1rem !important;
    gap: 0.875rem !important;
  }
  .balance-numbers {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.625rem !important;
  }
  .balance-item-value {
    font-size: 1rem !important;
  }
  .balance-item-label {
    font-size: 0.6875rem !important;
  }
  .account-header-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.625rem !important;
  }
  .account-header-row .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* ── ACCOUNT TABS ── */
  .account-tab-btn {
    padding: 0.45rem 0.7rem !important;
    font-size: 0.78125rem !important;
    gap: 0.3rem !important;
  }
  .account-tab-btn svg {
    width: 14px !important;
    height: 14px !important;
  }

  /* ── ADMIN TOPBAR ── */
  .admin-topbar {
    height: 56px !important;
    padding: 0 0.875rem !important;
  }
  .admin-topbar .page-title-text {
    font-size: 0.9375rem !important;
    max-width: 150px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .admin-topbar-actions {
    gap: 0.35rem !important;
  }
  .admin-topbar-actions .btn span {
    display: none !important;
  }
  .admin-topbar-actions .btn {
    height: 34px !important;
    padding: 0 0.5rem !important;
    min-width: 34px !important;
    justify-content: center !important;
  }

  /* ── ADMIN CONTENT AREA ── */
  .admin-content-body {
    padding: 0 0.875rem 2rem 0.875rem !important;
  }
  .admin-alerts-wrap {
    padding: 0.75rem 0.875rem 0 0.875rem !important;
  }

  /* ── ADMIN TOOLBAR (search + action buttons) ── */
  .admin-toolbar-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.625rem !important;
  }
  .admin-toolbar-row form {
    flex-direction: column !important;
    max-width: 100% !important;
  }
  .admin-toolbar-row form input,
  .admin-toolbar-row form select {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ── ADMIN DATA TABLE WRAPPERS ── */
  .glass-card {
    padding: 0.875rem !important;
  }
  /* Wrap any overflow-x: auto div that contains a table */
  .glass-card > div[style*="overflow-x"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* ── DATA TABLE CELLS ── */
  .data-table th,
  .admin-table th {
    padding: 0.5rem 0.6rem !important;
    font-size: 0.6875rem !important;
    white-space: nowrap !important;
  }
  .data-table td,
  .admin-table td {
    padding: 0.6rem 0.6rem !important;
    font-size: 0.78125rem !important;
  }

  /* ── SETTINGS PAGE TABS ── */
  .settings-tab-btn {
    padding: 0.4rem 0.65rem !important;
    font-size: 0.75rem !important;
    white-space: nowrap !important;
  }

  /* ── STATS / METRIC CARDS GRID ── */
  .stats-grid,
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  /* ── MODAL ADJUSTMENTS ── */
  .modal-box {
    width: calc(100vw - 2rem) !important;
    max-width: 100% !important;
    margin: 1rem !important;
    max-height: calc(100dvh - 2rem) !important;
    overflow-y: auto !important;
  }

  /* ── GLASS CARD / SECTION HEADER ROWS ── */
  .section-header,
  .card-header-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  /* ── FLOATING BUBBLES ── */
  #floating-bubbles-container {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    right: 10px !important;
    gap: 8px !important;
  }
  #contactBubbleBtn, #chatbotBubbleBtn {
    width: 44px !important;
    height: 44px !important;
  }
  #contactPopupCard, #chatbotPopupCard {
    width: calc(100vw - 20px) !important;
    max-width: 340px !important;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
    right: 0 !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   BREAKPOINT ≤ 640px — Small Mobile (iPhone SE, Galaxy A series)
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* ── ACCOUNT WALLET ── */
  .wallet-balance-card {
    padding: 1rem !important;
  }
  .balance-numbers {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  /* ── ACCOUNT TABS ── */
  .account-tab-btn {
    padding: 0.4rem 0.6rem !important;
    font-size: 0.75rem !important;
  }

  /* ── ADMIN TOPBAR ── */
  .admin-topbar {
    height: 52px !important;
    padding: 0 0.625rem !important;
  }
  .admin-topbar .page-title-text {
    font-size: 0.875rem !important;
    max-width: 120px !important;
  }
  .admin-topbar-actions .btn {
    height: 30px !important;
    padding: 0 0.4rem !important;
  }

  /* ── ADMIN CONTENT ── */
  .admin-content-body {
    padding: 0 0.625rem 2rem 0.625rem !important;
  }
  .admin-alerts-wrap {
    padding: 0.625rem 0.625rem 0 0.625rem !important;
  }

  /* ── SETTINGS TABS ── */
  .settings-tab-btn {
    padding: 0.35rem 0.55rem !important;
    font-size: 0.6875rem !important;
  }

  /* ── STATS CARDS ── */
  .stats-grid,
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  /* ── GLASS CARDS ── */
  .glass-card {
    padding: 0.75rem !important;
    border-radius: var(--radius-lg) !important;
  }

  /* ── BUTTONS ── */
  .btn-sm {
    height: 34px !important;
    padding: 0 0.6rem !important;
    font-size: 0.78125rem !important;
  }

  /* ── DATA TABLE ── */
  .data-table th,
  .admin-table th {
    padding: 0.4rem 0.5rem !important;
    font-size: 0.625rem !important;
  }
  .data-table td,
  .admin-table td {
    padding: 0.5rem 0.5rem !important;
    font-size: 0.75rem !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   BREAKPOINT ≤ 480px — Extra Small Mobile (≤ 480px)
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

  /* ── STATS CARDS → single column on very small ── */
  .stats-grid,
  .metrics-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  /* ── PRODUCT GRID ── */
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  /* ── ACCOUNT WALLET BALANCE ── */
  .balance-numbers {
    grid-template-columns: 1fr 1fr !important;
  }
  .balance-item-value {
    font-size: 0.9375rem !important;
  }

  /* ── GLASS CARD ── */
  .glass-card {
    padding: 0.625rem !important;
  }

  /* ── ADMIN SIDEBAR CLOSE BUTTON ── */
  .admin-sidebar {
    width: 260px !important;
    max-width: 88vw !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   SAFE AREA INSETS (iPhone notch / Dynamic Island)
   ════════════════════════════════════════════════════════════════ */
.mobile-bottom-nav {
  padding-bottom: max(0px, env(safe-area-inset-bottom)) !important;
  height: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Admin body on mobile should NOT have bottom nav padding */
body.admin-body {
  padding-bottom: 0 !important;
}

/* ════════════════════════════════════════════════════════════════
   UTILITY: Force tables inside glass-card to scroll on mobile
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .glass-card .table-wrap,
  .glass-card > div > table,
  .glass-card > form > div > table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
}

/* ════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE ENHANCEMENT SUITE (vvhkxcl Standards)
   ════════════════════════════════════════════════════════════════ */
/* 1. Universal Container & Horizontal Scroll Safety */
html, body {
  max-width: 100vw;
  overflow-x: hidden !important;
}

img, svg, video, iframe {
  max-width: 100%;
  height: auto;
}

/* Account Layout Grid */
.account-grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  width: 100%;
}

@media (min-width: 1024px) {
  .account-grid-layout {
    grid-template-columns: 360px 1fr;
    gap: 1.75rem;
    align-items: start;
  }
}

.account-left-col,
.account-right-col {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Admin Dashboard Mobile Responsiveness (Scoped to <= 1024px to preserve Desktop layout) */
@media (max-width: 1024px) {
  .admin-main {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    overflow-x: hidden !important;
  }
  .admin-topbar {
    width: 100% !important;
    max-width: 100vw !important;
  }
  .admin-content-body {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1rem !important;
  }
}

@media (min-width: 1025px) {
  .admin-main {
    margin-left: var(--admin-sidebar-width, 260px) !important;
    width: calc(100% - var(--admin-sidebar-width, 260px)) !important;
    max-width: calc(100vw - var(--admin-sidebar-width, 260px)) !important;
    flex: 1 1 auto;
    min-width: 0;
  }
  .admin-topbar {
    width: 100%;
    max-width: 100%;
  }
  .admin-content-body {
    width: 100%;
    max-width: 100%;
    padding: 1.75rem 2rem 3rem 2rem !important;
    box-sizing: border-box;
  }
  .lg\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Fix table container on small screens */
.table-responsive,
.data-table-wrap {
  width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* 2. Hero Layout Grid (Home Page) Responsive */
.hero-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  width: 100%;
}

@media (min-width: 1024px) {
  .hero-layout-grid {
    grid-template-columns: 1.35fr 1fr;
    align-items: start;
    gap: 2rem;
  }
}

.hero-converter-pane,
.hero-leaderboard-card-pro,
.converter-card-pro {
  width: 100%;
  min-width: 0;
}

.converter-card-pro {
  background: var(--surface-glass);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}

.converter-header-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

.converter-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}

.converter-title-text {
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  font-weight: 800;
  line-height: 1.3;
}

.converter-subtitle-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.input-hero-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

@media (min-width: 640px) {
  .input-hero-container {
    flex-direction: row;
    align-items: stretch;
  }
}

.input-hero-field-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.input-hero-field-wrap .field-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
  display: flex;
}

.input-hero-field {
  width: 100%;
  height: 50px;
  padding: 0 1rem 0 3rem;
  font-size: 0.9375rem;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-light);
  background: var(--surface-card);
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.input-hero-field:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.18);
}

.btn-convert-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 50px;
  padding: 0 1.5rem;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9375rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(16,185,129,0.35);
  transition: all 0.2s ease;
  min-height: 44px;
}

.btn-convert-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16,185,129,0.45);
}

.converter-trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-light);
}

.trust-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.trust-badge-item svg {
  color: var(--primary-500);
}

/* 3. Leaderboard Pro Responsive */
.hero-leaderboard-card-pro {
  background: var(--surface-glass);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.leaderboard-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.leaderboard-headline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.trophy-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.leaderboard-title-pro {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
}

.leaderboard-subtitle-pro {
  font-size: 0.78125rem;
  color: var(--text-muted);
}

.live-indicator-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  background: rgba(239,68,68,0.12);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.leaderboard-rows-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rank-card-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem;
  background: var(--surface-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}

.rank-card-row.rank-1 {
  background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(245,158,11,0.02));
  border-color: rgba(245,158,11,0.3);
}

.rank-pos-wrap {
  position: relative;
  flex-shrink: 0;
}

.rank-pos-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-card);
  border: 1.5px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8125rem;
  color: var(--text-main);
}

.rank-1 .rank-pos-avatar {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border-color: #f59e0b;
}

.rank-pill-tag {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-600);
  color: #fff;
  font-size: 0.5625rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rank-1 .rank-pill-tag {
  background: #b45309;
}

.rank-details-col {
  flex: 1;
  min-width: 0;
}

.rank-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.rank-user-title {
  font-weight: 700;
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tier-pill {
  font-size: 0.625rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.tier-vip {
  background: rgba(245,158,11,0.2);
  color: #b45309;
}

.tier-member {
  background: var(--surface-card);
  color: var(--text-muted);
}

.rank-value-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.cashback-stat-number {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.875rem;
  color: var(--primary-600);
}

.orders-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.leaderboard-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.78125rem;
  color: var(--text-muted);
}

.leaderboard-card-footer a {
  color: var(--primary-600);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* 4. Category Grid Fluid Responsive */
.category-strip {
  padding: 1.5rem 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.625rem;
}

@media (min-width: 640px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
  }
}

.category-item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 0.5rem;
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  min-height: 90px;
}

.category-item-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-500);
}

.cat-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-card-subtle);
  color: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.category-item-card:hover .cat-icon-circle {
  background: var(--primary-500);
  color: #fff;
}

.cat-name {
  font-size: 0.78125rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

/* 5. Account Navigation Tabs Horizontal Swipe on Mobile */
.account-tabs-nav-scroll {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100%;
  padding-bottom: 4px;
}

.account-tabs-nav-scroll::-webkit-scrollbar {
  display: none;
}

.account-tab-btn {
  flex-shrink: 0;
  min-height: 38px;
}

/* ════════════════════════════════════════════════════════════════
   6. UI/UX PRO MAX: MOBILE TYPOGRAPHY & BUTTON RESILIENCE
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  h1, .hero-title {
    font-size: clamp(1.4rem, 5vw, 1.75rem) !important;
    line-height: 1.25 !important;
  }

  h2, .section-title {
    font-size: clamp(1.15rem, 4.2vw, 1.4rem) !important;
    line-height: 1.3 !important;
  }

  h3, .card-title {
    font-size: clamp(1rem, 3.5vw, 1.15rem) !important;
  }

  /* BUTTONS GLOBAL ON MOBILE */
  .btn, button, input[type="button"], input[type="submit"] {
    white-space: nowrap !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem !important;
    font-size: 0.8125rem !important;
    padding: 0.4rem 0.75rem !important;
    min-height: 38px !important;
    height: auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .btn span, button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
  }

  .btn svg, button svg {
    flex-shrink: 0;
  }

  .btn-sm {
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 0.625rem !important;
    font-size: 0.75rem !important;
    line-height: 30px !important;
  }

  /* Product Card Dual Action Group on Mobile */
  .card-action-group {
    display: flex !important;
    gap: 5px !important;
    align-items: stretch !important;
  }

  .card-action-group .btn-shopee {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding: 0 0.4rem !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    min-height: 34px !important;
    height: 34px !important;
    border-radius: var(--radius-md) !important;
  }

  .card-action-group .btn-reconvert-card {
    flex: 0 0 34px !important;
    width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Header in tab panes (Flex wrap to prevent overlap) */
  .account-tab-pane > div:first-child {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 0.625rem !important;
    margin-bottom: 0.875rem !important;
  }

  .account-tab-pane > div:first-child > div:first-child {
    flex: 1 1 100% !important;
    margin-bottom: 0.25rem !important;
  }

  .account-tab-pane > div:first-child > a.btn {
    align-self: flex-start !important;
    flex-shrink: 0 !important;
  }

  .header-actions .btn-sm {
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 0.55rem !important;
    font-size: 0.71875rem !important;
  }

  .wallet-badge-btn {
    padding: 0.2rem 0.55rem !important;
    font-size: 0.75rem !important;
    gap: 0.25rem !important;
    min-height: 32px !important;
    height: 32px !important;
  }

  /* Wallet balance & Stats typography */
  .wallet-balance-card {
    padding: 1.125rem 0.875rem !important;
  }

  .wallet-balance-card h1 {
    font-size: 1.5rem !important;
  }

  .balance-numbers {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
  }

  .balance-item-label {
    font-size: 0.65625rem !important;
    line-height: 1.3 !important;
  }

  .balance-item-value {
    font-size: 0.875rem !important;
  }

  .account-tab-btn {
    padding: 0.35rem 0.65rem !important;
    font-size: 0.75rem !important;
    gap: 0.3rem !important;
    min-height: 34px !important;
    height: 34px !important;
  }

  .tab-count-badge {
    font-size: 0.59375rem !important;
    padding: 0.05rem 0.3rem !important;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .card-action-group .btn-shopee {
    font-size: 0.6875rem !important;
    padding: 0 0.25rem !important;
  }

  .card-action-group .btn-shopee span {
    max-width: 100% !important;
  }

  .account-header-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .account-header-row .btn {
    width: 100% !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   PRINT SAFETY & ACCESSIBILITY
   ════════════════════════════════════════════════════════════════ */
/* ════════════════════════════════════════════════════════════════
   ADMIN TAB PILL CONTROLS (UI/UX PRO MAX)
   ════════════════════════════════════════════════════════════════ */
.tab-pill-btn {
  background: transparent;
  color: var(--text-muted);
}

.tab-pill-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab-pill-btn.active {
  background: var(--surface-card) !important;
  color: var(--primary-600) !important;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light) !important;
}

html.dark .tab-pill-btn.active {
  color: var(--primary-400) !important;
  background: #1e293b !important;
}

@media (max-width: 640px) {
  .tab-pill-btn {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.75rem !important;
    flex: 1;
    justify-content: center;
  }
}





