/* ============================================================
   H'ALLURE — giao diện theo thiết kế Figma (mobile 430px)
   ============================================================ */
@font-face { font-family: 'Bricolage'; src: url('../fonts/BricolageGrotesque-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url('../fonts/BricolageGrotesque-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url('../fonts/BricolageGrotesque-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Playfair'; src: url('../fonts/PlayfairDisplay-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }

:root {
  --den: #111;
  --xam-dam: #666;
  --xam: #9a9a9a;
  --xam-nhat: #cfcfcf;
  --nut: #d9d9d9;
  --dai-km: #e4e4e4;
  --nen: #fff;
  --nen-trang: #f3f0ee;
  --hong: #f3e4e4;
  --nau: #7b4a3a;
  --rong-max: 480px;
  --font-body: 'Bricolage', 'Helvetica Neue', Arial, sans-serif;
  --font-ten: 'Playfair', Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  color: var(--den);
  background: var(--nen-trang);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }

/* Khung điện thoại: full màn hình trên mobile, căn giữa trên desktop */
.khung {
  position: relative;
  max-width: var(--rong-max);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--nen);
}
@media (min-width: 481px) {
  .khung { box-shadow: 0 0 40px rgba(0,0,0,.06); }
}

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  height: 74px;
  background: var(--nen);
}
.header .logo { width: 152px; height: auto; }
.header .logo svg { width: 100%; height: auto; display: block; }
.header .nut-goc {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
}
.header .nut-goc.trai { left: 6px; }
.header .nut-goc.phai { right: 6px; }

/* ---------- Dải khuyến mãi ---------- */
.dai-km {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--dai-km);
  height: 44px; align-items: center;
  text-align: center; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
}

/* ---------- Khối NEW IN ---------- */
.newin {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 190px;
  gap: 0;
}
.newin .o { position: relative; overflow: hidden; }
.newin .o img { width: 100%; height: 100%; object-fit: cover; }
.newin .o.chu {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ten); font-size: 64px; line-height: 1; color: #2b2b2b;
}
.newin .rong2 { grid-column: span 2; }
.newin .cao2 { grid-row: span 2; }

/* ---------- Lưới sản phẩm ---------- */
.luoi { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.luoi .the { position: relative; overflow: hidden; }
.luoi .the.rong { grid-column: span 2; }
.the .truot {
  display: flex; height: 100%;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.the .truot::-webkit-scrollbar { display: none; }
.the .truot img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; }
.the { aspect-ratio: 215 / 340; }
.the.rong { aspect-ratio: 430 / 580; }
.the .dem {
  position: absolute; top: 10px; right: 12px;
  font-size: 11px; color: #fff; text-shadow: 0 0 4px rgba(0,0,0,.35);
}
.the .them {
  position: absolute; right: 8px; bottom: 8px;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  color: #fff; filter: drop-shadow(0 0 3px rgba(0,0,0,.4));
}
.the .them svg { width: 22px; height: 22px; }
.the .ten-nho {
  position: absolute; left: 0; right: 0; bottom: 10px; text-align: center;
  font-size: 9px; letter-spacing: .18em; color: rgba(255,255,255,.9); text-shadow: 0 0 4px rgba(0,0,0,.4);
  pointer-events: none;
}

/* ---------- Nút giỏ hàng nổi ---------- */
.gio-noi {
  position: fixed; right: 18px; bottom: 34px; z-index: 30;
  width: 52px; height: 52px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center;
}
@media (min-width: 481px) { .gio-noi { right: calc(50% - var(--rong-max) / 2 + 18px); } }
.gio-noi svg { width: 24px; height: 24px; }
.gio-noi .so {
  position: absolute; top: -2px; right: -2px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--den); color: #fff; font-size: 11px; font-weight: 600;
  display: none; align-items: center; justify-content: center;
}
.gio-noi .so.co { display: flex; }

