/* ═══════════════════════════════════════════════════════════════
   main.css  —  WiFi Store Global Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --primary:    #0066cc;
  --primary-dk: #004fa3;
  --secondary:  #ff6b00;
  --sec-dk:     #e05d00;
  --success:    #28a745;
  --danger:     #dc3545;
  --dark:       #1a1a2e;
  --gray:       #6c757d;
  --gray-light: #f5f7fa;
  --border:     #e0e4ea;
  --white:      #ffffff;
  --shadow-sm:  0 2px 8px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.12);
  --radius:     8px;
  --radius-sm:  4px;
  --transition: .2s ease;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  color: var(--dark);
  background: var(--gray-light);
  line-height: 1.5;
  overflow-x: hidden; /* ngăn tràn ngang toàn trang */
}
*, *::before, *::after { box-sizing: border-box; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Container ──────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */
.topbar {
  display: none;
  background: var(--primary-dk);
  color: var(--white);
  font-size: 12px;
  padding: 4px 0;
}
.topbar .inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar a { color: #cce0ff; }
.topbar a:hover { color: #fff; }
.topbar .sep { margin: 0 10px; opacity: .4; }

.sticky-wrap {
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}
.header {
  background: var(--primary);
  padding: 10px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}
.logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.logo-icon {
  width: 42px; height: 42px;
  background: white;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.logo span { color: var(--secondary); }

.search-bar {
  flex: 1;
  display: flex;
  background: white;
  border-radius: 6px;
  overflow: visible;
  max-width: 600px;
  position: relative;
}
/* Live search wrapper keeps input+button clipped while dropdown escapes */
.search-bar-inner {
  display: flex;
  flex: 1;
  border-radius: 6px;
  overflow: hidden;
}

/* ── Live search dropdown ── */
.search-live-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  border: 1px solid #e5e7eb;
  z-index: 9999;
  max-height: 420px;
  overflow-y: auto;
  animation: lsdIn .15s ease;
}
@keyframes lsdIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.search-live-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f3f4f6;
  transition: background .12s;
}
.search-live-item:last-child { border-bottom: none; }
.search-live-item:hover, .search-live-item.focused { background: #f0f6ff; }
.search-live-img {
  width: 44px; height: 44px; object-fit: contain;
  border-radius: 6px; border: 1px solid #e5e7eb;
  flex-shrink: 0; background: #f9fafb;
}
.search-live-info { flex: 1; min-width: 0; }
.search-live-name {
  font-size: 13.5px; font-weight: 600; color: #1f2937;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-live-meta { font-size: 12px; color: #6b7280; margin-top: 2px; }
.search-live-price { font-size: 13px; font-weight: 700; color: var(--primary); flex-shrink: 0; }
.search-live-footer {
  padding: 10px 14px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
  border-radius: 0 0 10px 10px;
}
.search-live-footer:hover { background: #e8f0fe; }
.search-live-empty {
  padding: 20px 14px;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
}
.search-bar input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  outline: none;
  font-size: 14px;
}
.search-bar button {
  background: var(--secondary);
  color: white;
  padding: 10px 18px;
  font-size: 15px;
  transition: background var(--transition);
}
.search-bar button:hover { background: var(--sec-dk); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}
.header-phone {
  color: white;
  text-align: center;
}
.header-phone .number {
  font-size: 17px;
  font-weight: 700;
  color: #ffe066;
}
.header-phone .label { font-size: 11px; opacity: .85; }

/* ── Main Navigation ────────────────────────────────────────── */
.main-nav {
  background: var(--primary-dk);
  border-top: 1px solid rgba(255,255,255,.1);
}
.main-nav ul {
  display: flex;
  align-items: center;
}
.main-nav a {
  display: block;
  padding: 12px 16px;
  color: rgba(255,255,255,.9);
  font-size: 13.9px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav a.active {
  background: rgba(255,255,255,.15);
  color: #fff;
}
.main-nav .dropdown { position: relative; }
.main-nav .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  min-width: 220px;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 999;
}
.main-nav .dropdown:hover .dropdown-menu { display: block; }
.main-nav .dropdown-menu a {
  color: var(--dark);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.main-nav .dropdown-menu a:hover { background: var(--gray-light); color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════
   PRODUCT CARDS
   ═══════════════════════════════════════════════════════════════ */
.product-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--secondary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  z-index: 1;
}
.card-badge.blue { background: var(--primary); }
.card-badge.green { background: var(--success); }

.card-img-wrap {
  padding: 16px;
  background: #fafbfd;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}
.card-img-wrap img {
  max-height: 160px;
  object-fit: contain;
  transition: transform .3s ease;
}
.product-card:hover .card-img-wrap img { transform: scale(1.04); }

.card-discount {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 3px;
}

.card-body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-name:hover { color: var(--primary); }
.card-desc {
  font-size: 12px;
  color: var(--gray);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-price {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.price-current {
  font-size: 17px;
  font-weight: 700;
  color: var(--danger);
}
.price-original {
  font-size: 12px;
  color: #aaa;
  text-decoration: line-through;
}
.card-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.btn-contact {
  display: block;
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  background: var(--secondary);
  color: white;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-contact:hover { background: var(--sec-dk); transform: translateY(-1px); }

/* ── Consult popup ── */
.consult-popup {
  position: absolute;
  z-index: 9999;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.1);
  padding: 20px 18px 18px;
  width: 220px;
  text-align: center;
  border: 1.5px solid #e5e7eb;
  animation: popupIn .18s ease;
}
@keyframes popupIn {
  from { opacity:0; transform:scale(.9) translateY(6px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}
.consult-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; cursor: pointer;
  color: #9ca3af; font-size: 15px; line-height: 1;
  padding: 2px 4px; border-radius: 4px;
}
.consult-close:hover { background: #f3f4f6; color: #374151; }
.consult-avatar { margin-bottom: 10px; display: flex; justify-content: center; }
.consult-name  { font-size: 14px; font-weight: 700; color: #1f2937; margin-bottom: 3px; }
.consult-phone { font-size: 13px; color: #6b7280; margin-bottom: 14px; }
.consult-actions { display: flex; gap: 8px; }
.consult-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 5px; padding: 10px 6px; border-radius: 10px;
  font-size: 12px; font-weight: 700; text-decoration: none;
  transition: all .15s;
}
.consult-call  { background: #eff6ff; color: #1d4ed8; border: 1.5px solid #bfdbfe; }
.consult-call:hover  { background: #dbeafe; }
.consult-zalo  { background: #f0fdf4; color: #065f46; border: 1.5px solid #bbf7d0; }
.consult-zalo:hover  { background: #dcfce7; }

/* ── Product Grid ───────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   SECTION COMMON
   ═══════════════════════════════════════════════════════════════ */
.section { padding: 28px 0; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 4px; height: 22px;
  background: var(--secondary);
  border-radius: 2px;
}
.view-all {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.view-all:hover { color: var(--secondary); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dk); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: var(--sec-dk); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }
.btn-sm { padding: 6px 14px; font-size: 12.5px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  background: white;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.breadcrumb li { color: var(--gray); }
.breadcrumb li:not(:last-child)::after { content: '›'; margin-left: 6px; }
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }

/* ── Tag / Badge ────────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}
.tag-primary { background: #dbeafe; color: var(--primary); }
.tag-secondary { background: #ffedd5; color: var(--secondary); }
.tag-success { background: #d1fae5; color: #065f46; }

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.footer {
  background: #1a2340;
  color: #cbd5e1;
  padding: 40px 0 0;
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 32px;
}
.footer-logo {
  color: white;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-logo span { color: var(--secondary); }
.footer p { font-size: 13px; line-height: 1.7; margin-bottom: 12px; }
.footer-col h4 {
  color: white;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col a {
  color: #94a3b8;
  font-size: 13px;
  transition: color var(--transition);
}
.footer-col a:hover { color: white; padding-left: 4px; }
.footer-contact { display: flex; flex-direction: column; gap: 10px; }
.footer-contact-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
.footer-contact-item .icon { flex-shrink: 0; margin-top: 2px; }
.footer-contact-item strong { color: white; }
.footer-bottom {
  background: #111827;
  text-align: center;
  padding: 14px;
  font-size: 12px;
  color: #64748b;
  margin-top: 32px;
}
.social-links { display: flex; gap: 10px; margin-top: 14px; }
.social-links a {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 15px;
  transition: background var(--transition);
}
.social-links a:hover { background: var(--primary); }

/* ═══════════════════════════════════════════════════════════════
   CATEGORY TABS / CHIPS
   ═══════════════════════════════════════════════════════════════ */
.cat-tabs-wrap { margin-bottom: 16px; }

.cat-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;   /* 2 hàng tự nhiên */
  margin-bottom: 0;
}
.cat-tab {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  background: white;
  color: var(--gray);
}
.cat-tab:hover, .cat-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ═══════════════════════════════════════════════════════════════
   FILTER SIDEBAR
   ═══════════════════════════════════════════════════════════════ */
.filter-sidebar {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  height: fit-content;
  position: sticky;
  top: 72px;
}
.filter-sidebar h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.filter-clear {
  font-size: 12px;
  color: var(--gray);
  cursor: pointer;
  font-weight: 400;
}
.filter-clear:hover { color: var(--danger); }

.filter-group { margin-bottom: 18px; }
.filter-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.filter-group-title .toggle { transition: transform var(--transition); }
.filter-group-title .toggle.collapsed { transform: rotate(-90deg); }
.filter-options { display: flex; flex-direction: column; gap: 7px; }
.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #444;
  transition: color var(--transition);
}
.filter-option:hover { color: var(--primary); }
.filter-option input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}
.filter-count {
  margin-left: auto;
  font-size: 11px;
  background: var(--gray-light);
  padding: 1px 6px;
  border-radius: 10px;
  color: var(--gray);
}

/* ═══════════════════════════════════════════════════════════════
   PRODUCTS PAGE LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.products-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  padding: 20px 0;
}
/* min-width:0 ngăn grid column tự mở rộng theo content */
.products-main { min-width: 0; overflow: hidden; }
.filter-sidebar { min-width: 0; }

.sort-bar {
  background: white;
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.sort-bar .count { font-size: 13px; color: var(--gray); }
.sort-bar .count strong { color: var(--dark); }
.sort-select {
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--dark);
  cursor: pointer;
  outline: none;
}
.sort-select:focus { border-color: var(--primary); }

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { color: var(--dark); margin-bottom: 8px; }

/* ═══════════════════════════════════════════════════════════════
   HERO BANNER (Homepage)
   ═══════════════════════════════════════════════════════════════ */
.hero-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #0047a3 60%, #003580 100%);
  padding: 50px 0;
  color: white;
  overflow: hidden;
  position: relative;
}
.hero-banner::before {
  content: '';
  position: absolute;
  right: -100px; top: -100px;
  width: 600px; height: 600px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
}
.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.hero-text { max-width: 520px; }
.hero-tag {
  display: inline-block;
  background: var(--secondary);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.hero-text h1 {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 14px;
}
.hero-text h1 span { color: #ffe066; }
.hero-text p { font-size: 16px; opacity: .9; margin-bottom: 24px; line-height: 1.6; }
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-btns .btn-white {
  background: white;
  color: var(--primary);
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 15px;
  transition: all var(--transition);
}
.hero-btns .btn-white:hover { background: #f0f4ff; }
.hero-btns .btn-orange {
  background: var(--secondary);
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 15px;
  transition: all var(--transition);
}
.hero-btns .btn-orange:hover { background: var(--sec-dk); }

.hero-img {
  flex-shrink: 0;
  font-size: 140px;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,.3));
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ── Category Cards (Homepage) ──────────────────────────────── */
.cat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.cat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  border: 2px solid transparent;
}
.cat-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.cat-card .cat-icon { font-size: 38px; margin-bottom: 10px; }
.cat-card .cat-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}
.cat-card .cat-count { font-size: 12px; color: var(--gray); }

/* ── Why Us section ─────────────────────────────────────────── */
.why-us {
  background: var(--primary);
  padding: 30px 0;
  color: white;
}
.why-items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.why-item {
  text-align: center;
  padding: 10px;
}
.why-item .icon { font-size: 34px; margin-bottom: 8px; }
.why-item h4 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.why-item p { font-size: 12px; opacity: .85; }

/* ── Hot Deals banner ───────────────────────────────────────── */
.hot-banner {
  background: linear-gradient(90deg, #ff3e00, #ff6b00, #ff9500);
  border-radius: var(--radius);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  color: white;
}
.hot-banner .fire { font-size: 32px; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.15)} }
.hot-banner h3 { font-size: 18px; font-weight: 800; }
.hot-banner p { font-size: 13px; opacity: .9; }

/* ═══════════════════════════════════════════════════════════════
   PRODUCT DETAIL PAGE
   ═══════════════════════════════════════════════════════════════ */
.detail-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 28px;
  padding: 24px 0;
}
.detail-img-box {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.detail-img-box img { max-height: 320px; object-fit: contain; margin: 0 auto; display: block; width: 100%; }

/* Gallery thumbnails */
.detail-gallery-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 0 4px;
}
.gallery-thumb {
  width: 68px;
  height: 52px;
  border-radius: 6px;
  border: 2px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, transform .15s;
  flex-shrink: 0;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-thumb:hover { border-color: var(--primary); transform: translateY(-2px); }
.gallery-thumb.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,102,204,.25); }

.detail-info {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.detail-info .category-tag {
  display: inline-block;
  background: #dbeafe;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 10px;
}
.detail-name { font-size: 22px; font-weight: 800; margin-bottom: 12px; line-height: 1.3; }
.detail-price-box {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}
.detail-price { font-size: 26px; font-weight: 800; color: var(--danger); }
.detail-original { font-size: 16px; color: #aaa; text-decoration: line-through; }
.detail-discount {
  background: var(--danger);
  color: white;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.detail-desc { color: #555; font-size: 14px; line-height: 1.7; margin-bottom: 20px; }

.spec-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.spec-table tr { border-bottom: 1px solid var(--border); }
.spec-table tr:last-child { border: none; }
.spec-table td { padding: 9px 12px; font-size: 13.5px; vertical-align: top; }
.spec-table td:first-child {
  width: 35%;
  color: var(--gray);
  font-weight: 600;
  background: #fafbfd;
}
.detail-cta { display: flex; gap: 12px; margin-top: 20px; }
.detail-cta .btn { flex: 1; }

.features-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.feature-tag {
  background: #f0f7ff;
  border: 1px solid #c8dff7;
  color: var(--primary);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATION
   ═══════════════════════════════════════════════════════════════ */
/* ── Back to top ─────────────────────────────────────────── */
#backToTop {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 9998;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,102,204,.35);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  line-height: 1;
}
#backToTop.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#backToTop:hover {
  background: var(--primary-dk);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,102,204,.45);
}

.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--dark);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 13.5px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  animation: slideIn .3s ease;
}
.toast.success { background: #065f46; }
.toast.error { background: #991b1b; }
@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════
   HAMBURGER NAV TOGGLE
   ═══════════════════════════════════════════════════════════════ */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  background: rgba(255,255,255,.12);
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: white;
  border-radius: 2px;
  transition: all .25s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.main-nav {
  background: var(--primary-dk);
  border-top: 1px solid rgba(255,255,255,.1);
}
.main-nav .nav-inner { position: relative; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 1024px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .cat-cards { grid-template-columns: repeat(2, 1fr); }
  .why-items { grid-template-columns: repeat(2, 1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .products-layout { grid-template-columns: 200px 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 768px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Topbar: ẩn địa chỉ, thu gọn ── */
  .topbar { padding: 5px 0; }
  .topbar .inner { font-size: 11.5px; gap: 6px; }
  .topbar .sep { margin: 0 5px; }

  /* ── Header layout ── */
  .header { padding: 8px 0; }
  .header-inner {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    grid-template-rows: auto auto;
    gap: 8px;
    align-items: center;
  }
  /* Hamburger bên TRÁI */
  .nav-hamburger { display: flex; grid-column: 1; grid-row: 1; justify-self: start; }
  /* Logo GIỮA */
  .logo { font-size: 18px; grid-column: 2; grid-row: 1; justify-self: center; }
  .logo-icon { width: 36px; height: 36px; font-size: 18px; }
  /* Cột 3 trống — giữ cân đối */
  .header-actions { display: none; }
  .header-actions { display: none; } /* Ẩn số điện thoại ở header */
  .search-bar {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: 100%;
  }
  .search-bar input { padding: 9px 12px; font-size: 14px; }
  .search-bar button { padding: 9px 16px; }

  /* ── Hamburger Nav ── */
  .main-nav ul {
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
  }
  .main-nav ul.nav-open { max-height: 600px; }
  .main-nav a {
    padding: 13px 20px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    text-align: left;
  }
  .main-nav .dropdown-menu {
    position: static;
    box-shadow: none;
    border-radius: 0;
    background: rgba(0,0,0,.2);
    display: block !important;  /* always show sub on mobile */
  }
  .main-nav .dropdown-menu a {
    color: rgba(255,255,255,.8);
    padding: 10px 20px 10px 36px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,.05);
  }
  .main-nav .dropdown-menu a:hover { background: rgba(255,255,255,.1); color: white; }

  /* ── Products page ── */
  .products-layout { grid-template-columns: 1fr; gap: 12px; padding: 12px 0; }
  /* Ẩn sidebar khỏi layout hoàn toàn — hiện qua drawer JS */
  .filter-sidebar {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 85%; max-width: 300px;
    height: 100vh;
    z-index: 2000;
    overflow-y: auto;
    border-radius: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,.2);
  }
  .filter-sidebar.open { display: block; }
  .filter-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1999;
  }
  .filter-overlay.show { display: block; }
  /* Nút lọc tích hợp vào sort-bar thay vì floating */
  .mobile-filter-toggle { display: none !important; }
  .mobile-filter-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 20px;
    border: 1.5px solid var(--border);
    background: white; color: #374151;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
  }
  .mobile-filter-btn:active { background: #f0f7ff; }

  /* ── Product grid ── */
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-img-wrap { min-height: 140px; padding: 12px; }
  .card-img-wrap img { max-height: 120px; }
  .card-body { padding: 10px; }
  .card-name { font-size: 13px; }
  .price-current { font-size: 15px; }
  .card-footer { padding: 8px 10px; }
  .btn-contact { padding: 9px 6px; font-size: 12px; }

  /* ── Hero banner ── */
  .hero-banner { padding: 28px 0 20px; }
  .hero-content { flex-direction: column; text-align: center; gap: 16px; }
  .hero-text { max-width: 100%; }
  .hero-text h1 { font-size: 24px; }
  .hero-text p { font-size: 14px; margin-bottom: 16px; }
  .hero-img { font-size: 70px; order: -1; animation: none; }
  .hero-btns { justify-content: center; gap: 10px; }
  .hero-btns .btn-white,
  .hero-btns .btn-orange { padding: 10px 18px; font-size: 14px; }

  /* ── Category cards ── */
  .cat-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-card { padding: 14px 10px; }
  .cat-card .cat-icon { font-size: 30px; }

  /* ── Why us ── */
  .why-items { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .why-us { padding: 20px 0; }

  /* ── Hot banner ── */
  .hot-banner { padding: 12px 14px; gap: 10px; }
  .hot-banner .fire { font-size: 24px; }
  .hot-banner h3 { font-size: 15px; }

  /* ── Product detail ── */
  .detail-layout { padding: 12px 0; gap: 12px; }
  .detail-img-box { padding: 16px; }
  .detail-img-box img { max-height: 220px; }
  .detail-info { padding: 16px; }
  .detail-name { font-size: 18px; }
  .detail-price { font-size: 22px; }
  .detail-cta { flex-direction: column; gap: 8px; }
  .detail-cta .btn { width: 100%; padding: 13px; font-size: 15px; }
  .spec-table td { padding: 8px 10px; font-size: 13px; }

  /* ── Footer ── */
  .footer { padding: 28px 0 0; margin-top: 32px; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }

  /* ── Breadcrumb ── */
  .breadcrumb { font-size: 12px; }

  /* ── Sort bar ── */
  .sort-bar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .sort-select { width: 100%; }

  /* ── Category tabs ── */
  .cat-tabs-wrap { margin-bottom: 12px; }
  .cat-tabs { gap: 6px; }
  .cat-tab { padding: 6px 12px; font-size: 12px; }

  /* ── Toast ── */
  .toast-container { bottom: 70px; right: 12px; left: 12px; }
  .toast { min-width: unset; font-size: 13px; }

  /* ── Promo banner ── */
  .promo-banner { font-size: 12px; padding: 7px 10px; }

  /* ── Mobile filter button ── */
  .mobile-filter-toggle { display: flex !important; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (≤ 480px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cat-cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-text h1 { font-size: 21px; }

  /* Topbar: chỉ show hotline trên màn hình nhỏ */
  .topbar-address,
  .topbar-hours { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   TOUCH TARGETS — Tất cả interactive elements min 44px
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .btn, .cat-tab, .sort-select,
  .filter-option, .main-nav a,
  .btn-contact {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .filter-option { min-height: 36px; }
  .main-nav .dropdown-menu a { min-height: 40px; }
}
