/* An Khang Pharma — storefront styles.
   Identity: warm ivory paper + deep apothecary green. The one loud element is
   the "today's pharmacist" slip in the hero; everything else stays quiet. */

:root {
  --ink: #14241d;
  --apothecary: #0d6b4a;
  --leaf: #1f9d6f;
  --paper: #fbf9f3;
  --mint: #e7f2ec;
  --clay: #b4572a;
  --line: #dfe4dd;
  --muted: #5c6b63;

  --radius: 14px;
  --radius-lg: 22px;
  --wrap: 1180px;

  --shadow-sm: 0 1px 2px rgba(20, 36, 29, 0.06);
  --shadow-md: 0 18px 40px -28px rgba(20, 36, 29, 0.45);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* `display: flex` on cards would otherwise beat the browser's own [hidden] rule,
   which silently breaks the product filter. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--leaf);
  outline-offset: 2px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.btn-primary {
  background: var(--apothecary);
  color: #fff;
}

.btn-primary:hover {
  background: #0a5a3e;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--apothecary);
  color: var(--apothecary);
}

.btn:active {
  transform: translateY(1px);
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(251, 249, 243, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.notice {
  background: var(--ink);
  color: #dfe9e2;
  font-size: 13px;
  text-align: center;
  padding: 7px 20px;
}

.notice strong {
  color: #fff;
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 13px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--apothecary);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--muted);
}

.search {
  position: relative;
  flex: 1;
  max-width: 430px;
}

.search input {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 11px 16px 11px 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}

.search input::placeholder {
  color: #93a19a;
}

.search svg {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.header-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* Category bar doubles as the mobile navigation: one scrollable row. */
.catbar {
  border-top: 1px solid var(--line);
}

.catbar-inner {
  display: flex;
  gap: 10px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 10px 24px;
  overflow-x: auto;
  scrollbar-width: none;
}

.catbar-inner::-webkit-scrollbar {
  display: none;
}

.catbar a {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.catbar a:hover {
  color: var(--apothecary);
  border-color: var(--line);
  background: #fff;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero {
  padding: 58px 0 66px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--apothecary);
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(34px, 4.5vw, 54px);
  margin-bottom: 20px;
}

.hero-lede {
  font-size: 17px;
  color: var(--muted);
  max-width: 53ch;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
}

.trust span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.trust svg {
  color: var(--leaf);
  flex-shrink: 0;
}

/* The pharmacist slip: a paper ticket with two punched notches. */
.slip {
  position: relative;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 26px 28px 24px;
}

.slip::before,
.slip::after {
  content: "";
  position: absolute;
  top: 126px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
}

.slip::before {
  left: -13px;
}

.slip::after {
  right: -13px;
}

.slip-kicker {
  font-size: 13px;
  font-weight: 600;
  color: var(--apothecary);
  margin-bottom: 15px;
}

.duty {
  display: flex;
  align-items: center;
  gap: 14px;
}

.duty-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
}

.duty-role {
  font-size: 13px;
  color: var(--muted);
}

.slip-rule {
  border: 0;
  border-top: 1px dashed #ccd6ce;
  margin: 20px 0;
}

.slip-rows {
  display: grid;
  gap: 11px;
  font-size: 14px;
}

.slip-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.slip-row dt {
  color: var(--muted);
}

.slip-row dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.slip-note {
  margin-top: 20px;
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--mint);
  font-size: 13.5px;
  color: #1c4a37;
}

/* ── Sections ────────────────────────────────────────────────────────────── */

.section {
  padding: 62px 0;
}

.section-alt {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  max-width: 62ch;
  margin-bottom: 34px;
}

.section-head h2 {
  font-size: clamp(26px, 3vw, 36px);
  margin-bottom: 12px;
}

.section-head p {
  font-size: 16px;
  color: var(--muted);
}

.services {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.service {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
}

.service-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--mint);
  color: var(--apothecary);
  display: grid;
  place-items: center;
}

.service h3 {
  font-size: 17.5px;
  margin-bottom: 8px;
}

.service p {
  font-size: 14px;
  color: var(--muted);
}

.products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.product {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.product-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--mint);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-flag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(20, 36, 29, 0.85);
}

.product-flag.rx {
  background: var(--clay);
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px 20px;
}

.product-brand {
  font-size: 12.5px;
  color: var(--muted);
}

.product h3 {
  font-size: 18px;
}

.product-desc {
  flex: 1;
  font-size: 14px;
  color: var(--muted);
}

.product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.price {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}

.price-old {
  margin-left: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  text-decoration: line-through;
}

.product .btn {
  padding: 9px 16px;
  font-size: 14px;
}

/* A real three-step sequence, so numbering carries information here. */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  counter-reset: step;
}

.step {
  border-top: 2px solid var(--ink);
  padding-top: 18px;
}

.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--clay);
}

.step h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.step p {
  font-size: 14.5px;
  color: var(--muted);
}

.band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 30px 32px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: #e6efe9;
}

.band h2 {
  font-size: 24px;
  color: #fff;
  margin-bottom: 8px;
}

.band p {
  max-width: 62ch;
  font-size: 14.5px;
  color: #b9cbc1;
}

.band .btn-ghost {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.band .btn-ghost:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.site-footer {
  margin-top: 62px;
  padding: 52px 0 24px;
  background: var(--ink);
  color: #a8bbb1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 30px;
}

.site-footer h3 {
  font-size: 20px;
  color: #fff;
  margin-bottom: 12px;
}

.site-footer h4 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
}

.site-footer p,
.site-footer a {
  font-size: 14px;
}

.site-footer ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: #a8bbb1;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid #2a3a33;
  font-size: 13px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .services,
  .products {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .header-bar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 18px;
  }
  .search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
  .catbar-inner {
    padding: 10px 18px;
  }
  .hero {
    padding: 40px 0 48px;
  }
  .hero-lede {
    font-size: 16px;
  }
  .section {
    padding: 46px 0;
  }
  .services,
  .products,
  .steps,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .steps {
    gap: 20px;
  }
  .band {
    padding: 24px;
  }
  .slip::before,
  .slip::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

/* ── Details used by the markup ──────────────────────────────────────────── */

.duty-initials {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--mint);
  color: var(--apothecary);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}

.grid-empty {
  margin-top: 26px;
  padding: 18px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-size: 14.5px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(20, 36, 29, 0.07);
}

.band code {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* The sticky header must not cover whatever a link jumps to. */
:target,
section[id],
.product[id] {
  scroll-margin-top: 118px;
}

/* Transient feedback for actions the widget cannot acknowledge itself. */
#pharma-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 70;
  max-width: min(92vw, 430px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#pharma-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
