:root{
  --brand:#2b6ef2;--brand-600:#1f5ae0;--ink:#0f172a;--muted:#64748b;--bg:#f8fafc;--card:#ffffff;--ring:rgba(43,110,242,.35);
  --shadow:0 10px 20px rgba(2,6,23,.06),0 6px 8px rgba(2,6,23,.04);--radius:14px;--danger:#dc2626
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial}
body{background:var(--bg);color:var(--ink)}
a{color:inherit;text-decoration:none}
.container{max-width:1200px;margin-inline:auto;padding-inline:16px}
.btn{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:999px;border:1px solid #e2e8f0;background:#fff;box-shadow:var(--shadow);font-weight:600;cursor:pointer}
.btn.primary{background:var(--brand);border-color:var(--brand);color:white}
.badge{display:inline-flex;align-items:center;gap:8px;background:#e8f1ff;color:#1746a2;padding:6px 10px;border-radius:999px;font-weight:600;font-size:12px}

/* Top bar */
.topbar{background:linear-gradient(180deg,var(--brand) 0%, #1a4ccf 100%);color:white}
.topbar-inner{display:flex;align-items:center;gap:16px;padding:10px 0}
.logo{display:flex;align-items:center;gap:10px;font-weight:800}
.logo-mark{width:34px;height:34px;border-radius:8px;background:white;display:grid;place-items:center;color:var(--brand);font-weight:900}

/* Search */
.search{flex:1;display:flex;align-items:center;gap:10px}
.search .input{flex:1;display:flex;align-items:center;gap:10px;background:white;border-radius:999px;padding:10px 14px;border:1px solid #dbe3f0}
.search input{border:none;outline:none;width:100%;font-size:14px}
.quick-actions{display:flex;align-items:center;gap:8px}

/* Primary actions */
.actions{display:flex;align-items:center;gap:10px}

/* Mega nav */
.nav{background:white;border-bottom:1px solid #e2e8f0}
.nav-inner{display:flex;align-items:center;gap:24px;height:50px}
.nav a{font-weight:600;color:#0b2a6a;opacity:.9}
.nav a:hover{opacity:1}
.nav a {
  position: relative;
  padding-bottom: 6px;
}

.nav a.active{opacity:1;color:var(--brand);border-bottom:2px solid var(--brand)}
/* Layout */
.grid{display:grid;grid-template-columns:280px 1fr;gap:20px;margin-top:18px}

/* Left card */
.left-card{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow)}
.left-card .title{padding:16px;border-bottom:1px solid #eef2f7;font-weight:800;color:#0b2a6a}
.cat-list{padding:10px}
.cat-item{display:flex;align-items:center;gap:10px;padding:12px 10px;border-radius:12px;color:#0b2a6a;font-weight:600}
.cat-item:hover{background:#f1f5ff}
.icon{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;background:#eef4ff;color:#1a4ccf;font-weight:800}

/* Right content */
.right{display:grid;gap:16px}
.chip-row{display:flex;flex-wrap:wrap;gap:10px}
.chip{padding:10px 12px;background:white;border:1px solid #e5eaf3;border-radius:12px;box-shadow:var(--shadow);font-weight:600;color:#0b2a6a}

.section{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow)}
.section .head{display:flex;align-items:center;justify-content:space-between;padding:16px 16px;border-bottom:1px solid #eef2f7}
.section .head .h{font-size:18px;font-weight:800;color:#0b2a6a}
.section .head a{font-size:14px;color:var(--brand);font-weight:700}

/* Product scroller */
.products{display:grid;grid-auto-flow:column;grid-auto-columns:210px;gap:14px;overflow-x:auto;padding:14px 16px 22px 16px;scroll-snap-type:x mandatory}
.card{scroll-snap-align:start;background:white;border:1px solid #e5eaf3;border-radius:16px;overflow:hidden;display:flex;flex-direction:column;cursor:pointer}
.thumb{aspect-ratio:1/1;background:#f2f6ff;display:grid;place-items:center}
.thumb span{font-size:12px;color:#94a3b8}
.card .meta{padding:10px 12px;display:grid;gap:6px}
.title-2{font-size:14px;font-weight:700;color:#0b2a6a;line-height:1.35}
.price{font-weight:800;color:#0652ff}
.small{font-size:12px;color:#64748b}

.pill{background:#f1f5ff;color:#0b2a6a;border:1px solid #dbe3f7;padding:6px 10px;border-radius:999px;font-weight:700}

html{scroll-behavior:smooth}
#products-anchor{scroll-margin-top:120px}

@media (max-width: 960px){
  .grid{grid-template-columns:1fr}
  .nav-inner{overflow-x:auto;padding-inline:12px}
  .left-card{order:2}
  .right{order:1}
}

/* Modal */
dialog{border:none;border-radius:18px;max-width:720px;width:95vw;box-shadow:var(--shadow)}
.modal{display:grid;grid-template-columns:240px 1fr;gap:16px}
@media (max-width:680px){.modal{grid-template-columns:1fr}}
.qty{display:inline-flex;border:1px solid #e2e8f0;border-radius:10px;overflow:hidden}
.qty button{background:#f8fafc;border:none;padding:8px 12px;cursor:pointer}
.qty input{width:52px;border:none;text-align:center}
.muted{color:var(--muted)}

/* Cart drawer */
.cart{position:fixed;top:0;right:0;bottom:0;width:360px;max-width:90vw;background:#fff;border-left:1px solid #e5e7eb;transform:translateX(100%);transition:.25s ease;z-index:50;display:flex;flex-direction:column}
.cart.open{transform:translateX(0)}
.cart header{padding:12px;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;align-items:center}
.cart-list{flex:1;overflow:auto;padding:12px;display:flex;flex-direction:column;gap:10px}
.cart-item{
  display:grid;
  grid-template-columns:56px 1fr auto;
  gap:10px;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:8px
}
.cart-item .title{
  font-weight:700
}
.cart .footer{
  border-top:1px solid #e5e7eb;
  padding:12px;
  display:grid;
  gap:8px
}
.total{display:flex;
  justify-content:space-between;
  font-weight:800}

.danger{
  color:var(--danger)
}



/* Auth modal styles kept (nếu bạn dùng modal sau này) */
.auth-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.5);
  z-index:9999;
  align-items:center;
  justify-content:center
}
.auth-overlay.active{
  display:flex
}
.auth-modal{
  background:#fff;
  border-radius:24px;
  max-width:480px;
  width:90%;
  padding:40px 32px;
  box-shadow:0 20px 60px rgba(0,0,0,.3);
  max-height:90vh;
  overflow-y:auto;
  position:relative
}
.auth-modal h2{
  color:var(--brand);
  font-size:28px;
  font-weight:900;
  text-align:center;
  margin:0 0 8px
}
.auth-modal .subtitle{
  text-align:center;
  color:#64748b;
  margin-bottom:24px;
  font-size:14px
}
.tabbar{
  display:inline-flex;
  background:#f1f5f9;
  border-radius:12px;
  padding:4px;
  gap:4px
}
.tabbar .tab-btn{
  padding:10px 24px;
  border:none;
  border-radius:8px;
  font-weight:700;
  cursor:pointer;
  background:transparent;
  color:#64748b;
  transition:.3s
}
.tabbar .tab-btn.active{
  background:#fff;
  color:var(--brand)
}
.cooldown{
  opacity:.6;
  pointer-events:none
}

/* HERO */
.hero{
  position:relative;
  border-radius:16px;overflow:hidden;
  background:#eaf1ff;
  margin:16px auto;
  max-width:1200px
}
.hero .viewport{
  position:relative;
  height:360px
}
.hero .slides{
  height:100%
}
.hero .slide{
  position:absolute;
  inset:0;opacity:0;
  transition:opacity .5s ease
}
.hero .slide.active{
  opacity:1
}
.hero img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block
}
.hero .nav-btn{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:42px;height:42px;
  border:none;border-radius:999px;
  background:rgba(255,255,255,.9);
  box-shadow:var(--shadow);
  cursor:pointer;
  font-size:18px;
  display:grid;
  place-items:center
}
.hero .prev{
  left:12px
}
.hero .next{
  right:12px
}
.hero .dots{
  position:absolute;
  left:0;right:0;
  bottom:12px;
  display:flex;
  justify-content:center;
  gap:8px
}
.hero .dot{
  width:8px;height:8px;border-radius:999px;
  background:rgba(255,255,255,.7);
  border:1px solid rgba(2,6,23,.08);
  cursor:pointer
}
.hero .dot.active{
  background:white
}
@media (max-width:768px){ .hero .viewport{height:220px} }
/* === Nav full-width, các mục chia đều === */
.nav .nav-inner{
  display: grid;
  grid-auto-flow: column;     /* xếp theo cột, tự dàn ngang */
  grid-auto-columns: 1fr;     /* mỗi mục chiếm đều 1 phần */
  align-items: center;
  gap: 0;                      /* bỏ khoảng cách để căng sát đều */
}

.nav .nav-link{
  text-align: center;          /* chữ ở giữa */
  padding: 0 8px;              /* đệm nhẹ để dễ bấm */
  white-space: nowrap;         /* không xuống dòng mỗi mục */
}

/* Viền active nếu bạn đang dùng border-bottom */
.nav .nav-link.active{
  border-bottom: 2px solid var(--brand);
  color: var(--brand);
}

/* Mobile: cho phép kéo ngang danh mục */
@media (max-width: 960px){
  .nav .nav-inner{
    display: flex;             /* về flex để kéo ngang mượt hơn */
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .nav .nav-link{
    flex: 0 0 auto;            /* mỗi mục co giãn theo nội dung */
  }
}

/* ========== INTRO VIDEO OVERLAY ========== */
.intro{
  position: fixed; inset: 0; z-index: 9999;
  background: #000; display: grid; place-items: center;
  opacity: 1; visibility: visible;
  transition: opacity .6s ease, visibility .6s ease;
}
.intro.hide{ opacity: 0; visibility: hidden; }

.intro video{
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* text/branding đè lên video (tuỳ chọn) */
.intro-overlay{
  position: absolute; inset: 0;
  display: grid; place-items: start center;
  padding-top: 10vh; text-align: center; color: #fff;
  pointer-events: none;
}
.logo-mark{
  width: 72px; height: 72px; border-radius: 16px;
  display: grid; place-items: center;
  background: #fff; color: #2b6ef2; font-weight: 900; font-size: 22px;
  margin: 0 auto 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

/* nút bỏ qua */
.intro-skip{
  position: absolute; right: 16px; bottom: 16px;
  border: none; background: #2b6ef2; color: #fff;
  padding: 10px 16px; border-radius: 999px; cursor: pointer;
  font-weight: 700; box-shadow: 0 8px 16px rgba(43,110,242,.35);
}

/* Ẩn app lúc đầu để tránh nháy layout */
.app.is-hidden{ visibility: hidden; }
body.noscroll{ overflow: hidden; }
/* Intro phủ toàn màn hình và fade out */
.intro{
  position: fixed; inset: 0; z-index: 99999;
  background: #000; display: grid; place-items: center;
  opacity: 1; visibility: visible;
  transition: opacity .6s ease, visibility .6s ease;
}
.intro.hide{ opacity: 0; visibility: hidden; }

/* Video phủ kín */
.intro > video{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* Text/logo chồng lên video */
.intro-overlay{
  position: relative; z-index: 1;   /* QUAN TRỌNG: ở trên video */
  display: grid; place-items: center;
  text-align: center; color: #fff;
  gap: 8px;
}

/* Ẩn toàn bộ app lúc đầu để không chiếm chỗ */
.app.is-hidden{ display: none; }

/* Chặn cuộn trong lúc intro */
body.noscroll{ overflow: hidden; height: 100vh; }

/* (giữ nguyên các css khác của bạn) */
