/* Y2K pastel: xanh baby + hồng kẹo. --accent đổi được trong trang quản lý. */
:root {
  --bg: #f4f1ff;
  --surface: #ffffff;
  --ink: #3a2a5c;
  --muted: #7d70a0;
  --line: #e4dcfb;
  --pink: #ffb8dc;
  --pink-soft: #ffe3f1;
  --blue: #a9dcff;
  --blue-soft: #e0f2ff;
  --lilac: #d9c8ff;
  --accent: #ff5fa2;
  --accent-ink: #ffffff;
  --radius: 22px;
  --glow: 0 2px 0 rgba(255, 255, 255, .9) inset, 0 8px 24px rgba(160, 120, 230, .18);
  --display: "Baloo 2", "Be Vietnam Pro", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font: 15px/1.55 "Be Vietnam Pro", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 8% 4%, rgba(255, 184, 220, .75), transparent 32%),
    radial-gradient(circle at 92% 12%, rgba(169, 220, 255, .85), transparent 34%),
    radial-gradient(circle at 70% 60%, rgba(217, 200, 255, .45), transparent 40%),
    radial-gradient(circle at 10% 85%, rgba(169, 220, 255, .5), transparent 35%);
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
main, .top, .foot { max-width: 1120px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* Chữ "chrome" kiểu Y2K */
.chrome {
  background: linear-gradient(100deg, #ff5fa2 0%, #b98cff 45%, #55b8ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 12px; padding-bottom: 12px; max-width: none;
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, .8);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 21px/1 var(--display); }
.brand img { width: 38px; height: 38px; border-radius: 12px; object-fit: cover; }
.brand .mark {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 17px;
  background: linear-gradient(135deg, var(--pink), var(--blue)); color: #fff; box-shadow: var(--glow);
}
.top-cta {
  text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap;
  background: linear-gradient(135deg, #ff8cc4, #9fd3ff); color: #fff; padding: 9px 16px; border-radius: 999px;
  box-shadow: var(--glow); text-shadow: 0 1px 2px rgba(120, 60, 160, .25);
}

/* Hero */
.hero { position: relative; padding: 34px 0 10px; }
.hero h1 {
  font: 800 clamp(32px, 7.5vw, 56px)/1.05 var(--display); margin: 0 0 12px; letter-spacing: -.01em; max-width: 16ch;
}
.hero p { color: var(--muted); margin: 0; max-width: 58ch; font-size: 15.5px; }
.sparkle { position: absolute; color: #fff; pointer-events: none; text-shadow: 0 0 12px rgba(255, 95, 162, .55); font-size: 26px; }
.sparkle.s1 { right: 6%; top: 18px; color: #ff8cc4; }
.sparkle.s2 { right: 18%; top: 78px; font-size: 16px; color: #7cc4ff; }
.sparkle.s3 { right: 2%; top: 110px; font-size: 18px; color: #b98cff; }

/* Chương trình: khung "cửa sổ" kiểu Y2K */
.promos { display: grid; gap: 14px; margin: 22px 0 8px; }
.promos:empty { display: none; }
.promo {
  background: rgba(255, 255, 255, .8); border: 2px solid #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--glow);
}
.promo::before {
  content: "✦ ✦ ✦"; display: block; font-size: 10px; letter-spacing: 4px; color: #fff; padding: 6px 14px;
  background: linear-gradient(90deg, var(--pink), var(--lilac));
}
.promo:nth-child(2n)::before { background: linear-gradient(90deg, var(--blue), var(--lilac)); }
.promo img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.promo > div { padding: 14px 18px 16px; }
.promo .tag { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.promo:nth-child(2n) .tag { color: #3d9be9; }
.promo h3 { margin: 2px 0 4px; font: 700 20px/1.25 var(--display); }
.promo p { margin: 0; color: var(--muted); font-size: 14px; }
.promo .code {
  display: inline-block; margin-top: 10px; font: 700 13px/1 "Be Vietnam Pro", sans-serif; cursor: pointer; color: var(--ink);
  border: 2px dashed var(--accent); padding: 6px 12px; border-radius: 999px; background: var(--pink-soft);
}
@media (min-width: 720px) {
  .promos { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
  .promo.has-img:first-child { grid-column: 1 / -1; }
}

/* Thanh công cụ */
.catalog { padding-top: 18px; scroll-margin-top: 70px; }
.toolbar { display: flex; gap: 8px; margin: 8px 0 12px; }
.toolbar input, .toolbar select {
  font: inherit; border: 2px solid #fff; background: rgba(255, 255, 255, .85); color: var(--ink);
  border-radius: 999px; padding: 10px 16px; min-width: 0; box-shadow: var(--glow);
}
.toolbar input { flex: 1; }
.toolbar input:focus, .toolbar select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink);
  border: 2px solid #fff; background: rgba(255, 255, 255, .75); padding: 7px 15px; border-radius: 999px;
}
.chip small { color: var(--muted); margin-left: 4px; }
.chip[aria-pressed="true"] { background: linear-gradient(135deg, #ff8cc4, #9fd3ff); color: #fff; box-shadow: var(--glow); }
.chip[aria-pressed="true"] small { color: inherit; opacity: .85; }
.count { color: var(--muted); font-size: 13px; margin: 8px 0 10px; }

/* Lưới sản phẩm */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card {
  position: relative; text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 6px;
  background: rgba(255, 255, 255, .9); border: 2px solid #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--glow); transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 2px 0 #fff inset, 0 14px 30px rgba(255, 95, 162, .22); }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.media { aspect-ratio: 1; background: var(--blue-soft); overflow: hidden; border-radius: 16px; }
.media img { width: 100%; height: 100%; object-fit: cover; }
/* Ảnh tạm khi chưa có ảnh: vân lớp in 3D trên nền xanh-hồng */
.ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.4) 0 2px, transparent 2px 6px),
    linear-gradient(150deg, var(--pink), var(--lilac) 50%, var(--blue));
}
.ph span { font: 800 46px/1 var(--display); color: rgba(255, 255, 255, .9); text-shadow: 0 2px 10px rgba(120, 60, 160, .25); }
.badge {
  position: absolute; top: 14px; left: 14px; font-size: 12px; font-weight: 800;
  background: #fff; color: var(--accent); padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 3px 10px rgba(255, 95, 162, .3); transform: rotate(-4deg);
}
.badge::before { content: "✦ "; }
.card .info { padding: 10px 8px 8px; }
.card h3 { font-size: 14.5px; font-weight: 600; margin: 0 0 4px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.price b { font: 800 17px/1.2 var(--display); }
.price .sale { color: var(--accent); }
.price s { color: var(--muted); font-size: 13px; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 0; }

/* Liên hệ */
.contact {
  margin: 52px 0 24px; padding: 26px 20px; border-radius: 28px; scroll-margin-top: 70px;
  background: linear-gradient(135deg, rgba(255, 227, 241, .95), rgba(224, 242, 255, .95));
  border: 2px solid #fff; box-shadow: var(--glow);
}
.contact h2 { margin: 0 0 6px; font: 800 28px/1.15 var(--display); }
.contact p { margin: 0 0 16px; color: var(--muted); }
.contact-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ct {
  display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700;
  padding: 12px 14px; border-radius: 999px; border: 2px solid #fff; background: rgba(255, 255, 255, .9);
  box-shadow: var(--glow); transition: transform .15s;
}
.ct:hover { transform: translateY(-2px); }
.ct i { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-style: normal; color: #fff; font-size: 12px; font-weight: 800; }
.ct-zalo i { background: #0068ff; }
.ct-messenger i { background: linear-gradient(135deg, #00b2ff, #a033ff); }
.ct-facebook i { background: #1877f2; }
.ct-instagram i { background: linear-gradient(135deg, #feda75, #d62976 50%, #4f5bd5); }
.ct-tiktok i { background: #111; }
.ct-phone i { background: #33b48a; }
.ct-shopee i { background: #ee4d2d; }
.ct-other i { background: var(--muted); }

.foot { color: var(--muted); font-size: 13px; padding-top: 8px; padding-bottom: 40px; text-align: center; }

/* Chi tiết sản phẩm */
dialog {
  border: 2px solid #fff; padding: 0; width: min(920px, 100% - 24px); max-height: calc(100% - 24px);
  border-radius: 26px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(120, 60, 160, .3);
}
dialog::backdrop { background: rgba(90, 60, 140, .35); backdrop-filter: blur(4px); }
.close {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid #fff; background: var(--pink-soft); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer;
}
.detail { display: grid; }
@media (min-width: 760px) { .detail { grid-template-columns: 1.05fr 1fr; } }
.gallery { padding: 8px; }
.gallery .media { aspect-ratio: 1; border-radius: 20px; }
.thumbs { display: flex; gap: 8px; padding: 10px 2px; overflow-x: auto; }
.thumbs button { flex: none; width: 58px; height: 58px; padding: 0; border: 3px solid transparent; border-radius: 14px; overflow: hidden; cursor: pointer; background: none; }
.thumbs button[aria-current="true"] { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.dbody { padding: 20px; }
.dbody .cat { display: inline-block; font-size: 12.5px; font-weight: 700; color: #3d9be9; background: var(--blue-soft); padding: 3px 10px; border-radius: 999px; }
.dbody h2 { margin: 8px 0 8px; font: 800 26px/1.15 var(--display); }
.dbody .price b { font-size: 26px; }
.dbody .desc { margin: 14px 0; white-space: pre-line; }
.specs { margin: 0 0 16px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; background: #faf7ff; padding: 12px 14px; border-radius: 16px; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }
.ask { font: 800 18px/1.3 var(--display); margin: 18px 0 8px; }
.dbody .contact-list { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: linear-gradient(135deg, #ff7eb6, #8cc8ff); color: #fff; font-weight: 600; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; transition: .2s ease; z-index: 100; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--glow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
