/* ==========================================================
   OsudBD — design tokens
   Palette grounded in the amber medicine bottle / pharmacy
   ledger, not a generic template palette.
   ========================================================== */
:root {
  --paper:        #F6F8F6;
  --paper-dim:     #EEF2EF;
  --ink:          #12241F;
  --ink-soft:     #4B5C56;
  --green:        #1F6F54;
  --green-dark:   #123F30;
  --green-tint:   #E4F0EA;
  --amber:        #B8722A;
  --amber-tint:   #F6E9D8;
  --herbal:       #6B7F3F;
  --herbal-tint:  #EDF1E1;
  --line:         #DBE3DE;
  --card:         #FFFFFF;
  --danger:       #A63C3C;
  --radius:       10px;
  --shadow:       0 1px 2px rgba(18,36,31,.06), 0 4px 16px rgba(18,36,31,.05);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'IBM Plex Sans', -apple-system, Segoe UI, sans-serif;
  --font-mono:    'IBM Plex Mono', Menlo, Consolas, monospace;
}

/* ---------- Bangla typography ----------
   Fraunces has no Bengali glyphs, so headings would silently fall back
   to a generic serif. Hind Siliguri covers both weight range and
   legibility for Bengali script; swap the whole display/body stack
   when in Bangla mode rather than leaving Fraunces in the chain. */
body.lang-bn {
  --font-display: 'Hind Siliguri', 'IBM Plex Sans', sans-serif;
  --font-body:    'Hind Siliguri', -apple-system, Segoe UI, sans-serif;
}
/* Bengali digits/numerals in prices and counts render fine in Plex Mono's
   fallback, but line-height needs a touch more room for Bengali script's
   taller conjuncts and matras. */
body.lang-bn { line-height: 1.65; }
body.lang-bn .rx-label h1,
body.lang-bn .hero h1,
body.lang-bn .med-card h3 { line-height: 1.35; }

/* ---------- Language switcher ---------- */
.lang-switch { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 13px; margin-left: 4px; }
.lang-switch a { color: var(--ink-soft); font-weight: 600; padding: 2px 4px; }
.lang-switch a.active { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.lang-switch a:hover { color: var(--green); text-decoration: none; }
.lang-sep { color: var(--line); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.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: 12px; top: -48px; z-index: 100;
  background: var(--green); color: #fff; padding: 10px 16px; border-radius: 7px;
  font-size: 13.5px; font-weight: 600; transition: top .15s ease;
}
.skip-link:focus { top: 12px; text-decoration: none; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
  transition: box-shadow .2s ease;
}
.site-header.is-scrolled { box-shadow: 0 2px 14px rgba(18,36,31,.08); }
.site-header .inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 22px; color: var(--ink); }
.brand .rx { width: 34px; height: 34px; border-radius: 8px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 700; font-size: 15px; flex-shrink: 0; box-shadow: 0 2px 6px rgba(31,111,84,.35); }
.brand span.tagline { display: block; font-family: var(--font-body); font-weight: 400; font-size: 11.5px; color: var(--ink-soft); letter-spacing: .02em; }

.header-search { flex: 1; max-width: 480px; position: relative; }
.header-search form { display: flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--paper); transition: border-color .15s, box-shadow .15s; }
.header-search form:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-tint); }
.header-search input { flex: 1; border: 0; background: transparent; padding: 9px 16px; font-family: var(--font-body); font-size: 16px; color: var(--ink); }
.header-search input:focus { outline: none; }
.header-search button { border: 0; background: var(--green); color: #fff; padding: 0 18px; cursor: pointer; font-size: 14px; transition: background .15s; }
.header-search button:hover { background: var(--green-dark); }

.main-nav { display: flex; gap: 18px; font-size: 14px; align-items: center; }
.main-nav a { color: var(--ink-soft); font-weight: 500; position: relative; }
.main-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--amber); transform: scaleX(0); transition: transform .15s; }
.main-nav a:hover { color: var(--green); text-decoration: none; }
.main-nav a:hover::after { transform: scaleX(1); }

