/* =============================================
   Vatpham.com / Phong Thủy — app.css v1.0
   DNA: kế thừa từ tenmiendangcap.com
   Palette: Đỏ son cổ điển + Vàng đồng + Cream Á đông
   ============================================= */

:root {
  /* Primary - đỏ son sậm cao cấp */
  --primary: #8B1A1A;
  --primary-700: #6B1313;
  --primary-500: #A82424;
  --primary-300: #CF7E7E;
  --primary-100: #FBE5E5;
  --primary-50: #FDF2F2;
  
  /* Gold - vàng đồng cổ */
  --gold: #C9A961;
  --gold-light: #F3E8C6;
  --gold-dark: #8F7536;
  
  /* Neutral - ngả ấm theo phong thủy */
  --cream: #FDF8F0;
  --cream-dark: #F4ECD8;
  --n-900: #1F1611;
  --n-800: #2D2218;
  --n-700: #3D3026;
  --n-600: #5B4A3D;
  --n-500: #826E5C;
  --n-400: #A89684;
  --n-300: #C9BEAE;
  --n-200: #E8DDC4;
  --n-100: #F0E8D4;
  --n-50: #F8F2E4;
  
  /* Status */
  --success: #16A34A;
  --warning: #D97706;
  --danger: #DC2626;
  --info: #2563EB;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(31,22,17,0.06);
  --shadow: 0 4px 12px rgba(139,26,26,0.08);
  --shadow-lg: 0 10px 24px rgba(139,26,26,0.12);
  --shadow-gold: 0 4px 14px rgba(201,169,97,0.25);
  
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--n-800);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-700); }