/* ---------- Trang sản phẩm ---------- */
.hero { position: relative; }
.hero .truot { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hero .truot::-webkit-scrollbar { display: none; }
.hero .truot img { flex: 0 0 100%; width: 100%; aspect-ratio: 430 / 800; object-fit: cover; scroll-snap-align: start; }
.hero .dem { position: absolute; top: 10px; right: 12px; font-size: 11px; color: #fff; text-shadow: 0 0 4px rgba(0,0,0,.35); }

.noi-dung { padding: 0 16px; }
.ten-sp { font-family: var(--font-ten); font-size: 24px; font-weight: 400; margin: 18px 0 8px; }
.gia { font-size: 15px; font-weight: 600; margin: 0 0 20px; }
.mo-ta p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.45; }

.thuoc-tinh { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--xam-nhat); }
.thuoc-tinh li {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 33px; padding: 6px 0; border-bottom: 1px solid var(--xam-nhat);
}
.thuoc-tinh .gia-tri { display: flex; align-items: center; gap: 12px; }
.cham {
  width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08);
  position: relative;
}
.cham.chon::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--den);
}
.size-nut { color: var(--xam); padding: 2px 1px; }
.size-nut.chon { color: var(--den); text-decoration: underline; text-underline-offset: 3px; }

.lien-ket { margin: 14px 0 0; }
.lien-ket button, .lien-ket a { display: block; color: var(--xam-dam); font-size: 13.5px; padding: 6px 0; }
.lien-ket button::before, .lien-ket a::before { content: '›'; margin-right: 6px; }

.nut-chinh {
  display: block; width: calc(100% - 76px); margin: 28px auto 0;
  height: 32px; background: var(--nut); color: var(--den);
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase; text-align: center; line-height: 32px;
}
.nut-chinh:disabled { opacity: .5; }

