/* =====================================================================
   GIAO DIỆN "BẠC HÀ TƯƠI" – Cửa hàng Gia Hưng Gia Hân
   Số liệu lấy từ Front-End/DESIGN.md. Một file cho cả trang khách và trang quản trị.
   Máy tính: rộng hơn 760px. Điện thoại: từ 760px trở xuống.
   ===================================================================== */

:root {
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-soft: #13887e;
  --ring: #5eead4;
  --ink: #12312d;
  --muted: #4b6b66;
  --on-teal: #d3f2ea;
  --line: #cfe7e1;
  --line-soft: #d5ece6;
  --line-card: #e1f1ed;
  --bg: #f4fbf9;
  --field: #f0f8f6;
  --field-2: #f8fcfb;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --radius-band: 20px;
  --radius-card: 18px;
  --wrap: 1216px;
  --pad: 32px;
  --font: 'Lexend', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg) radial-gradient(#d3ebe5 1.3px, transparent 1.3px) 0 0 / 24px 24px;
  min-height: 100vh;
}
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #5eead4; outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: calc(var(--wrap) + 2 * var(--pad)); margin: 0 auto; padding: 0 var(--pad); }
.page { padding-bottom: 48px; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 11px 20px; font-weight: 600; font-size: 15px;
  border: 1.5px solid transparent; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn svg { flex: none; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn-outline { background: #fff; border-color: var(--teal); color: var(--teal); }
.btn-outline:hover { background: var(--field); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--field); color: var(--ink); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #912018; color: #fff; }
.btn-lg { padding: 14px 22px; font-size: 16px; }
.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
}
.icon-btn.square { border-radius: 12px; width: 40px; height: 40px; border: 0; background: var(--field); }
.icon-btn.solid { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ---------- Đầu trang ---------- */
.site-header { background: #fff; border-top: 4px solid var(--teal); border-bottom: 1px solid var(--line-soft); position: relative; z-index: 20; }
.hdr {
  min-height: 68px; display: grid; align-items: center; gap: 24px;
  grid-template-columns: 3fr 5fr 4fr;
  grid-template-areas: "logo nav tools";
}
.hdr .back { display: none; grid-area: back; }
.brand-logo { grid-area: logo; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-logo:hover { color: var(--ink); }
.logo-mark {
  width: 38px; height: 38px; border-radius: 12px; background: var(--teal); color: #fff; flex: none;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px;
}
.logo-text { font-size: 17px; font-weight: 700; line-height: 1.2; }
/* Logo cửa hàng (hình mái hiên) thay cho chữ cái */
.logo-mark.logo-shop img { width: 100%; height: 100%; display: block; }
.brand-logo .logo-mark.logo-shop { width: 46px; height: 46px; background: none; border-radius: 0; }
.side-brand .logo-mark.logo-shop, .admin-mobile-top .logo-mark.logo-shop, .login-side .logo-mark.logo-shop { padding: 5px; }
.cat-nav { grid-area: nav; display: flex; gap: 4px; flex-wrap: wrap; }
.cat-nav a { text-decoration: none; padding: 8px 16px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--ink); }
.cat-nav a:hover { background: var(--field); }
.cat-nav a.active { background: var(--ink); color: #fff; font-weight: 600; }
.hdr-tools { grid-area: tools; display: flex; align-items: center; gap: 10px; justify-content: flex-end; min-width: 0; }
.hdr-tools .call-btn { display: none; }

/* Ô tìm kiếm + gợi ý */
.search { position: relative; flex: 1; min-width: 0; }
.search-box {
  display: flex; align-items: center; gap: 10px; background: var(--field); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 9px 18px; color: var(--muted);
}
.search-box:focus-within { background: #fff; border: 2px solid var(--teal); padding: 8px 17px; box-shadow: 0 0 0 4px #ccefe6; }
.search-box input { border: 0; background: transparent; outline: none; width: 100%; min-width: 0; font-size: 15px; color: var(--ink); }
.search-box input::placeholder { color: var(--muted); }
.search-clear { border: 0; background: none; padding: 0; display: none; color: var(--muted); }
.search-box.has-text .search-clear { display: inline-flex; }
.suggest {
  position: absolute; top: calc(100% + 10px); right: 0; width: max(100%, 410px); z-index: 30;
  background: #fff; border: 1px solid var(--line-soft); border-radius: 20px; padding: 10px;
  box-shadow: 0 18px 40px rgba(15, 118, 110, .18);
}
.suggest-title { padding: 6px 12px; font-size: 14px; color: var(--muted); }
.suggest-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; text-decoration: none; color: var(--ink); }
.suggest-item:hover, .suggest-item.active { background: #f0faf7; color: var(--ink); }
.suggest-item b { color: var(--teal); font-weight: 600; }
.suggest-thumb { width: 44px; height: 44px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.suggest-thumb img { width: 36px; height: auto; }
.suggest-thumb.photo img { width: 100%; height: 100%; object-fit: cover; }
.suggest-sub { display: block; font-size: 14px; color: var(--muted); }
.suggest-empty { padding: 10px 12px; font-size: 15px; color: var(--muted); }
.suggest-all { display: block; padding: 10px 12px 6px; font-size: 14px; font-weight: 600; text-decoration: none; }

/* ---------- Khung xanh ---------- */
.band {
  margin-top: 20px; background: var(--teal); color: #fff; border-radius: var(--radius-band);
  padding: 14px 24px; display: flex; align-items: center; gap: 20px; position: relative; overflow: hidden;
}
.band > * { position: relative; }
.band .rings { position: absolute; right: -120px; top: -130px; opacity: .28; pointer-events: none; }
.band-back { width: 44px; height: 44px; border-radius: 14px; background: var(--teal-soft); display: flex; align-items: center; justify-content: center; flex: none; color: #fff; }
.band-back:hover { background: #0d8076; color: #fff; }
.band-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.band-icon img { width: 46px; }
.band-icon.logo-slot { border: 2px dashed #7fd6c8; background: transparent; }
.band-icon.logo-slot img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.band h1 { font-size: 26px; font-weight: 700; }
.band p { margin-top: 2px; color: var(--on-teal); font-size: 15px; }
.band p a { color: #fff; }

/* Khung xanh lớn ở Menu chính */
.hero { margin-top: 20px; background: var(--teal); color: #fff; border-radius: 24px; padding: 34px 40px; position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
.hero > * { position: relative; }
.hero .rings { position: absolute; right: -140px; top: -160px; opacity: .28; }
.hero h1 { font-size: 34px; font-weight: 700; letter-spacing: -.01em; }
.hero-lead { margin-top: 10px; color: var(--on-teal); font-size: 16px; line-height: 1.6; max-width: 520px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.hero-actions .btn-outline { border-color: #fff; }
.info-list { background: var(--teal-soft); border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.info-row { display: flex; align-items: center; gap: 10px; }
.info-row svg { color: var(--ring); flex: none; }
.info-row a { color: #fff; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.info-row .pill { margin-left: auto; }
.pill-open { background: #ccfbf1; color: #115e59; }
.pill-closed { background: #fef3d7; color: #92400e; }
.pill-stock { background: #dcfce7; color: #166534; font-size: 14px; padding: 4px 12px; }
.pill-stock::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.pill-out { background: var(--ink); color: #fff; font-size: 14px; padding: 4px 10px; }

/* ---------- Tiêu đề mục ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 28px 0 16px; }
.section-head h2 { font-size: 22px; font-weight: 600; }
.section-head span { color: var(--muted); font-size: 14px; }

/* Ô danh mục ở Menu chính */
.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.cat-tile { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line-card); border-radius: 22px; padding: 10px; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.cat-tile:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15, 118, 110, .12); }
.cat-art { aspect-ratio: 16 / 10; border-radius: 16px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.cat-art::before { content: ''; position: absolute; width: 52%; aspect-ratio: 1; border-radius: 50%; background: var(--deep); }
.cat-art img { position: relative; width: 46%; }
.cat-art .count { position: absolute; top: 12px; left: 12px; background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600; color: var(--ink); }
.cat-body { padding: 14px 8px 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cat-body h3 { font-size: 20px; font-weight: 600; }
.cat-body p { color: var(--muted); font-size: 15px; line-height: 1.55; }
.cat-link { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 6px; color: var(--teal); font-weight: 600; font-size: 15px; }

/* Ô thương hiệu ở trang Thuốc lá */
.brand-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.brand-tile { background: #fff; border: 1px solid var(--line-card); border-radius: var(--radius-card); padding: 18px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 12px; }
.brand-tile:hover { color: var(--ink); border-color: var(--line); box-shadow: 0 10px 24px rgba(15, 118, 110, .1); }
.brand-logo-box { aspect-ratio: 16 / 9; border-radius: 14px; border: 2px dashed #9fd8cd; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; overflow: hidden; background: #fbfefd; }
.brand-logo-box.has-img { border: 1px solid var(--line-card); background: #fff; }
.brand-logo-box img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.brand-tile h3 { font-size: 18px; font-weight: 600; }
.brand-tile .meta { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 14px; }
.brand-tile .meta b { color: var(--teal); font-weight: 600; }

/* ---------- Thanh trên lưới sản phẩm ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; padding: 22px 0 18px; }
.toolbar .count { color: var(--muted); font-size: 14px; }
.sort { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.sort select {
  appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234b6b66' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 34px 7px 14px; font-size: 14px; font-weight: 500; color: var(--ink);
}

/* ---------- Thẻ sản phẩm ---------- */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line-card); border-radius: var(--radius-card); padding: 10px; text-decoration: none; color: var(--ink); transition: box-shadow .15s, transform .15s; }
.card:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15, 118, 110, .12); }
.card-media { aspect-ratio: 4 / 3; border-radius: 13px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.card-media.art::before { content: ''; position: absolute; width: 58%; aspect-ratio: 1; border-radius: 50%; background: var(--deep); }
.card-media.art img { position: relative; width: 56%; }
.card-media.photo img { width: 100%; height: 100%; object-fit: cover; }
.card.out .card-media > *:not(.badge), .card.out .card-media::before { opacity: .45; }
.card-media .badge { position: absolute; top: 10px; left: 10px; }
.card-body { padding: 14px 6px 6px; display: flex; flex-direction: column; flex: 1; }
.card-name { font-size: 17px; font-weight: 600; line-height: 1.3; }
.card-spec { font-size: 14px; color: var(--muted); margin: 2px 0 10px; }
.card-price { margin-top: auto; }
.price-main { font-size: 19px; font-weight: 700; color: var(--teal); }
.price-alt { font-size: 16px; font-weight: 600; margin-top: 2px; }
.unit { font-size: 14px; font-weight: 400; color: var(--muted); }

/* Màu theo danh mục */
.tone-1 { background: #e2f6f1; --deep: #ccefe6; }
.tone-2 { background: #fef3d7; --deep: #fde9b0; }
.tone-3 { background: #e4f0fb; --deep: #d2e5f8; }

/* ---------- Trống / lỗi / đang tải ---------- */
.empty { background: #fff; border: 1.5px dashed var(--line); border-radius: 24px; padding: 48px 40px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty h2 { font-size: 24px; font-weight: 700; }
.empty p { max-width: 460px; color: var(--muted); line-height: 1.6; }
.empty .chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { text-decoration: none; background: #fff; border: 1.5px solid var(--line); color: var(--ink); border-radius: 999px; padding: 9px 18px; font-size: 15px; font-weight: 500; }
.chip:hover { background: var(--field); color: var(--ink); }
.empty.row { flex-direction: row; text-align: left; align-items: center; gap: 28px; padding: 40px; }
.empty.row .empty-art { width: 120px; height: 120px; border-radius: 20px; display: flex; align-items: center; justify-content: center; flex: none; }
.empty.row .empty-art img { width: 90px; }
.empty.row > div { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.skeleton { background: linear-gradient(90deg, #eaf6f2, #f6fbfa, #eaf6f2); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-card); min-height: 260px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .card, .cat-tile { transition: none; } }
.notice { margin-top: 20px; padding: 14px 18px; border-radius: 14px; background: var(--danger-soft); color: var(--danger); font-size: 15px; }

/* ---------- Trang chi tiết sản phẩm ---------- */
.detail { display: grid; grid-template-columns: 520px 1fr; gap: 32px; align-items: start; margin-top: 24px; }
.gallery-main { position: relative; border-radius: 24px; overflow: hidden; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; aspect-ratio: 1; scroll-snap-align: start; display: flex; align-items: center; justify-content: center; position: relative; }
.slide.art::before { content: ''; position: absolute; width: 62%; aspect-ratio: 1; border-radius: 50%; background: var(--deep); }
.slide.art img { position: relative; width: 58%; }
.slide.photo img { width: 100%; height: 100%; object-fit: cover; }
.gallery-count { position: absolute; top: 14px; right: 14px; background: rgba(18, 49, 45, .75); color: #fff; border-radius: 999px; padding: 3px 10px; font-size: 14px; }
.gallery-nav { position: absolute; top: 50%; margin-top: -22px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(15, 118, 110, .15); color: var(--ink); }
.gallery-nav.prev { left: 16px; } .gallery-nav.next { right: 16px; }
.dots { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.dots span { width: 8px; height: 8px; border-radius: 999px; background: #9fd8cd; transition: width .2s; }
.dots span.on { width: 22px; background: var(--teal); }
.thumbs { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.thumb { width: 92px; height: 92px; border-radius: 14px; border: 1.5px solid var(--line-soft); padding: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.thumb.on { border: 2px solid var(--teal); }
.thumb img { width: 70%; } .thumb.photo img { width: 100%; height: 100%; object-fit: cover; }
.swipe-hint { display: none; }
.info-card { background: #fff; border: 1px solid var(--line-card); border-radius: 24px; padding: 28px 30px; }
.info-top { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; }
.info-top .pill { margin-left: auto; }
.info-card h2 { margin-top: 6px; font-size: 32px; font-weight: 700; letter-spacing: -.01em; }
.price-opts { display: flex; gap: 12px; margin-top: 18px; }
.price-opt { flex: 1; border: 1.5px solid var(--line); background: #fff; border-radius: 16px; padding: 12px 14px; position: relative; }
.price-opt.main { border: 2px solid var(--teal); background: #f0faf7; }
.price-opt .lbl { font-size: 14px; color: var(--muted); }
.price-opt .val { font-size: 26px; font-weight: 700; margin-top: 2px; }
.price-opt.main .val { color: var(--teal); }
.price-opt .save { position: absolute; top: -11px; right: 12px; background: #fef3d7; color: #92400e; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 600; }
.desc { margin-top: 20px; font-size: 16px; line-height: 1.65; color: #2c4a45; white-space: pre-line; }
.specs { margin: 18px 0 0; display: grid; grid-template-columns: 120px 1fr; row-gap: 10px; font-size: 15px; }
.specs dt { color: var(--muted); } .specs dd { margin: 0; font-weight: 500; }
.cta { display: flex; gap: 12px; margin-top: 26px; }
.cta .btn { flex: 1; }
.store-line { display: flex; align-items: center; gap: 8px; margin-top: 16px; color: var(--muted); font-size: 14px; }
.fine { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-card); color: var(--muted); font-size: 14px; line-height: 1.5; }
.action-bar { display: none; }

/* ---------- Hộp thoại (xác nhận tuổi, hỏi lại khi xóa) ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(18, 49, 45, .55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; }
.modal { width: 460px; max-width: 100%; background: #fff; border-radius: 28px; padding: 34px 34px 28px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.modal .mark { width: 52px; height: 52px; border-radius: 16px; background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; }
.modal h2 { font-size: 26px; font-weight: 700; }
.modal p { color: var(--muted); line-height: 1.6; }
.modal .stack { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 6px; }
.modal.left { align-items: flex-start; text-align: left; width: 440px; padding: 28px; }
.modal.left .actions { display: flex; gap: 10px; justify-content: flex-end; width: 100%; margin-top: 10px; }
.modal .danger-mark { width: 48px; height: 48px; border-radius: 14px; background: var(--danger-soft); color: var(--danger); display: flex; align-items: center; justify-content: center; }
body.no-scroll { overflow: hidden; }

/* =====================================================================
   ĐIỆN THOẠI
   ===================================================================== */
@media (max-width: 760px) {
  :root { --pad: 16px; }
  body { background-size: 20px 20px; background-image: radial-gradient(#d3ebe5 1.2px, transparent 1.2px); }
  .page { padding-bottom: 32px; }

  .hdr {
    min-height: 0; padding-top: 10px; padding-bottom: 12px; gap: 10px;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "back logo tools" "search search search";
  }
  .hdr.no-back { grid-template-columns: 1fr auto; grid-template-areas: "logo tools" "search search"; }
  .hdr .back { display: inline-flex; }
  .logo-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; }
  .brand-logo .logo-mark.logo-shop { width: 40px; height: 40px; }
  .logo-text { font-size: 16px; }
  .cat-nav { display: none; }
  .hdr-tools { display: contents; }
  .hdr-tools .tools-right { grid-area: tools; display: flex; gap: 8px; }
  .hdr-tools .call-btn { display: inline-flex; }
  .search { grid-area: search; }
  .search-box { padding: 9px 16px; }
  .suggest { width: 100%; left: 0; right: auto; }

  .band { margin-top: 12px; border-radius: 18px; padding: 12px 14px; gap: 12px; }
  .band .band-back { display: none; }
  .band-icon { width: 48px; height: 48px; border-radius: 13px; }
  .band-icon img { width: 42px; }
  .band h1 { font-size: 20px; }
  .band p { font-size: 14px; line-height: 1.45; }

  .hero { margin-top: 12px; grid-template-columns: 1fr; padding: 22px 18px; gap: 18px; border-radius: 20px; }
  .hero h1 { font-size: 24px; }
  .hero-lead { font-size: 15px; }
  .hero-actions .btn { flex: 1; }
  .info-list { padding: 14px 16px; font-size: 14px; }
  .pill { font-size: 14px; }

  .section-head { padding: 22px 0 12px; }
  .section-head h2 { font-size: 18px; }
  .cat-grid { grid-template-columns: 1fr; gap: 12px; }
  .cat-tile { flex-direction: row; align-items: center; gap: 12px; padding: 8px; border-radius: 18px; }
  .cat-art { width: 112px; aspect-ratio: 1; flex: none; border-radius: 14px; }
  .cat-art .count { display: none; }
  .cat-art::before { width: 74%; }
  .cat-art img { width: 62%; }
  .cat-body { padding: 4px 4px 4px 0; gap: 4px; }
  .cat-body h3 { font-size: 17px; }
  .cat-body p { font-size: 14px; line-height: 1.5; }
  .cat-link { font-size: 14px; }

  .brand-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .brand-tile { padding: 12px; gap: 10px; border-radius: 16px; }
  .brand-tile h3 { font-size: 16px; }

  .toolbar { padding: 14px 0 10px; }
  .sort > span { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card { padding: 7px; border-radius: 16px; }
  .card-media { border-radius: 11px; }
  .card-body { padding: 10px 4px 4px; }
  .card-name { font-size: 15px; }
  .price-main { font-size: 17px; }
  .price-alt { font-size: 15px; }

  .empty { padding: 28px 20px; }
  .empty h2 { font-size: 20px; }
  .empty.row { flex-direction: column; text-align: center; padding: 28px 20px; }
  .empty.row > div { align-items: center; }

  .detail { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
  .gallery-main { border-radius: 16px; }
  .gallery-nav, .thumbs { display: none; }
  .swipe-hint { display: block; margin-top: 8px; text-align: center; color: var(--muted); font-size: 14px; }
  .info-card { padding: 18px 16px; border-radius: 20px; }
  .info-top { font-size: 14px; }
  .info-card h2 { font-size: 24px; }
  .price-opt .val { font-size: 22px; }
  .price-opt .save { font-size: 14px; }
  .desc { font-size: 15px; margin-top: 16px; }
  .detail-page .cta, .detail-page .fine { display: none; }
  .detail-page { padding-bottom: 100px; }
  .action-bar {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40; gap: 8px;
    background: #fff; border: 1px solid var(--line-soft); border-radius: 20px; padding: 8px;
    box-shadow: 0 10px 28px rgba(15, 118, 110, .18);
  }
  .action-bar .btn { flex: 1; padding: 12px; }

  .modal-backdrop.sheet-mobile { align-items: flex-end; padding: 0; }
  .modal-backdrop.sheet-mobile .modal { width: 100%; border-radius: 26px 26px 0 0; padding: 26px 20px 30px; }
  .modal h2 { font-size: 22px; }
}

/* =====================================================================
   TRANG QUẢN TRỊ
   ===================================================================== */
.admin-body { background-color: var(--bg); }
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; flex: none; background: var(--teal); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow: hidden; }
.sidebar .rings { position: absolute; left: -130px; bottom: -130px; opacity: .25; pointer-events: none; }
.sidebar > * { position: relative; }
.side-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; padding: 4px 6px 20px; }
.side-brand:hover { color: #fff; }
.side-brand .logo-mark { background: #fff; color: var(--teal); }
.side-brand small { display: block; font-size: 13px; color: #9ee6d9; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; text-decoration: none; color: #d3f2ea; font-size: 15px; font-weight: 500; }
.side-nav a:hover { background: var(--teal-soft); color: #fff; }
.side-nav a.active { background: #fff; color: var(--teal); font-weight: 600; }
.side-foot { margin-top: auto; border-top: 1px solid #2a9488; padding-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.side-foot .who { display: flex; align-items: center; gap: 10px; padding: 6px 14px 10px; font-size: 14px; color: #d3f2ea; }
.side-foot a, .side-foot button { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; text-decoration: none; font-size: 15px; color: #d3f2ea; background: none; border: 0; text-align: left; }
.side-foot a:hover, .side-foot button:hover { background: var(--teal-soft); color: #fff; }
.admin-main { flex: 1; min-width: 0; padding: 28px 36px 60px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.admin-head h1 { font-size: 28px; font-weight: 700; }
.admin-head p { margin-top: 4px; color: var(--muted); }
.admin-head .back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; text-decoration: none; margin-bottom: 6px; }
.panel { background: #fff; border: 1px solid var(--line-soft); border-radius: 20px; padding: 18px; }
.panel + .panel { margin-top: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.panel-head h2 { font-size: 20px; font-weight: 600; }
.panel-head p { color: var(--muted); font-size: 14px; }
.filters { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chips button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 15px; font-size: 14px; font-weight: 500; }
.filter-chips button.on { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.filters .search-box { margin-left: auto; width: 280px; flex: none; padding: 8px 14px; font-size: 14px; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); padding: 12px 14px; border-bottom: 1.5px solid var(--line-soft); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid #e8f4f1; font-size: 15px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; }
.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; }
.prod-cell { display: flex; align-items: center; gap: 12px; }
.prod-thumb { width: 48px; height: 48px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.prod-thumb img { width: 40px; } .prod-thumb.photo img { width: 100%; height: 100%; object-fit: cover; }
.prod-name { font-weight: 600; }
.prod-sub { font-size: 13px; color: var(--muted); }
.price-edit { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 2px 0; border-bottom: 1.5px dashed #9fd8cd; font-weight: 700; color: var(--teal); font-size: 15px; }
.price-edit:hover { border-bottom-color: var(--teal); }
.price-edit .unit { font-weight: 400; }
.price-form { display: inline-flex; align-items: center; gap: 6px; }
.price-form input { width: 100px; border: 2px solid var(--teal); border-radius: 10px; padding: 6px 10px; font-weight: 700; color: var(--teal); box-shadow: 0 0 0 3px #ccefe6; outline: none; }
.price-form .hint { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.mini-btn { width: 32px; height: 32px; border-radius: 9px; border: 1.5px solid var(--line); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex: none; text-decoration: none; }
.mini-btn.ok { background: var(--teal); border-color: var(--teal); color: #fff; }
.mini-btn.big { width: 36px; height: 36px; border-radius: 10px; color: var(--teal); }
.mini-btn.del { color: var(--danger); border-color: #fbd5d1; }
.mini-btn:hover { background: var(--field); }
.mini-btn.ok:hover { background: var(--teal-dark); }
.tag { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.tag-on { background: #dcfce7; color: #166534; }
.tag-off { background: #eef2f1; color: var(--muted); }
.tag-out { background: var(--ink); color: #fff; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea { border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 14px; font-size: 15px; font-weight: 400; color: var(--ink); background: var(--field-2); outline: none; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px #ccefe6; }
.field textarea { resize: vertical; min-height: 96px; }
.field .help { font-weight: 400; font-size: 13px; }
.field.invalid input, .field.invalid select { border-color: var(--danger); }
.field .err { color: var(--danger); font-weight: 400; font-size: 13px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--field); border-radius: 14px; padding: 14px 16px; }
.toggle-row b { display: block; font-size: 15px; font-weight: 600; }
.toggle-row span { color: var(--muted); font-size: 13px; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #c5d9d4; transition: background .15s; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + i { background: var(--teal); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid #5eead4; outline-offset: 2px; }

.edit-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.preview { position: sticky; top: 24px; }
.preview .label { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.images { display: flex; gap: 12px; flex-wrap: wrap; }
.img-item { width: 104px; height: 104px; border-radius: 14px; border: 1.5px solid var(--line-soft); position: relative; overflow: hidden; background: #fff; }
.img-item img { width: 100%; height: 100%; object-fit: cover; }
.img-item.main { border: 2px solid var(--teal); }
.img-item .tag-main { position: absolute; left: 6px; bottom: 6px; background: var(--teal); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.img-item .img-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.img-item .img-tools button { width: 26px; height: 26px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .92); display: flex; align-items: center; justify-content: center; color: var(--ink); }
.img-add { width: 104px; height: 104px; border-radius: 14px; border: 2px dashed #9fd8cd; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--teal); font-size: 13px; font-weight: 500; cursor: pointer; background: #fbfefd; text-align: center; }
.img-add input { display: none; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.inline-msg { font-size: 14px; margin-top: 10px; }
.inline-msg.err { color: var(--danger); }

.toast { position: fixed; right: 32px; bottom: 24px; display: flex; align-items: center; gap: 14px; background: var(--ink); color: #fff; border-radius: 16px; padding: 13px 16px 13px 18px; box-shadow: 0 12px 28px rgba(18, 49, 45, .28); font-size: 15px; z-index: 120; max-width: calc(100vw - 32px); }
.toast .ok { width: 26px; height: 26px; border-radius: 50%; background: #22c55e; display: flex; align-items: center; justify-content: center; flex: none; }
.toast.error .ok { background: var(--danger); }
.toast button { border: 0; background: none; color: var(--ring); font-weight: 600; padding: 0 0 0 14px; border-left: 1px solid #2f5a54; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-side { background: var(--teal); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-side > * { position: relative; }
.login-side .rings { position: absolute; right: -180px; bottom: -180px; opacity: .28; }
.login-side h1 { font-size: 40px; font-weight: 700; line-height: 1.15; }
.login-side p { margin-top: 14px; color: var(--on-teal); font-size: 16px; max-width: 420px; line-height: 1.6; }
.login-side a { color: #fff; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 400px; max-width: 100%; display: flex; flex-direction: column; gap: 16px; }
.login-card h2 { font-size: 26px; font-weight: 700; }
.login-card .sub { color: var(--muted); }
.login-card .foot { color: var(--muted); font-size: 14px; }

.tabbar { display: none; }
.admin-mobile-top { display: none; }

@media (max-width: 760px) {
  .sidebar { display: none; }
  .admin-main { padding: 0 16px 100px; }
  .admin-mobile-top { display: flex; align-items: center; gap: 12px; background: var(--teal); color: #fff; margin: 0 -16px 16px; padding: 14px 16px; position: relative; overflow: hidden; }
  .admin-mobile-top .rings { position: absolute; right: -110px; top: -120px; opacity: .28; }
  .admin-mobile-top > * { position: relative; }
  .admin-mobile-top .logo-mark { background: #fff; color: var(--teal); width: 36px; height: 36px; }
  .admin-mobile-top .title { font-size: 19px; font-weight: 700; flex: 1; }
  .admin-mobile-top a { color: #fff; }
  .admin-head { margin-bottom: 14px; }
  .admin-head h1 { font-size: 22px; }
  .admin-head .btn { display: none; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff; border-top: 1px solid var(--line-soft); padding: 10px 8px 14px; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; }
  .tabbar a.active { color: var(--teal); font-weight: 600; }
  .panel { padding: 12px; border-radius: 18px; }
  .filters .search-box { width: 100%; margin-left: 0; order: -1; }
  .filter-chips { flex-wrap: nowrap; overflow-x: auto; }
  .filter-chips button { flex: none; }

  /* Bảng thành danh sách thẻ */
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; }
  .tbl thead { display: none; }
  .tbl tr { position: relative; border: 1px solid var(--line-card); border-radius: 16px; padding: 12px; margin-bottom: 10px; background: #fff; }
  .tbl td { border: 0; padding: 3px 0; font-size: 14px; }
  .tbl td[data-label]::before { content: attr(data-label) ': '; color: var(--muted); }
  .tbl td.cell-main::before, .tbl td.cell-actions::before { content: none; }
  .tbl td.cell-actions { position: absolute; top: 12px; right: 12px; padding: 0; }
  .tbl td.cell-main { padding-right: 90px; }
  .tbl .actions { flex-direction: column; }
  .prod-sub, .tag, .price-form .hint { font-size: 14px; }

  .form-grid { grid-template-columns: 1fr; }
  .edit-layout { grid-template-columns: 1fr; }
  .preview { display: none; }
  .form-actions { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; background: #fff; border-top: 1px solid var(--line-soft); padding: 10px 16px 14px; z-index: 60; }
  .form-actions .btn { flex: 1; }
  .edit-page .tabbar { display: none; }
  .toast { left: 16px; right: 16px; bottom: 84px; font-size: 14px; }
  .toggle-row span, .field .help, .field .err { font-size: 14px; }

  .login-page { grid-template-columns: 1fr; }
  .login-side { padding: 40px 24px 70px; text-align: center; align-items: center; }
  .login-side h1 { font-size: 26px; }
  .login-side p { display: none; }
  .login-main { padding: 0 16px 40px; margin-top: -44px; align-items: flex-start; }
  .login-card { background: #fff; border: 1px solid var(--line-soft); border-radius: 22px; padding: 22px 18px; }
}
@media (max-width: 760px) {
  .admin-body:not(.edit-page) .form-actions { bottom: 71px; border-top: 0; background: transparent; padding-bottom: 0; }
}
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
/* Bảng sản phẩm quản trị: giữ giá và tên trên một dòng */
.price-edit, .tbl .tag { white-space: nowrap; }
.prod-cell { min-width: 230px; }
.tbl td.updated { color: var(--muted); font-size: 13px; white-space: nowrap; }
@media (max-width: 760px) {
  .prod-cell { min-width: 0; }
  .tbl td.updated { white-space: normal; }
  .admin-head .back-link { display: none; }
}
#table { overflow-x: auto; }
@media (min-width: 761px) { .tbl th, .tbl td { padding-left: 10px; padding-right: 10px; } }