h1, h2, h3, h4 { color: var(--n-900); line-height: 1.3; margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
@media (min-width: 768px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
}
p { margin: 0 0 1em; }

.mono { font-family: "JetBrains Mono", "SF Mono", Consolas, Monaco, monospace; letter-spacing: -0.01em; }

/* === Layout === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 14px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 14px; }

/* === Buttons === */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border: 1px solid transparent; border-radius: var(--radius); font-weight: 600; font-size: 14.5px; cursor: pointer; transition: all .15s; text-decoration: none; font-family: inherit; line-height: 1.4; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-700); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-50); color: var(--primary-700); }
.btn-gold { background: var(--gold); color: var(--n-900); border-color: var(--gold); font-weight: 700; }
.btn-gold:hover { background: var(--gold-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--n-700); }
.btn-ghost:hover { background: var(--n-100); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-zalo { background: #0068FF; color: #fff; border-color: #0068FF; }
.btn-zalo:hover { background: #0050C7; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* === Badges === */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-hot { background: #FED7D7; color: #C53030; }
.badge-new { background: var(--primary-100); color: var(--primary-700); }
.badge-sale { background: var(--gold-light); color: #744210; }
.badge-featured { background: linear-gradient(90deg, #F6E05E, var(--gold)); color: #744210; }
.badge-vip { background: linear-gradient(90deg, var(--gold), var(--gold-dark)); color: #fff; }
.badge-stock-low { background: #FED7AA; color: #9A3412; }
.badge-stock-out { background: var(--n-200); color: var(--n-500); }

/* === Forms === */
.form-group { margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; color: var(--n-700); }
.form-control, input[type=text], input[type=email], input[type=tel], input[type=url], input[type=number], input[type=password], input[type=search], textarea, select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--n-300);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--n-900);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}
textarea { min-height: 100px; resize: vertical; font-family: inherit; }
.form-hint { color: var(--n-500); font-size: 13px; margin-top: 4px; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 4px; font-weight: 500; }
.required::after { content: " *"; color: var(--danger); }

/* === Cards === */
.card { background: #fff; border: 1px solid var(--n-200); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.card-hover { transition: transform .15s, box-shadow .15s, border-color .15s; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary-300); }

/* === Alerts === */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.alert-success { background: #F0FDF4; color: #14532D; border-color: #86EFAC; }
.alert-error, .alert-danger { background: #FEF2F2; color: #7F1D1D; border-color: #FCA5A5; }
.alert-warning { background: #FFFBEB; color: #78350F; border-color: var(--gold); }
.alert-info { background: #EFF6FF; color: #1E3A8A; border-color: #93C5FD; }

/* =============================================
   TOPBAR (fixed)
   ============================================= */
.topbar {
  position: fixed;
  top: 0;
  left: 0; right: 0;
  height: 56px;
  background: #fff;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 6px;
  gap: 4px;
  box-shadow: 0 1px 4px rgba(31,22,17,0.06);
  border-bottom: 1px solid var(--n-100);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 2px; }

.topbar-brand {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.topbar-brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary-700));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-light); font-weight: 800; font-size: 20px;
  box-shadow: 0 4px 10px rgba(139,26,26,0.25);
  flex-shrink: 0;
}
.topbar-brand-text {
  font-weight: 700; font-size: 15px;
  color: var(--n-900);
  line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-top: 2px;
}
.topbar-brand-text small {
  display: block;
  font-weight: 500; font-size: 9.5px;
  color: var(--gold-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
  line-height: 1.1;
}

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--n-700);
  padding: 0;
  position: relative;
  text-decoration: none;
}
.icon-btn:active { background: var(--n-100); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .badge-count {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  line-height: 1;
}

/* =============================================
   DRAWER (slide from left)
   ============================================= */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.drawer-overlay.active { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; bottom: 0;
  left: 0;
  width: 320px; max-width: 88vw;
  background: #fff;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 20px rgba(0,0,0,0.12);
  display: flex; flex-direction: column;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.drawer.active { transform: translateX(0); }

.drawer-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--cream-dark), #fff);
  border-bottom: 1px solid var(--n-100);
}
.drawer-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  border: 0;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--n-700);
}

.drawer-user {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--n-100);
}
.drawer-user-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-light); font-weight: 700; font-size: 20px;
  flex-shrink: 0;
  text-decoration: none;
}
.drawer-user-info { flex: 1; min-width: 0; }
.drawer-user-info strong { display: block; font-size: 14.5px; color: var(--n-900); }
.drawer-user-info small { color: var(--n-500); font-size: 12px; }

.drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--n-100);
}
.drawer-action-btn {
  background: var(--n-50);
  border: 0;
  border-radius: 10px;
  padding: 10px 6px;
  font-size: 12px;
  color: var(--n-700);
  text-align: center;
  text-decoration: none;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-family: inherit;
}
.drawer-action-btn:active { background: var(--primary-50); color: var(--primary-700); }
.drawer-action-btn.danger { background: #FFF5F5; color: var(--danger); }
.drawer-action-btn .icon { font-size: 18px; }

.drawer-section { padding: 14px 16px; }
.drawer-section + .drawer-section { border-top: 1px solid var(--n-100); }
.drawer-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--n-500);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.drawer-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.drawer-quick-item {
  aspect-ratio: 1.1 / 1;
  background: #fff;
  border: 1px solid var(--n-200);
  border-radius: 12px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px;
  text-decoration: none;
  color: var(--n-800);
  font-size: 12.5px; font-weight: 600;
  text-align: center;
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.drawer-quick-item:active {
  background: var(--primary-50);
  border-color: var(--primary-300);
  color: var(--primary-700);
  transform: scale(0.97);
}
.drawer-quick-item .icon { font-size: 24px; line-height: 1; }

.drawer-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 2px;
  color: var(--n-700);
  font-size: 14px;
  text-decoration: none;
  background: #fff;
  font-weight: 500;
  transition: background 0.15s;
}
.drawer-nav-item:active, .drawer-nav-item.active {
  background: var(--primary-50);
  color: var(--primary-700);
}
.drawer-nav-item .icon {
  font-size: 18px;
  width: 24px; text-align: center;
  flex-shrink: 0;
}
.drawer-nav-item .count {
  margin-left: auto;
  background: var(--n-100);
  color: var(--n-600);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

/* =============================================
   BOTTOM NAVIGATION (mobile)
   ============================================= */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--n-200);
  z-index: 90;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}
.bottom-nav a {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 4px 6px;
  gap: 2px;
  color: var(--n-500);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  min-height: 56px;
  position: relative;
  transition: color 0.15s;
}
.bottom-nav a .icon {
  font-size: 22px;
  line-height: 1;
  transition: transform 0.15s;
}
.bottom-nav a.active {
  color: var(--primary);
  font-weight: 600;
}
.bottom-nav a.active .icon {
  transform: scale(1.08) translateY(-1px);
}
.bottom-nav a .nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 8px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* =============================================
   APP MAIN
   ============================================= */
