:root {
  --page-w: 420px;
  --red: #d42a1f;
  --red-dark: #a8170e;
  --red-text: #d71d0f;
  --yellow: #ffc618;
  --yellow-light: #fff701;
  --gold-1: #fed35b;
  --gold-2: #f3a83b;
  --navy: #1f1d7a;
  --blue-text: #21578f;
  --purple: #4f56c4;
  --green: #2e7d32;
  --dark: #2d2926;
  --text: #0a0a0a;
  --muted: #555;
  --line: #e5e7eb;
  --bg-outside: #e5e7eb;
  --c1: #d9772b;
  --c2: #23497f;
  --c3: #e2a01b;
  --c4: #7b4fe0;
  --font-head: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Roboto', Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-outside);
  color: var(--text);
  font: 16px/1.5 var(--font-body);
}

img {
  display: block; max-width: 100%;
  -webkit-touch-callout: none; /* tắt menu "Lưu ảnh" khi nhấn giữ ảnh trên điện thoại */
  -webkit-user-drag: none;
  user-select: none;
}

/* Cột nội dung kiểu landing page mobile, căn giữa trên desktop */
.page {
  max-width: var(--page-w);
  margin: 0 auto;
  background: #fff;
  overflow-x: clip; /* clip (không phải hidden) để thanh trên cùng vẫn sticky */
  box-shadow: 0 0 24px rgba(0, 0, 0, .08);
}

section { padding: 20px 16px; scroll-margin-top: 60px; }

