/* Nhà thuốc An Tâm – demo. Mobile-first, không JavaScript. */

:root {
  --teal: #0F766E;
  --teal-dark: #0B5A54;
  --teal-ink: #0A3F3B;
  --cyan: #0891B2;
  --mint: #E6F7F4;
  --mint-2: #CFEFE8;
  --white: #FFFFFF;
  --ink: #12302E;
  --muted: #45605D;
  --line: #CFE3DF;
  --alert: #E11D48;
  --ok: #0B6B45;

  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --shadow: 0 1px 2px rgba(10, 63, 59, 0.06), 0 8px 24px rgba(10, 63, 59, 0.08);
  --shadow-lg: 0 2px 4px rgba(10, 63, 59, 0.06), 0 16px 40px rgba(10, 63, 59, 0.12);

  --font: "Atkinson Hyperlegible", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-body: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);
  --fs-h1: clamp(2rem, 1.4rem + 2.8vw, 3.5rem);
  --fs-h2: clamp(1.625rem, 1.3rem + 1.4vw, 2.375rem);
  --fs-h3: clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem);
  --fs-small: 1rem;
  --maxw: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  overflow-x: hidden;
}

img, svg { max-width: 100%; }
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--teal-dark); text-underline-offset: 3px; }
a:hover { color: var(--teal-ink); }
[id] { scroll-margin-top: 5.5rem; }

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

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

.skip-link {
  position: absolute; left: var(--s-4); top: -4rem; z-index: 100;
  background: var(--teal-ink); color: #fff; padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm); text-decoration: none; font-weight: 700;
}
.skip-link:focus { top: var(--s-3); color: #fff; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--s-4);
}
@media (min-width: 768px) { .wrap { padding-inline: var(--s-6); } }

.ico { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.2em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: var(--s-3) var(--s-5);
  font: inherit; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none;
  border: 2px solid transparent; border-radius: 999px; cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 6px 16px rgba(15, 118, 110, 0.28); }
.btn-primary:hover { color: #fff; box-shadow: 0 10px 22px rgba(15, 118, 110, 0.34); }
.btn-outline { background: #fff; color: var(--teal-dark); border-color: var(--teal); }
.btn-outline:hover { color: var(--teal-dark); box-shadow: 0 6px 14px rgba(15, 118, 110, 0.16); }
.btn-block { width: 100%; }

/* ---------- Top bar ---------- */
.topbar { background: var(--teal-ink); color: #E6F7F4; font-size: var(--fs-small); }
.topbar-in {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-1) var(--s-5);
  padding-block: var(--s-2);
}
.topbar a { color: #fff; font-weight: 700; }
.topbar p { display: flex; align-items: center; gap: var(--s-2); }
@media (max-width: 599px) { .topbar-in { justify-content: center; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}
.header-in {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: var(--s-2) var(--s-4); padding-block: var(--s-3);
}
.brand { display: inline-flex; align-items: center; gap: var(--s-3); text-decoration: none; color: var(--ink); min-height: 48px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.1875rem; color: var(--teal-dark); }
.brand-text small { font-size: 0.9375rem; color: var(--muted); }
.brand-mark { flex: none; }
.header-cta { padding-inline: var(--s-4); }

.main-nav { grid-column: 1 / -1; order: 3; }
.main-nav ul { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); }
.main-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-3);
  border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1rem;
  background: var(--mint);
}
.main-nav a:hover { background: var(--mint-2); color: var(--teal-ink); }

@media (min-width: 992px) {
  .header-in { grid-template-columns: auto 1fr auto; }
  .main-nav { grid-column: auto; order: 0; justify-self: center; }
  .main-nav a { background: transparent; }
  .main-nav a:hover { background: var(--mint); }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--s-7); }
@media (min-width: 992px) { .section { padding-block: var(--s-8); } }