.app-main {
  padding-top: 56px;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0));
  min-height: 100vh;
  background: var(--cream);
}

body.no-scroll { overflow: hidden; position: fixed; width: 100%; }

/* =============================================
   SEARCH MODAL
   ============================================= */
.search-modal {
  position: fixed; inset: 0;
  background: #fff;
  z-index: 300;
  display: none;
  flex-direction: column;
  animation: slideUp 0.2s ease-out;
}
.search-modal.active { display: flex; }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.search-modal-header {
  display: flex; align-items: center;
  padding: 10px;
  gap: 8px;
  border-bottom: 1px solid var(--n-100);
}
.search-input-wrap {
  flex: 1;
  display: flex; align-items: center;
  background: var(--cream-dark);
  border-radius: 10px;
  padding: 0 12px;
  gap: 8px;
}
.search-input-wrap input {
  flex: 1;
  border: 0; background: transparent;
  font-size: 16px;
  padding: 10px 0;
  outline: 0;
  font-family: inherit;
  color: var(--n-900);
  box-shadow: none !important;
}
.search-input-wrap input:focus { box-shadow: none; }
.search-modal-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.search-suggest { padding: 16px; }
.search-suggest h4 {
  font-size: 11px; font-weight: 700;
  color: var(--n-500);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin: 0 0 10px;
}
.search-chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.search-chip {
  background: var(--cream-dark);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13.5px;
  color: var(--n-700);
  text-decoration: none;
  cursor: pointer;
  border: 0;
  font-family: inherit;
}
.search-chip:active { background: var(--primary-100); color: var(--primary-700); }

.search-result {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--n-100);
  text-decoration: none;
  color: inherit;
}
.search-result:active { background: var(--n-50); }
.search-result-img {
  width: 48px; height: 48px;
  background: var(--cream-dark);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-dark);
  font-size: 22px;
  flex-shrink: 0;
  overflow: hidden;
}
.search-result-img img { width: 100%; height: 100%; object-fit: cover; }
.search-result-body { flex: 1; min-width: 0; }
.search-result-body .name {
  font-weight: 600;
  color: var(--n-900);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
}
.search-result-body .meta { font-size: 11.5px; color: var(--n-500); margin-top: 2px; }
.search-result .price { font-size: 14px; font-weight: 700; color: var(--primary-700); white-space: nowrap; }
.search-empty { text-align: center; padding: 60px 20px; color: var(--n-500); }

/* =============================================
   HERO BANNER
   ============================================= */
.hero {
  background: linear-gradient(135deg, var(--cream-dark) 0%, var(--cream) 100%);
  padding: 28px 0 32px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '☯';
  position: absolute;
  top: -20px; right: -10px;
  font-size: 10rem;
  opacity: 0.06;
  color: var(--primary);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; text-align: center; }
.hero-tag {
  display: inline-block;
  background: var(--primary);
  color: var(--gold-light);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero h1 {
  color: var(--primary-700);
  margin-bottom: 8px;
  font-size: 1.6rem;
}
.hero-sub {
  color: var(--n-600);
  font-size: 14.5px;
  max-width: 600px;
  margin: 0 auto 18px;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 12px;
  color: var(--n-600);
  flex-wrap: wrap;
}
.hero-stats b { color: var(--primary-700); font-size: 15px; }
@media (min-width: 768px) {
  .hero { padding: 48px 0 56px; }
  .hero h1 { font-size: 2.25rem; }
  .hero-sub { font-size: 1rem; }
}

/* =============================================
   TRUST STRIP
   ============================================= */
.trust-strip {
  background: #fff;
  padding: 14px 0;
  border-bottom: 1px solid var(--n-200);
  overflow-x: auto;
}
.trust-strip-inner {
  display: flex;
  gap: 18px;
  justify-content: flex-start;
  align-items: center;
  font-size: 12.5px;
  color: var(--n-700);
  white-space: nowrap;
  min-width: min-content;
  padding: 0 14px;
}
.trust-strip-inner span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.trust-strip-inner .icon { color: var(--primary); font-size: 14px; }
@media (min-width: 768px) {
  .trust-strip-inner { justify-content: center; gap: 32px; padding: 0; }
}

/* =============================================
   SECTIONS
   ============================================= */
.section { padding: 28px 0; }
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.section-title h2 {
  margin: 0;
  font-size: 1.2rem;
  position: relative;
  padding-left: 12px;
}
.section-title h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--gold));
}
.section-title .link {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}
@media (min-width: 768px) {
  .section { padding: 40px 0; }
  .section-title h2 { font-size: 1.4rem; }
}