.tieu-de-phu { font-size: 14px; font-weight: 600; text-transform: uppercase; margin: 44px 0 14px; }
.luoi-nho { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.luoi-nho .the { aspect-ratio: 190 / 275; }

/* ---------- Footer Facebook (collage theo thiết kế) ---------- */
.footer-fb { position: relative; padding: 30px 16px 20px; }
.footer-fb .collage { position: relative; width: 100%; aspect-ratio: 430 / 520; }
.footer-fb .collage img { position: absolute; object-fit: cover; }
.footer-fb .collage .a { right: 0; top: 0; width: 31%; aspect-ratio: 2 / 3; }
.footer-fb .collage .b { left: 0; top: 38%; width: 34%; aspect-ratio: 2 / 3; }
.footer-fb .collage .c { right: 4%; top: 52%; width: 48%; aspect-ratio: 2 / 3; }
.footer-fb .chu {
  position: absolute; left: 0; right: 31%; top: 25%;
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
}
.footer-fb .chu span { font-size: 20px; color: var(--xam); }
.footer-fb .chu .logo { width: 110px; }
.footer-fb .chu .logo svg { width: 100%; height: auto; display: block; }

/* ---------- Popup (bottom sheet) ---------- */
.lop-phu {
  position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.35);
  display: none;
}
.lop-phu.mo { display: block; }
.tam {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: var(--rong-max); margin: 0 auto;
  background: #fff; min-height: 50vh; max-height: 92vh; overflow-y: auto;
  padding: 16px 16px 28px;
  transform: translateY(100%); transition: transform .28s ease;
}
.lop-phu.mo .tam { transform: none; }
.tam .dong-x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.tam .quay-lai { position: absolute; top: 12px; left: 8px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.tam .dau { display: flex; align-items: baseline; justify-content: space-between; margin: 40px 0 0; }
.tam .dau .ten-sp { margin: 0; }
.tam .dau small { color: var(--den); font-size: 12px; }
.tam .cot2 { display: grid; grid-template-columns: 140px 1fr; gap: 16px; margin-top: 40px; }
.tam .cot2 img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.tam .cot2 .ten-sp { margin: 0 0 6px; font-size: 22px; }
.tam .thuoc-tinh { margin-top: 0; }
.tam .thuoc-tinh li { min-height: 30px; padding: 4px 0; font-size: 13px; }
.tam .gia-dong { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.tam .lien-ket { display: flex; gap: 18px; margin-top: 14px; }
.tam .lien-ket button { font-size: 12.5px; }
.tam .nut-chinh { margin-top: 26px; }

.stepper { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.stepper button { width: 22px; height: 22px; font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.stepper .sl { min-width: 12px; text-align: center; text-decoration: underline; text-underline-offset: 3px; }

/* bảng size */
.bang-size { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12.5px; }
.bang-size th, .bang-size td { padding: 8px 6px; border-bottom: 1px solid var(--xam-nhat); text-align: center; }
.bang-size th:first-child, .bang-size td:first-child { text-align: left; padding-left: 14px; }
.bang-size th { font-weight: 600; }

/* hướng dẫn bảo quản */
.bao-quan { margin: 8px 0 0; }
.bao-quan dl { display: grid; grid-template-columns: 130px 1fr; gap: 14px 24px; margin: 0; padding: 18px 0; border-top: 1px solid var(--xam-nhat); }
.bao-quan dl:first-child { border-top: 0; }
.bao-quan dt { font-size: 12px; font-weight: 600; text-transform: uppercase; }
.bao-quan dd { margin: 0; font-size: 12.5px; line-height: 1.5; }

/* ---------- Giỏ hàng ---------- */
.gio .dong-x { display: flex; justify-content: flex-end; padding: 4px 8px 0; }
.gio .dong-x button { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.mat-hang { display: grid; grid-template-columns: 88px 1fr; gap: 16px; padding: 12px 16px; }
.mat-hang img { width: 100%; aspect-ratio: 88 / 142; object-fit: cover; }
.mat-hang .ten-sp { margin: 2px 0 8px; font-size: 22px; padding-bottom: 6px; border-bottom: 1px solid var(--xam-nhat); }
.mat-hang .chi-tiet { font-size: 12px; color: var(--xam-dam); line-height: 1.35; }
.mat-hang .duoi { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; }
.mat-hang .duoi .gia { margin: 0; font-size: 14px; }
.mat-hang .xoa { font-size: 11px; color: var(--xam); text-decoration: underline; margin-left: 8px; }
.gio-trong { padding: 60px 16px; text-align: center; color: var(--xam-dam); }

.uu-dai { margin-top: 24px; border-top: 1px solid var(--xam-nhat); }
.uu-dai .dong { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 16px; border-bottom: 1px solid var(--xam-nhat); font-size: 13.5px; color: var(--xam); }
.uu-dai .dong.dat { color: var(--den); }
.uu-dai .dong img { width: 88px; aspect-ratio: 1; object-fit: cover; }
.uu-dai .dong b { font-weight: 600; }

.tong { padding: 14px 16px 0; font-size: 13.5px; }
.tong .dong { display: flex; justify-content: space-between; padding: 3px 0; }
.tong .dong.lon { font-weight: 600; font-size: 14px; }
.gio .nut-chinh { margin: 20px auto 40px; }

/* ---------- Đặt hàng ---------- */
.form { padding: 30px 16px 40px; }
.form h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; margin: 0 0 22px; }
.truong { margin-bottom: 18px; }
.truong label { display: block; font-size: 14px; padding-bottom: 4px; border-bottom: 1px solid var(--xam-nhat); }
.truong input, .truong textarea {
  width: 100%; border: 0; outline: 0; padding: 10px 0 4px; font: inherit; font-size: 14px; color: var(--den); background: none; resize: none;
}
.truong input::placeholder, .truong textarea::placeholder { color: var(--xam); }
.truong .loi { color: #b3261e; font-size: 12px; margin-top: 4px; display: none; }
.truong.sai .loi { display: block; }
.truong.sai label { border-color: #b3261e; }
.form .nut-chinh { margin-top: 24px; }
.tom-tat { padding: 0 16px; font-size: 13px; color: var(--xam-dam); }
.tom-tat .dong { display: flex; justify-content: space-between; padding: 2px 0; }
.tom-tat .dong.lon { color: var(--den); font-weight: 600; }
.hp { position: absolute; left: -9999px; }

/* ---------- Trang cảm ơn / toàn màn ---------- */
.man-anh {
  position: relative; min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  color: #fff; text-align: center; overflow: hidden;
}
.man-anh .nen {
  position: absolute; inset: 0; background: url('../img/tote.jpg') center / cover no-repeat;
  filter: blur(14px) brightness(.85); transform: scale(1.1);
}
.man-anh .header { background: transparent; position: relative; }
.man-anh .header .logo svg * { fill: #fff; }
.man-anh .giua { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 30px 80px; }
.man-anh .giua p { margin: 0 0 6px; font-size: 16px; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.man-anh .giua small { font-size: 12px; opacity: .9; }
.man-anh .giua .ma { font-size: 13px; opacity: .95; margin-top: 12px; }

/* ---------- Thông báo nhỏ ---------- */
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(10px);
  background: var(--den); color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 4px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 50; white-space: nowrap;
}
.toast.hien { opacity: 1; transform: translateX(-50%); }

.an { display: none !important; }