.full { width: 100%; height: auto; }
.rounded { border-radius: 8px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ===== Nút ===== */
.btn {
  display: block;
  width: fit-content;
  margin: 18px auto 4px;
  padding: 13px 34px;
  border: 0;
  border-radius: 30px;
  font: 700 17px/1.2 var(--font-body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s, filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: wait; }

.btn-red {
  color: #fff;
  background: linear-gradient(180deg, #e8473b, var(--red-dark));
  box-shadow: 0 5px 12px rgba(168, 23, 14, .35);
  animation: pulse 1.6s infinite;
}
.btn-sm { margin: 0; padding: 9px 16px; font-size: 14px; animation: none; }

.btn-gold {
  width: 76%;
  color: #fff;
  font-size: 18px;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  box-shadow: 0 4px 10px rgba(0, 0, 0, .3);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-red { animation: none; }
  html { scroll-behavior: auto; }
}

/* ===== Thanh trên cùng ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #111;
  color: #fff;
}
.logo { width: 108px; height: auto; border-radius: 4px; flex: none; }
.topbar-text { flex: 1; margin: 0; font-size: 13px; line-height: 1.3; }

/* ===== Hero ===== */
.hero { padding: 0; }
.hero-title {
  margin: 0;
  padding: 12px 16px;
  font: 600 19px/1.35 var(--font-head);
  text-align: center;
  background: linear-gradient(180deg, var(--yellow-light), var(--yellow));
}
.hero-sub {
  margin: 0;
  padding: 14px 16px;
  color: var(--red-text);
  font-size: 16px;
  background: #f4f4fb;
}

/* Khung vuông; ảnh ngang hiển thị đủ (contain), phần trống phủ bản mờ của chính ảnh đó */
.gallery-main { position: relative; aspect-ratio: 1; overflow: hidden; background: #123a7a; }
.gallery-main::before {
  content: '';
  position: absolute; inset: -30px;
  background: var(--gallery-bg, none) center / cover;
  filter: blur(18px) brightness(.8);
}
.gallery-main img { position: relative; width: 100%; height: 100%; object-fit: contain; }
.gallery-nav {
  position: absolute; top: 50%;
  width: 34px; height: 34px;
  margin-top: -17px;
  border: 0; border-radius: 50%;
  font-size: 24px; line-height: 1;
  color: #fff; background: rgba(0, 0, 0, .35);
  cursor: pointer;
}
.gallery-nav.prev { left: 8px; }
.gallery-nav.next { right: 8px; }
.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
}
.gallery-thumbs img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border: 2px solid transparent;
  opacity: .6;
  cursor: pointer;
}
.gallery-thumbs img.active { border-color: var(--yellow); opacity: 1; }

/* ===== Giá ===== */
.price-sec {
  text-align: center;
  background: linear-gradient(180deg, #d5dbe8, #eef1f7 45%, #fff);
}
.origin {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0 0 6px;
  color: var(--red-text);
  font-weight: 500;
}
.stats {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
  font-size: 14px;
}
.stars { color: #f5b301; letter-spacing: 1px; font-size: 18px; }
.stars.small { font-size: 13px; }
.score { text-decoration: underline; font-size: 17px; }
.sep { padding-left: 8px; border-left: 1px solid #999; }

.price-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 12px;
  padding: 12px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #c62d22, var(--red-dark));
  box-shadow: 0 6px 14px rgba(168, 23, 14, .3);
  text-align: left;
}
.price-off { flex: 1; display: flex; flex-direction: column; }
.price-off span { font-weight: 700; font-size: 20px; }
.price-off strong { color: var(--gold-1); font-size: 46px; line-height: 1; }
.price-now { flex: 1.1; display: flex; flex-direction: column; gap: 6px; }
.price-now s { font-weight: 700; font-size: 16px; opacity: .9; text-align: center; }
.price-new { padding: 6px 10px; border-radius: 6px; background: #fff; color: var(--red-dark); }
.price-new span { display: block; font-size: 14px; font-weight: 500; }
.price-new strong { font-size: 28px; line-height: 1.1; }
.note { margin: 0; font: 500 16px var(--font-head); }

/* ===== 4 lợi ích ===== */
.benefits { padding: 10px 20px; }
.benefit {
  display: flex; gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.benefit:last-child { border-bottom: 0; }
.benefit .num { font: 700 42px/1 var(--font-head); }
.benefit h3 { margin: 0 0 4px; font: 700 18px var(--font-body); }
.benefit p { margin: 0; font-size: 15px; text-align: justify; }
.c1 { color: var(--c1); } .c2 { color: var(--c2); }
.c3 { color: var(--c3); } .c4 { color: var(--c4); }

/* ===== Vấn đề / giải pháp ===== */
.problem, .solution { padding-left: 0; padding-right: 0; }
.h-red, .h-green {
  margin: 0 16px 14px;
  font: 600 18px/1.45 var(--font-head);
  text-align: center;
}
.h-red { color: var(--red-text); }
.h-green { color: var(--green); font-size: 26px; text-align: left; }
.solution-text {
  margin: 16px;
  color: var(--blue-text);
  font: 600 15px/1.5 var(--font-head);
  text-align: justify;
}

/* ===== Đếm ngược + form ===== */
.order-sec {
  color: #fff;
  background: linear-gradient(180deg, #000, var(--dark) 30%);
}
.only-today {
  display: flex; flex-direction: column;
  padding: 10px 24px 14px;
  border-bottom: 1px solid #555;
  font: 500 36px/1.2 var(--font-body);
}
.only-today span:last-child { align-self: flex-end; }
.countdown-label { margin: 12px 0; text-align: center; }
.countdown {
  display: flex; justify-content: center; gap: 10px;
  margin-bottom: 16px;
}
.countdown div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.countdown b {
  display: grid; place-items: center;
  width: 58px; height: 58px;
  color: var(--red);
  font: 700 28px var(--font-head);
  background: #f2f2f2;
}
.countdown span { font-size: 13px; }
.hurry {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 14px;
}
.hurry-badge { padding: 2px 10px; border-radius: 10px; background: #e2862f; }
.hurry b { color: var(--yellow); font-size: 18px; }
.bar { height: 8px; margin: 8px 0 18px; border-radius: 4px; background: #fff; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--red); }

.order-form { display: grid; gap: 10px; }
.order-form input:not([type="radio"]) {
  width: 100%;
  padding: 12px;
  font: inherit; font-size: 15px;
  color: #111;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 6px;
}
.order-form input:focus { outline: 2px solid var(--yellow); outline-offset: 0; }
.order-form input[aria-invalid="true"] { border-color: var(--red); }
.pick { margin: 4px 0 0; color: var(--yellow); font-style: italic; font-size: 14px; }
.packages {
  display: grid; gap: 14px;
  margin: 0; padding: 14px 12px;
  border: 0; border-radius: 6px;
  color: #111; background: #fff;
}
.packages label { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.packages input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { margin: 0; min-height: 1.4em; text-align: center; font-weight: 500; }
.form-status.ok { color: #7ee2a8; }
.form-status.err { color: #ff8a80; }
.order-note { margin: 4px 0 0; font-size: 14px; font-style: italic; text-align: center; }

/* ===== Ưu điểm nổi bật ===== */
.features { padding: 24px 8px; background: var(--navy); }
.pill {
  margin: 0 0 20px;
  padding: 12px;
  border-radius: 30px;
  color: #fff;
  font: 600 22px/1.3 var(--font-head);
  text-align: center;
  background: #e0473a;
}
.pill-dark { background: var(--navy); }
.feature-card {
  margin-bottom: 18px;
  padding: 18px 10px 14px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .2);
  text-align: center;
}
.feature-card h3 { margin: 0 0 12px; color: var(--red-text); font: 600 18px/1.4 var(--font-head); }
.feature-card img { width: 100%; height: auto; border-radius: 4px; }
.feature-card p { margin: 12px 0 0; font-style: italic; }

/* ===== Thông tin sản phẩm ===== */
.info ul { margin: 16px 0 0; padding: 0; list-style: none; font-size: 16px; }
.info li { padding: 4px 0; }

/* ===== Đánh giá ===== */
.reviews-head { padding-bottom: 14px; margin-bottom: 10px; border-bottom: 1px solid #ccc; }
.reviews-head > b { display: block; font-size: 20px; color: #444; }
.reviews-head div { display: flex; justify-content: space-between; margin-top: 8px; font-size: 14px; }
.sort b { padding: 4px 10px; margin-left: 6px; border-radius: 4px; background: #eee; }
.review { display: flex; gap: 12px; padding: 16px 0; }
.avatar { flex: none; width: 52px; height: 52px; border-radius: 6px; object-fit: cover; }
/* Logo cửa hàng là ảnh ngang: cắt lấy phần ngôi nhà bên trái cho vuông */
.avatar.sm { width: 40px; height: 40px; object-position: left center; }
.review-body { flex: 1; min-width: 0; }
.review-name { display: block; color: #365899; }
.review-body p { margin: 4px 0 6px; font-size: 15px; text-align: justify; }
.review-photo { width: 60%; margin-bottom: 6px; }
/* Dòng Thích · Phản hồi · lượt thích · thời gian: một hàng, căn giữa theo chiều dọc */
.review small {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px;
  color: #65676b; font-size: 13px; line-height: 20px;
}
.review small a { color: #4b67a1; font-weight: 500; cursor: pointer; }
/* Số lượt thích: biểu tượng ngón cái xanh kiểu Facebook + con số */
.likes { display: inline-flex; align-items: center; gap: 4px; }
.likes i {
  flex: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: #1877f2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M4 7h1.6v5H4zM6.4 12V7.2L8.6 4c.5-.7 1.4-.3 1.3.5L9.6 6.4h2.2c.6 0 1 .5.9 1.1l-.7 3.5c-.1.6-.6 1-1.2 1z'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.reply { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; }
.reply > div { flex: 1; min-width: 0; }
.reply p { margin: 2px 0 4px; }
/* Nút "Xem thêm bình luận..." theo trang mẫu: viên thuốc xanh, chữ trắng đậm */
.more {
  display: block;
  width: min(313px, 100%);
  height: 34px;
  margin: 8px auto 0;
  padding: 0 16px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  font: 700 15px/34px var(--font-body);
  background: rgb(81, 107, 190);
  cursor: pointer;
}
.more:hover { filter: brightness(1.08); }

/* ===== Form lần 2 ===== */
.order-sec-2 { background: var(--dark); }

/* ===== Giới thiệu ===== */
.about { display: grid; gap: 8px; padding: 16px 8px; background: #f4f4f4; }
.about-card { padding: 16px; border-radius: 8px; color: #fff; background: #000; }
.about-logo { width: 180px; margin: 0 auto 12px; border-radius: 6px; }
.about-card h2 { margin: 0 0 10px; color: var(--yellow-light); font: 600 20px/1.4 var(--font-head); text-align: center; }
.about-card p { margin: 0; font-size: 17px; text-align: justify; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.about-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }

/* ===== Cam kết ===== */
.policies { display: grid; gap: 12px; padding: 16px 12px 24px; background: #f4f4f4; }
.policy {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  color: #fff;
  background: var(--purple);
}
.policy-icon {
  display: grid; place-items: center; flex: none;
  width: 54px; height: 54px;
  border-radius: 10px;
  font-size: 26px;
  background: #1c1f3a;
}
.policy b { color: var(--yellow-light); }
.policy p { margin: 2px 0 0; font-size: 14px; }

/* ===== Footer ===== */
.footer { padding: 24px 16px 28px; color: #fff; background: #000; text-align: center; }
.footer-slogan { margin: 0; color: var(--yellow-light); font: 600 20px var(--font-head); }
.footer-sub { margin: 4px 0 18px; font: 500 19px var(--font-head); }
.hotline {
  display: inline-flex; align-items: center; gap: 10px;
  color: #fff; font-size: 22px; font-weight: 700; text-decoration: none;
}
.phone-icon {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 8px;
  background: #7dc142;
}
.branches { margin: 18px 0; padding: 0; list-style: none; text-align: left; font-size: 15px; }
.branches li { padding: 8px 0 8px 36px; position: relative; }
.branches li::before { content: '🏠'; position: absolute; left: 0; top: 6px; font-size: 20px; }
.policy-link { color: #fff; font-weight: 700; font-size: 14px; }

/* ===== Đồng ý chính sách (dưới form) ===== */
.consent { margin: 0; font-size: 13px; text-align: center; opacity: .85; }
.consent a { color: inherit; }

/* ===== Trang chính sách ===== */
.legal { padding: 24px 18px 32px; font-size: 15px; line-height: 1.65; }
.legal h1 { margin: 0 0 4px; color: var(--red-text); font: 600 24px/1.3 var(--font-head); text-align: center; }
.legal-date { margin: 0 0 18px; color: var(--muted); font-size: 13px; text-align: center; font-style: italic; }
.legal h2 {
  margin: 24px 0 8px;
  padding-left: 10px;
  border-left: 4px solid var(--red);
  color: var(--navy);
  font: 600 18px/1.35 var(--font-head);
}
.legal p { margin: 0 0 10px; text-align: justify; }
.legal ul { margin: 0 0 10px; padding-left: 22px; }
.legal li { margin-bottom: 4px; }
.legal a:not(.btn) { color: var(--red-text); }
.legal-contact { padding: 12px 14px; border-radius: 8px; background: #f4f4fb; }
.legal-contact p { margin: 0 0 4px; }
.legal .btn { animation: none; }

/* ===== Thông báo "vừa đặt mua" ===== */
/* Viên thuốc nằm trong cột trang, góc trên bên trái ngay dưới thanh trên cùng */
.toast {
  position: fixed;
  top: 60px; /* thanh trên cùng cao ~51px */
  left: max(10px, calc(50% - var(--page-w) / 2 + 10px));
  z-index: 60;
  display: flex; align-items: center; gap: 12px;
  /* Co theo chữ dài nhất (tên hoặc "Đã mua hàng"), tên quá dài thì cắt "…" */
  width: max-content;
  max-width: min(300px, calc(100vw - 20px));
  padding: 5px 20px 5px 5px;
  border: 1px solid #d6d6d6;
  border-radius: 40px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  transform: translateY(0); opacity: 1;
  transition: transform .35s, opacity .35s, visibility .35s;
}
.toast[hidden] { display: flex; visibility: hidden; transform: translateY(-20px); opacity: 0; pointer-events: none; }
.toast img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; background: #eee; }
.toast p { display: flex; flex-direction: column; margin: 0; min-width: 0; line-height: 1.4; }
.toast b { font-size: 15px; color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast span { font-size: 14px; color: #333; }
.toast small { font-size: 12px; color: #555; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ===== Popup ===== */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .6);
}
.modal[hidden] { display: none; }
.modal-box {
  width: 100%; max-width: 360px;
  padding: 24px 20px;
  border-radius: 12px;
  background: #fff;
  text-align: center;
}
.modal-box h2 { margin: 0 0 8px; color: var(--red-text); font: 600 24px var(--font-head); }
.modal-box p { margin: 0; }
.modal-box .btn { animation: none; }