/* =============================================
   PRODUCT GRID + CARD
   ============================================= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 600px) { .product-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (min-width: 900px) { .product-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
@media (min-width: 1100px) { .product-grid { grid-template-columns: repeat(5, 1fr); } }

.product-card {
  background: #fff;
  border: 1px solid var(--n-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: all .18s;
  position: relative;
}
.product-card:hover {
  border-color: var(--primary-300);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  color: inherit;
}
.product-card .img-wrap {
  aspect-ratio: 1/1;
  background: var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.product-card .img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}
.product-card:hover .img-wrap img { transform: scale(1.06); }
.product-card .img-placeholder {
  color: var(--gold-dark);
  font-size: 2.5rem;
}
.product-card .card-badges {
  position: absolute;
  top: 8px; left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.product-card .body {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-card .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--n-900);
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 35px;
}
.product-card .sku {
  font-size: 11px;
  color: var(--gold-dark);
  font-family: "JetBrains Mono", monospace;
  margin-bottom: 6px;
}
.product-card .price-row {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}
.product-card .price-from {
  font-size: 10px;
  color: var(--n-500);
}
.product-card .price {
  color: var(--primary-700);
  font-weight: 800;
  font-size: 14.5px;
  letter-spacing: -0.01em;
}
@media (min-width: 600px) {
  .product-card .name { font-size: 14px; }
  .product-card .price { font-size: 16px; }
}

/* =============================================
   CATEGORY CHIPS (horizontal scroll)
   ============================================= */
.cat-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip {
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--n-200);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--n-700);
  text-decoration: none;
  font-weight: 500;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cat-chip:active, .cat-chip.active {
  background: var(--primary);
  color: var(--gold-light);
  border-color: var(--primary);
}

/* =============================================
   CATEGORY ICON GRID (homepage)
   ============================================= */
.cat-icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (min-width: 600px) { .cat-icon-grid { grid-template-columns: repeat(8, 1fr); } }
.cat-icon-item {
  background: #fff;
  border: 1px solid var(--n-200);
  border-radius: var(--radius-lg);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--n-800);
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  transition: all .15s;
  aspect-ratio: 1/1.1;
}
.cat-icon-item:active {
  background: var(--primary-50);
  border-color: var(--primary-300);
  color: var(--primary-700);
  transform: scale(0.96);
}
.cat-icon-item .icon { font-size: 28px; }

/* =============================================
   BREADCRUMB
   ============================================= */