.section-head { margin-bottom: var(--s-6); max-width: 46rem; }
.eyebrow {
  display: inline-block; margin-bottom: var(--s-3); padding: var(--s-1) var(--s-3);
  background: var(--mint); color: var(--teal-ink); border-radius: 999px;
  font-weight: 700; font-size: 0.9375rem; letter-spacing: 0.02em;
}
h1, h2, h3 { line-height: 1.2; color: var(--teal-ink); text-wrap: balance; }
h2 { font-size: var(--fs-h2); margin-bottom: var(--s-3); }
h3 { font-size: var(--fs-h3); }
.section-lead, .lead { color: var(--muted); max-width: 40rem; }
.lead { font-size: 1.1875rem; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(60rem 30rem at 90% -10%, rgba(8, 145, 178, 0.10), transparent 60%),
    linear-gradient(180deg, var(--mint) 0%, #F6FCFB 70%, #fff 100%);
  padding-block: var(--s-6) var(--s-7);
}
.hero-grid { display: grid; gap: var(--s-6); align-items: center; }
.hero h1 { font-size: var(--fs-h1); letter-spacing: -0.01em; margin-bottom: var(--s-4); }
.hero h1 span { color: var(--teal); display: block; }
.hero-art svg { display: block; width: 100%; height: auto; max-width: 560px; margin-inline: auto; filter: drop-shadow(0 18px 24px rgba(10, 63, 59, 0.12)); }

.search { margin-top: var(--s-5); }
.search label { display: block; font-weight: 700; margin-bottom: var(--s-2); color: var(--teal-ink); }
.search-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.search-row input, .search-row select { flex: 1 1 14rem; }
input[type="search"], input[type="text"], input[type="tel"], input[type="file"], select, textarea {
  width: 100%; min-height: 52px; padding: var(--s-3) var(--s-4);
  font: inherit; color: var(--ink); background: #fff;
  border: 2px solid #9CC7C0; border-radius: var(--r-sm);
}
textarea { resize: vertical; min-height: 96px; }
input::placeholder, textarea::placeholder { color: #5B7370; opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-color: var(--teal); }
input[type="file"] { padding: var(--s-3); cursor: pointer; }
input[type="file"]::file-selector-button {
  margin-right: var(--s-3); min-height: 40px; padding: 0 var(--s-4);
  font: inherit; font-weight: 700; color: #fff; background: var(--teal);
  border: 0; border-radius: 999px; cursor: pointer;
}

.hero-points { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin-top: var(--s-5); font-weight: 700; color: var(--teal-ink); }
.hero-points li { display: flex; align-items: center; gap: var(--s-2); }
.hero-points .ico { color: var(--teal); }

@media (min-width: 900px) {
  .hero { padding-block: var(--s-7) var(--s-8); }
  .hero-grid { grid-template-columns: 1.05fr 1fr; gap: var(--s-7); }
}

/* ---------- Quick tiles ---------- */
.quick { margin-top: calc(var(--s-6) * -1); position: relative; z-index: 2; }
.quick-grid { display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
.tile {
  display: flex; align-items: center; gap: var(--s-4); min-height: 88px; padding: var(--s-4);
  background: #fff; border: 2px solid var(--line); border-radius: var(--r-md);
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--ink); }
.tile-icon {
  display: grid; place-items: center; flex: none; width: 56px; height: 56px;
  border-radius: 16px; background: var(--teal); color: #fff;
}
.tile-icon svg { width: 28px; height: 28px; }
.tile-text { display: flex; flex-direction: column; line-height: 1.3; }
.tile-text strong { font-size: 1.1875rem; color: var(--teal-ink); }
.tile-text small { font-size: 1rem; color: var(--muted); }
@media (min-width: 640px) { .quick-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .quick-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Categories ---------- */
.cat-grid { display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
.cat {
  display: grid; grid-template-columns: auto 1fr; column-gap: var(--s-4); align-items: center;
  min-height: 88px; padding: var(--s-4); text-decoration: none; color: var(--ink);
  background: var(--mint); border-radius: var(--r-md); border: 2px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cat:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.cat-icon {
  grid-row: span 2; display: grid; place-items: center; width: 60px; height: 60px;
  border-radius: 50%; background: #fff; color: var(--teal); box-shadow: inset 0 0 0 2px var(--mint-2);
}
.cat-icon svg { width: 30px; height: 30px; }
.cat strong { font-size: 1.1875rem; color: var(--teal-ink); line-height: 1.25; align-self: end; }
.cat small { font-size: 1rem; color: var(--muted); line-height: 1.35; align-self: start; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Prescription ---------- */
.rx { background: linear-gradient(180deg, #fff 0%, var(--mint) 100%); }
.rx-grid { display: grid; gap: var(--s-6); align-items: start; }
.steps { display: grid; gap: var(--s-3); margin-block: var(--s-5); }
.steps li { display: flex; align-items: center; gap: var(--s-3); font-weight: 700; }
.steps span {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px;
  border-radius: 50%; background: var(--teal); color: #fff;
}
.notice {
  display: flex; gap: var(--s-3); padding: var(--s-4);
  background: #fff; border: 2px solid var(--teal); border-left-width: 8px; border-radius: var(--r-sm);
  color: var(--ink);
}
.notice .ico { width: 1.75rem; height: 1.75rem; color: var(--teal); margin-top: 2px; }
.card {
  background: #fff; border: 2px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s-5); box-shadow: var(--shadow-lg);
}
.rx-form h3 { margin-bottom: var(--s-4); }
.field { margin-bottom: var(--s-4); }
.field label { display: block; margin-bottom: var(--s-2); font-weight: 700; color: var(--teal-ink); }
.hint { margin-top: var(--s-2); font-size: 1rem; color: var(--muted); }
@media (min-width: 900px) {
  .rx-grid { grid-template-columns: 1fr 1fr; gap: var(--s-7); }
  .card { padding: var(--s-6); }
}

/* ---------- Products ---------- */
.product-grid { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
.product {
  position: relative; display: flex; flex-direction: column; gap: var(--s-1);
  padding: var(--s-4); background: #fff; border: 2px solid var(--line); border-radius: var(--r-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.product:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product h3 { margin-top: var(--s-3); font-size: 1.1875rem; }
.meta { font-size: 1rem; color: var(--muted); }
.price { margin-top: var(--s-2); display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s-2); }
.price strong { font-size: 1.375rem; color: var(--teal-ink); }
.price s { font-size: 1rem; color: var(--muted); }
.stock { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-3); font-weight: 700; color: var(--ok); font-size: 1rem; }
.product .btn { margin-top: auto; }
.badge {
  position: absolute; top: var(--s-3); left: var(--s-3); z-index: 1;
  padding: var(--s-1) var(--s-3); background: var(--alert); color: #fff;
  font-weight: 700; font-size: 0.9375rem; border-radius: 999px; line-height: 1.4;
}
.product-art {
  display: grid; place-items: center; aspect-ratio: 1 / 0.82; border-radius: var(--r-sm);
  --c1: #0F766E; --c2: #0891B2;
  background: radial-gradient(circle at 50% 30%, #fff 0%, var(--mint) 70%);
}
.product-art svg { width: 72%; height: auto; max-height: 100%; }
.pa-teal { --c1: #0F766E; --c2: #0891B2; }
.pa-cyan { --c1: #0891B2; --c2: #0F766E; background: radial-gradient(circle at 50% 30%, #fff 0%, #DDF3F8 75%); }
.pa-mint { --c1: #14A394; --c2: #0B5A54; }
.pa-sand { --c1: #0F766E; --c2: #0891B2; background: radial-gradient(circle at 50% 30%, #fff 0%, #EFF6F3 75%); }
.c1 { fill: var(--c1); }
.c2 { fill: var(--c2); }
.fineprint { margin-top: var(--s-5); font-size: 1rem; color: var(--muted); max-width: 46rem; }

@media (min-width: 560px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1150px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Promo ---------- */
.promo { background: var(--teal); color: #fff; }
.promo-in { display: grid; gap: var(--s-4); align-items: center; padding-block: var(--s-6); }
.promo-badge {
  justify-self: start; padding: var(--s-2) var(--s-4); background: var(--alert); color: #fff;
  font-weight: 700; border-radius: 999px; border: 2px solid #fff;
}
.promo h2 { color: #fff; margin-bottom: var(--s-2); font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem); }
.promo p { color: #F0FBF9; }
.promo-list { display: grid; gap: var(--s-2); font-weight: 700; }
.promo-list li { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-4); background: rgba(255, 255, 255, 0.14); border-radius: var(--r-sm); }
@media (min-width: 992px) {
  .promo-in { grid-template-columns: auto 1fr auto; gap: var(--s-6); }
}

/* ---------- Advice ---------- */
.adv-grid { display: grid; gap: var(--s-4); }
.adv { padding: var(--s-5); background: var(--mint); border-radius: var(--r-lg); }
.adv-head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); }
.adv-head p { display: flex; flex-direction: column; line-height: 1.3; }
.adv-head small { color: var(--muted); font-size: 0.9375rem; }
.avatar { flex: none; width: 60px; height: 60px; border-radius: 50%; box-shadow: 0 0 0 3px #fff; }
.adv h3 { margin-bottom: var(--s-2); }
.adv > p { color: var(--ink); }
.cta-row { margin-top: var(--s-6); }
@media (min-width: 768px) { .adv-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Stores ---------- */
.stores { background: linear-gradient(180deg, #fff, var(--mint)); }
.stores-grid { display: grid; gap: var(--s-6); align-items: start; }
.stores .section-head { margin-bottom: 0; }
.store-list { display: grid; gap: var(--s-3); }
.store { padding: var(--s-4) var(--s-5); background: #fff; border: 2px solid var(--line); border-radius: var(--r-md); }
.store h3 { margin-bottom: var(--s-2); }
.store p { display: flex; gap: var(--s-2); align-items: flex-start; color: var(--ink); }
.store .ico { color: var(--teal); margin-top: 0.2em; }
.store a { font-weight: 700; display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 992px) {
  .stores-grid { grid-template-columns: 1fr 1.2fr; gap: var(--s-7); }
  .stores-grid .section-head { position: sticky; top: 6rem; }
}

/* ---------- Reviews ---------- */
.rev-grid { display: grid; gap: var(--s-4); }
.rev { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5); background: #fff; border: 2px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.stars { width: 120px; height: 24px; color: #B45309; }
.star-off { opacity: 0.25; }
.rev blockquote { font-size: 1.125rem; }
.rev figcaption { color: var(--muted); font-size: 1rem; margin-top: auto; }
.rev figcaption strong { color: var(--teal-ink); }
@media (min-width: 768px) { .rev-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- FAQ ---------- */
.faq { background: var(--mint); }
.faq-in { max-width: 860px; }
.faq-list { display: grid; gap: var(--s-3); }
details { background: #fff; border: 2px solid var(--line); border-radius: var(--r-md); }
summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  min-height: 56px; padding: var(--s-3) var(--s-4); cursor: pointer; list-style: none;
  font-weight: 700; color: var(--teal-ink);
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; flex: none; width: 12px; height: 12px;
  border-right: 3px solid var(--teal); border-bottom: 3px solid var(--teal);
  transform: rotate(45deg); transition: transform 0.2s ease;
}
details[open] summary::after { transform: rotate(-135deg); }
details[open] { border-color: var(--teal); }
details p { padding: 0 var(--s-4) var(--s-4); color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--teal-ink); color: #DDF1ED; padding-block: var(--s-7) var(--s-5); }
.footer-grid { display: grid; gap: var(--s-6); padding-bottom: var(--s-6); }
.site-footer h2 { font-size: 1.1875rem; color: #fff; margin-bottom: var(--s-3); }
.site-footer a { color: #fff; }
.brand-light { color: #fff; }
.brand-light .brand-text strong { color: #fff; }
.brand-light .brand-text small { color: #BFE3DC; }
.foot-note { margin-top: var(--s-3); max-width: 26rem; }
.foot-list { display: grid; gap: var(--s-1); }
.foot-list a { display: inline-flex; align-items: center; min-height: 44px; }
.disclaimer {
  padding: var(--s-4) var(--s-5); background: #fff; color: var(--teal-ink);
  border-radius: var(--r-md); border-left: 8px solid var(--alert); font-weight: 400;
}
.copy { margin-top: var(--s-4); font-size: 1rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .btn:hover, .tile:hover, .cat:hover, .product:hover { transform: none; }
}