.nav-toggle { display: none; border: 1px solid var(--line); background: var(--card); border-radius: 8px; width: 38px; height: 38px; cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { content: ""; display: block; width: 18px; height: 2px; background: var(--ink); position: relative; transition: transform .15s; }
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(circle at 8px 8px, rgba(31,111,84,.09) 1.5px, transparent 1.6px) 0 0 / 26px 26px,
    linear-gradient(180deg, var(--green-tint) 0%, var(--paper) 100%);
  padding: 56px 0 36px; text-align: center;
}
.hero h1 { font-family: var(--font-display); font-size: clamp(28px, 4.2vw, 46px); font-weight: 600; margin: 0 0 10px; color: var(--green-dark); }
.hero p.sub { color: var(--ink-soft); font-size: 16px; margin: 0 auto 28px; max-width: 560px; }

.pill-search { max-width: 620px; margin: 0 auto; position: relative; }
.pill-search form { display: flex; align-items: center; background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); padding: 6px 6px 6px 22px; }
.pill-search input[type="text"] { flex: 1; border: 0; background: transparent; font-size: 16px; padding: 10px 8px; font-family: var(--font-body); }
.pill-search input[type="text"]:focus { outline: none; }
.pill-search button { border: 0; background: var(--green); color: #fff; font-weight: 600; padding: 12px 26px; border-radius: 999px; cursor: pointer; font-size: 14.5px; transition: background .15s; }
.pill-search button:hover { background: var(--green-dark); }
.hero-hint { margin-top: 14px; font-size: 13px; color: var(--ink-soft); }
.hero-hint a { color: var(--amber); font-weight: 600; }

/* Stat strip */
.stats { display: flex; justify-content: center; gap: 46px; padding: 30px 0; flex-wrap: wrap; }
.stats .stat { text-align: center; }
.stats .stat b { display: block; font-family: var(--font-mono); font-size: 26px; color: var(--green-dark); }
.stats .stat span { font-size: 12.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Blister-pack divider (signature element) ---------- */
.blister-divider { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 0 34px; }
.blister-divider .dash { flex: 1; max-width: 220px; border-top: 1.5px dashed var(--line); }
.blister-divider .dots { display: flex; gap: 7px; }
.blister-divider .dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--amber); background: var(--amber-tint); display: block; }

/* ---------- Section headings ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 16px; }
.section-head h2 { font-family: var(--font-display); font-size: 22px; margin: 0; color: var(--ink); }
.section-head a.more { font-size: 13.5px; font-weight: 600; }

/* ---------- Category / dosage chips ---------- */
.chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 44px; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font-size: 13.5px; font-weight: 500; color: var(--ink); text-align: center; transition: border-color .15s, transform .15s; }
.chip:hover { border-color: var(--green); text-decoration: none; transform: translateY(-1px); }

/* ---------- Popular searches ---------- */
.popular-searches { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.popular-searches a { font-size: 12.5px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); }
.popular-searches a:hover { border-color: var(--amber); color: var(--amber); text-decoration: none; }