.breadcrumb {
  font-size: 12.5px;
  color: var(--n-500);
  padding: 10px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  align-items: center;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb .sep { margin: 0 6px; color: var(--n-300); }

/* =============================================
   PAGE HEADING
   ============================================= */
.page-heading {
  padding: 14px 0 18px;
}
.page-heading h1 {
  font-size: 1.4rem;
  color: var(--primary-700);
  margin-bottom: 4px;
}
.page-heading .sub {
  color: var(--n-500);
  font-size: 13px;
}

/* =============================================
   PRODUCT DETAIL
   ============================================= */
.pd-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) {
  .pd-layout { grid-template-columns: minmax(0, 420px) 1fr; gap: 24px; }
}
.pd-gallery {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pd-gallery-main {
  aspect-ratio: 1/1;
  background: var(--cream-dark);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pd-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.pd-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.pd-thumb {
  aspect-ratio: 1/1;
  background: var(--cream-dark);
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
}
.pd-thumb.active { border-color: var(--primary); }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }

.pd-info { display: flex; flex-direction: column; gap: 14px; }
.pd-info h1 { font-size: 1.35rem; line-height: 1.3; margin: 0; }
.pd-sku-row { font-size: 12px; color: var(--gold-dark); }
.pd-price-block {
  background: linear-gradient(135deg, var(--primary-50), #fff);
  border-left: 4px solid var(--primary);
  padding: 14px 16px;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}
.pd-price-label { font-size: 11px; color: var(--n-500); text-transform: uppercase; letter-spacing: 0.05em; }
.pd-price { font-size: 1.6rem; font-weight: 800; color: var(--primary-700); }

.pd-variants {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 6px;
}
.pd-variant {
  border: 2px solid var(--n-200);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 12px;
  transition: all .12s;
}
.pd-variant:hover { border-color: var(--primary-300); }
.pd-variant.selected { border-color: var(--primary); background: var(--primary-50); }
.pd-variant .sku-line { font-weight: 700; color: var(--primary-700); font-family: "JetBrains Mono", monospace; font-size: 11.5px; }
.pd-variant .price-line { color: var(--n-900); font-weight: 600; margin-top: 2px; font-size: 13px; }
.pd-variant .stock-line { font-size: 10px; margin-top: 2px; }
.pd-variant .stock-yes { color: var(--success); }
.pd-variant .stock-no { color: var(--danger); }

.pd-qty {
  display: inline-flex;
  border: 2px solid var(--n-200);
  border-radius: 8px;
  overflow: hidden;
  align-items: stretch;
}
.pd-qty button {
  background: var(--n-50);
  border: 0;
  width: 38px;
  cursor: pointer;
  font-size: 18px;
  color: var(--n-700);
  font-family: inherit;
}
.pd-qty input {
  width: 56px;
  border: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  padding: 0;
  background: #fff;
  font-family: inherit;
}
.pd-qty input:focus { box-shadow: none; }

.pd-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pd-actions .btn { flex: 1; min-width: 140px; }

.pd-contact {
  background: var(--cream-dark);
  border-radius: var(--radius-lg);
  padding: 12px;
}
.pd-contact-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--n-700);
  margin-bottom: 8px;
}
.pd-contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.pd-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #fff;
  border-radius: 8px;
  text-decoration: none;
  color: var(--n-900);
  font-size: 13px;
  border: 1px solid var(--n-200);
}
.pd-contact-item .label { font-weight: 600; }
.pd-contact-item .num { color: var(--primary-700); font-weight: 700; margin-left: auto; font-family: "JetBrains Mono", monospace; }
.pd-contact-item:active { background: var(--primary-50); }

.pd-trust-mini {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.pd-trust-mini > div {
  background: var(--n-50);
  padding: 8px;
  border-radius: 6px;
  text-align: center;
  font-size: 11.5px;
  color: var(--n-700);
  font-weight: 500;
}

.pd-section {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-top: 20px;
  border: 1px solid var(--n-200);
}
.pd-section h2 {
  font-size: 1.15rem;
  color: var(--primary-700);
  border-bottom: 2px solid var(--gold);
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.pd-section .content-html img { border-radius: 6px; margin: 8px 0; }
.pd-section .content-html h1,
.pd-section .content-html h2,
.pd-section .content-html h3 { color: var(--primary-700); margin: 14px 0 8px; }
.pd-section .content-html p { margin-bottom: 10px; }

/* =============================================
   CART
   ============================================= */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--n-200);
}
.cart-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--n-100);
  align-items: center;
}
.cart-row:last-child { border-bottom: 0; }
.cart-row .img {
  width: 60px; height: 60px;
  background: var(--cream-dark);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-row .img img { width: 100%; height: 100%; object-fit: cover; }
.cart-row .name { font-size: 13px; font-weight: 600; color: var(--n-900); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-row .sku { font-size: 11px; color: var(--gold-dark); font-family: "JetBrains Mono", monospace; margin-top: 2px; }
.cart-row .meta-row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }
.cart-row .price { color: var(--primary-700); font-weight: 700; font-size: 13.5px; }
.cart-row .qty-control { display: inline-flex; border: 1px solid var(--n-200); border-radius: 6px; align-items: stretch; }
.cart-row .qty-control button { background: var(--n-50); border: 0; width: 28px; cursor: pointer; font-size: 14px; color: var(--n-700); font-family: inherit; }
.cart-row .qty-control input { width: 40px; text-align: center; border: 0; background: #fff; font-size: 13px; padding: 4px 0; font-family: inherit; }
.cart-row .remove-btn { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: 16px; padding: 4px; }

.cart-summary {
  background: #fff;
  border: 1px solid var(--n-200);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 16px;
}
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}
.cart-summary-total {
  border-top: 2px solid var(--gold);
  padding-top: 10px;
  margin-top: 8px;
  font-size: 1.1rem;
  font-weight: 800;
}
.cart-summary-total .val { color: var(--primary-700); }

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background: var(--n-900);
  color: var(--n-300);
  padding: 32px 0 18px;
  margin-top: 40px;
}
.footer a { color: var(--n-300); }
.footer a:hover { color: var(--gold); }
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.footer-grid h4 { color: var(--gold); font-size: 13px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid ul li { margin-bottom: 6px; font-size: 13px; }
.footer-hotline-block {
  background: rgba(139,26,26,0.25);
  border-left: 3px solid var(--gold);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 8px;
}
.footer-hotline-block .label { font-size: 10.5px; color: var(--gold-light); text-transform: uppercase; letter-spacing: 0.05em; }
.footer-hotline-block .number { display: block; font-size: 15px; font-weight: 700; color: #fff; font-family: "JetBrains Mono", monospace; margin-top: 2px; }
.footer-social { display: flex; gap: 10px; margin-top: 12px; }
.footer-social a {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 16px;
  transition: background .15s;
}
.footer-social a:hover { background: var(--primary); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
  font-size: 11.5px;
  color: var(--n-400);
  line-height: 1.7;
  text-align: center;
}
@media (min-width: 700px) {
  .footer-grid { grid-template-columns: 2fr 1.2fr 1fr 1fr; }
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 0 10px;
  text-decoration: none;
  border: 1px solid var(--n-200);
  background: #fff;
  color: var(--n-700);
}
.pagination a:hover { background: var(--primary-50); color: var(--primary-700); border-color: var(--primary-300); }
.pagination .current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* =============================================
   STOCK INFO
   ============================================= */
.stock-info {
  background: var(--cream-dark);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.stock-info .stock-num { font-weight: 700; color: var(--success); }

/* =============================================
   DESKTOP OVERRIDES
   ============================================= */
@media (min-width: 901px) {
  .bottom-nav { display: none; }
  .app-main { padding-bottom: 20px; }
  
  /* Topbar inline nav */
  .topbar-nav-desktop {
    display: flex;
    gap: 4px;
    margin: 0 12px;
    flex: 1;
    justify-content: center;
  }
  .topbar-nav-desktop a {
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--n-700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
  }
  .topbar-nav-desktop a:hover { background: var(--cream-dark); color: var(--primary-700); }
  .topbar-nav-desktop a.active { background: var(--primary-100); color: var(--primary-700); font-weight: 600; }
  
  .topbar-brand { flex: 0 0 auto; }
  .topbar-brand-text small { display: block; font-size: 10.5px; }
  
  /* Larger product cards desktop */
  .product-card .body { padding: 14px; }
  .product-card .name { font-size: 14.5px; min-height: 40px; }
}
@media (max-width: 900px) {
  .topbar-nav-desktop { display: none; }
}

/* =============================================
   UTILITY
   ============================================= */
.text-center { text-align: center; }
.text-muted { color: var(--n-500); }
.text-primary { color: var(--primary); }
.text-gold { color: var(--gold-dark); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* Floating contact widget (mobile - chỉ hiện khi không có bottom-nav) */
.float-contact {
  position: fixed;
  bottom: 76px;
  right: 14px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@media (min-width: 901px) {
  .float-contact { bottom: 20px; }
}
.float-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  transition: transform .15s;
}
.float-btn:hover { transform: scale(1.08); color: #fff; }
.float-call { background: var(--success); }
.float-zalo { background: #0068FF; }

[x-cloak] { display: none !important; }

/* phase70: thumb fade-in chống chớp */
.pd-thumb-img{opacity:0;transition:opacity .25s ease}
.pd-thumb-img.loaded{opacity:1}


/* IOS_NOZOOM_v1 - iOS Safari tu phong to khi o nhap duoi 16px */
@media (max-width: 820px) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]),
  textarea, select { font-size: 16px !important; }
}