/* ---------- Live search dropdown ---------- */
.live-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(18,36,31,.16);
  max-height: 420px; overflow-y: auto; z-index: 60; text-align: left;
  animation: card-in .15s ease both;
}
.live-results .lr-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); color: var(--ink);
}
.live-results .lr-item:last-child { border-bottom: 0; }
.live-results .lr-item:hover,
.live-results .lr-item.active { background: var(--paper-dim); text-decoration: none; }
.live-results .lr-visual {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: var(--green-tint); color: var(--green); display: flex; align-items: center; justify-content: center;
}
.live-results .lr-visual.herbal { background: var(--herbal-tint); color: var(--herbal); }
.live-results .lr-visual svg { width: 17px; height: 17px; }
.live-results .lr-main { flex: 1; min-width: 0; }
.live-results .lr-name { display: block; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-results .lr-name mark { background: var(--amber-tint); color: var(--amber); border-radius: 3px; padding: 0 1px; }
.live-results .lr-meta { display: block; font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-results .lr-price { flex-shrink: 0; font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--green-dark); }
.live-results .lr-viewall { display: block; text-align: center; padding: 11px; font-size: 13px; font-weight: 700; color: var(--green); background: var(--paper); }
.live-results .lr-viewall:hover { background: var(--green-tint); text-decoration: none; }
.live-results .lr-empty, .live-results .lr-loading { padding: 18px 14px; text-align: center; font-size: 13px; color: var(--ink-soft); }

/* ---------- Medicine visual (product photo, or dosage-form icon) ---------- */
.med-visual {
  position: relative; flex-shrink: 0; width: 56px; height: 56px; border-radius: 12px;
  background: var(--green-tint); color: var(--green);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.med-visual.herbal { background: var(--herbal-tint); color: var(--herbal); }
.med-visual svg { width: 28px; height: 28px; }
.med-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.rx-visual { width: 84px; height: 84px; border-radius: 16px; }
.rx-visual svg { width: 40px; height: 40px; }

/* ---------- Dosage-form icon chips (home + browse-by-form) ---------- */
.chip-grid-icons { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.chip-icon { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 14px; }
.chip-icon-badge {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 9px;
  background: var(--green-tint); color: var(--green); display: flex; align-items: center; justify-content: center;
}
.chip-icon-badge svg { width: 18px; height: 18px; }

/* ---------- Medicine cards ---------- */
.med-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.med-card {
  display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  animation: card-in .35s ease both;
}
.med-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(18,36,31,.10); border-color: #cfdbd4; }
.med-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--green); }
.med-card.herbal::before { background: var(--herbal); }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .med-card { animation: none; }
  .med-card:hover { transform: none; }
}
.med-card .med-main { flex: 1; min-width: 0; }
.med-card h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 18px; }
.med-card h3 a { color: var(--ink); }
.med-card .generic { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 8px; }
.med-card .meta-row { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--ink-soft); }
.med-card .meta-row b { color: var(--ink); font-weight: 600; }
.med-card .price-box { flex-shrink: 0; text-align: right; align-self: center; }
.med-card .price-box .price { font-family: var(--font-mono); font-size: 19px; font-weight: 600; color: var(--green-dark); }
.med-card .price-box .unit { font-size: 11px; color: var(--ink-soft); }

.tag { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 5px; background: var(--green-tint); color: var(--green-dark); }
.tag.herbal { background: var(--herbal-tint); color: var(--herbal); }
.tag.form { background: var(--paper-dim); color: var(--ink-soft); }

/* ---------- Filters bar ---------- */
.filters-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.filters-bar select, .filters-bar input[type="text"] { font-family: var(--font-body); font-size: 15px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); }
.filters-bar button { font-family: var(--font-body); font-size: 13.5px; padding: 7px 16px; border: 0; border-radius: 7px; background: var(--green); color: #fff; cursor: pointer; }
.result-count { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 14px; }

/* ---------- Active filter pills ---------- */
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.filter-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--green-tint); color: var(--green-dark); border-radius: 999px; padding: 5px 8px 5px 12px; font-size: 12.5px; font-weight: 600; }
.filter-pill a { color: var(--green-dark); font-weight: 700; line-height: 1; opacity: .7; }
.filter-pill a:hover { opacity: 1; text-decoration: none; }
.clear-filters { font-size: 12.5px; color: var(--amber); font-weight: 600; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 30px 0; flex-wrap: wrap; }
.page-btn { border: 1px solid var(--line); background: var(--card); padding: 7px 13px; border-radius: 7px; font-size: 13.5px; color: var(--ink); }
.page-btn:hover { border-color: var(--green); text-decoration: none; }
.page-btn.active { background: var(--green); color: #fff; border-color: var(--green); }
.page-dots { color: var(--ink-soft); align-self: center; padding: 0 4px; }

/* ---------- Medicine detail (prescription-label style) ---------- */
.rx-label { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 30px; box-shadow: var(--shadow); margin-bottom: 24px; }
.rx-label .rx-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 1.5px dashed var(--line); padding-bottom: 18px; margin-bottom: 20px; }
.rx-head-main { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.rx-label h1 { font-family: var(--font-display); font-size: 30px; margin: 0 0 6px; }
.rx-label .rx-generic { font-size: 15px; color: var(--ink-soft); }
.rx-label .rx-generic a { font-weight: 600; }
.rx-price { text-align: right; }
.rx-price .price { font-family: var(--font-mono); font-size: 28px; font-weight: 700; color: var(--green-dark); }
.rx-price .unit { font-size: 12px; color: var(--ink-soft); }

.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px 24px; }
.spec-grid .spec dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin-bottom: 4px; }
.spec-grid .spec dd { margin: 0; font-family: var(--font-mono); font-size: 15px; color: var(--ink); }

.related-title { font-family: var(--font-display); font-size: 19px; margin: 34px 0 12px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 13px; color: var(--ink-soft); margin: 18px 0; }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--green); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty-state h3 { font-family: var(--font-display); color: var(--ink); font-size: 20px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 34px 0 22px; background: var(--card); }
.site-footer .inner { display: flex; flex-direction: column; gap: 22px; font-size: 13px; color: var(--ink-soft); }
.footer-top { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-brand { max-width: 480px; }
.footer-brand .brand { margin-bottom: 10px; }
.site-footer .disclaimer { max-width: 640px; line-height: 1.6; }
.footer-links { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.footer-links a { color: var(--ink-soft); font-weight: 500; }
.footer-links a:hover { color: var(--green); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  border-top: 1px solid var(--line); padding-top: 18px;
}
.footer-credit a {
  display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600;
}
.footer-credit a:hover { color: var(--green-dark); text-decoration: none; }
.footer-credit svg { flex-shrink: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .site-header .inner { flex-wrap: wrap; }
  .header-search { order: 3; max-width: 100%; width: 100%; }
  .nav-toggle { display: flex; order: 2; }
  .main-nav {
    order: 4; width: 100%; flex-direction: column; align-items: flex-start; gap: 2px;
    max-height: 0; overflow: hidden; transition: max-height .2s ease;
  }
  .main-nav.open { max-height: 200px; padding-top: 8px; }
  .main-nav a { padding: 10px 4px; width: 100%; }
  .lang-switch { margin: 6px 0 4px 4px; }
  .med-card { flex-wrap: wrap; align-items: flex-start; }
  .med-card .med-visual { width: 44px; height: 44px; border-radius: 10px; }
  .med-card .med-visual svg { width: 22px; height: 22px; }
  .med-card .med-main { flex-basis: 0; }
  .med-card .price-box { text-align: left; align-self: flex-start; margin-left: 58px; }
  .rx-label { padding: 20px; }
  .rx-label .rx-head { flex-direction: column; }
  .rx-visual { width: 60px; height: 60px; border-radius: 12px; }
  .rx-visual svg { width: 28px; height: 28px; }
  .rx-price { text-align: left; }
  .rx-label h1 { font-size: 24px; }

  .live-results { max-height: 60vh; }

  .hero { padding: 40px 0 28px; }
  .pill-search form { flex-direction: column; align-items: stretch; padding: 6px; border-radius: 18px; gap: 8px; }
  .pill-search input[type="text"] { padding: 10px 12px; font-size: 16px; }
  .pill-search button { border-radius: 12px; padding: 12px; }

  .filters-bar { flex-direction: column; align-items: stretch; }
  .filters-bar select, .filters-bar input[type="text"], .filters-bar button { width: 100%; }

  .stats { gap: 28px; }
  .section-head { flex-wrap: wrap; gap: 6px; }

  .footer-top { flex-direction: column; }
  .footer-links { flex-direction: row; flex-wrap: wrap; gap: 12px 18px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .brand span.tagline { display: none; }
  .med-card .meta-row { gap: 6px 10px; }
}
