/* ===== DAVOCHI — Professional apteka dizayni ===== */
:root {
  /* Pharma palitrasi — yashil/turkuaz, oq, toza tibbiy his */
  --brand-900: #06413a;
  --brand-800: #0a5c50;
  --brand-700: #0e7c6b;
  --brand-600: #109981;
  --brand-500: #14b8a1;
  --brand-400: #34d3ba;
  --brand-100: #d6f5ee;
  --brand-50:  #eefbf8;

  --accent: #2f6fed;      /* ma'lumot / havola */
  --rx: #e0672b;          /* retsept ogohlantirish */
  --rx-bg: #fdeee4;
  --ok: #16a34a;

  --ink-900: #0c1f1c;
  --ink-700: #334744;
  --ink-600: #4b5f5a;
  --ink-400: #849792;
  --muted: #6b7f7a;

  --bg: #f4f8f7;
  --card: #ffffff;
  --line: #e4ede9;
  --shadow: 0 1px 2px rgba(6,65,58,.04), 0 8px 24px rgba(6,65,58,.06);
  --shadow-lg: 0 12px 40px rgba(6,65,58,.14);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", -apple-system, "Inter", Roboto, system-ui, sans-serif;
  color: var(--ink-900);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  display: grid; place-items: center; color: #fff; font-size: 22px; font-weight: 800;
  box-shadow: 0 6px 16px rgba(16,153,129,.35);
  position: relative;
}
.logo-mark::before,
.logo-mark::after {
  content: ""; position: absolute; background: #fff; border-radius: 2px;
}
.logo-mark::before { width: 18px; height: 5px; }
.logo-mark::after  { width: 5px; height: 18px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-size: 20px; font-weight: 800; letter-spacing: .5px; color: var(--brand-800); }
.logo-sub  { font-size: 11px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; }

.header-actions { display: flex; align-items: center; gap: 18px; }
.header-link { color: var(--ink-700); text-decoration: none; font-size: 14px; font-weight: 500; }
.header-link:hover { color: var(--brand-700); }
.header-badge {
  font-size: 12px; font-weight: 600; color: var(--brand-700);
  background: var(--brand-50); border: 1px solid var(--brand-100);
  padding: 6px 12px; border-radius: 999px;
}

/* ===== Hero + qidiruv ===== */
.hero {
  background: linear-gradient(160deg, var(--brand-700), var(--brand-900));
  color: #fff; padding: 44px 0 92px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -80px; top: -80px;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(52,211,186,.35), transparent 70%);
}
.hero h1 { font-size: 30px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.4px; }
.hero p  { font-size: 15px; opacity: .9; max-width: 560px; }

.search-wrap {
  max-width: var(--maxw); margin: -56px auto 0; padding: 0 20px;
  position: relative; z-index: 20;
}
.search-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 18px;
}
.search-box { display: flex; align-items: center; gap: 12px;
  border: 2px solid var(--line); border-radius: 12px; padding: 4px 4px 4px 16px;
  transition: border-color .15s; }
.search-box:focus-within { border-color: var(--brand-500); }
.search-box .ico { font-size: 20px; color: var(--brand-600); }
.search-box input {
  flex: 1; border: 0; outline: 0; font-size: 16px; padding: 14px 0;
  background: transparent; color: var(--ink-900);
}
.search-box input::placeholder { color: var(--ink-400); }
.search-btn {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff; border: 0; padding: 12px 22px; border-radius: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform .1s, box-shadow .15s;
}
.search-btn:hover { box-shadow: 0 6px 18px rgba(16,153,129,.4); }
.search-btn:active { transform: translateY(1px); }

.search-hint { margin-top: 10px; font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip-quick { background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100);
  padding: 4px 10px; border-radius: 999px; cursor: pointer; font-size: 12px; }
.chip-quick:hover { background: var(--brand-100); }

/* ===== Kategoriya chiplari ===== */
.cats { display: flex; gap: 10px; overflow-x: auto; padding: 26px 0 6px; scrollbar-width: thin; }
.cats::-webkit-scrollbar { height: 6px; }
.cats::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.cat {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-700);
  padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.cat:hover { border-color: var(--brand-400); color: var(--brand-700); }
.cat.active {
  background: var(--brand-600); border-color: var(--brand-600); color: #fff;
  box-shadow: 0 6px 14px rgba(16,153,129,.28);
}
.cat .cat-ico { font-size: 16px; }

/* ===== Natijalar paneli ===== */
.result-bar { display: flex; align-items: center; justify-content: space-between;
  margin: 22px 0 14px; flex-wrap: wrap; gap: 10px; }
.result-count { font-size: 14px; color: var(--muted); }
.result-count b { color: var(--ink-900); }
.rx-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-700); cursor: pointer; user-select: none; }
.rx-toggle input { width: 16px; height: 16px; accent-color: var(--brand-600); }

/* ===== Dori kartalari ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; padding-bottom: 60px; }
.med-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; cursor: pointer; transition: transform .12s, box-shadow .15s, border-color .15s;
  display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.med-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(var(--brand-400), var(--brand-600)); opacity: 0;
  transition: opacity .15s;
}
.med-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand-200, #bfe9df); }
.med-card:hover::before { opacity: 1; }

.med-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.med-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: var(--brand-50); color: var(--brand-700);
  display: grid; place-items: center; font-size: 22px;
}
.med-name { font-size: 17px; font-weight: 700; color: var(--ink-900); line-height: 1.25; }
.med-brand { font-size: 12px; color: var(--muted); margin-top: 2px; }

.med-ingredient { font-size: 13px; color: var(--brand-700); font-weight: 600; margin-bottom: 8px; }
.med-use { font-size: 13.5px; color: var(--ink-600); flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.med-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.tag { font-size: 11px; padding: 4px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }

.med-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.med-price { font-size: 18px; font-weight: 800; color: var(--brand-800); }
.med-price span { font-size: 12px; font-weight: 500; color: var(--muted); }
.badge-rx { font-size: 11px; font-weight: 700; color: var(--rx); background: var(--rx-bg); padding: 4px 10px; border-radius: 999px; }
.badge-otc { font-size: 11px; font-weight: 700; color: var(--ok); background: #e8f8ee; padding: 4px 10px; border-radius: 999px; }

/* ===== Bo'sh holat ===== */
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty .em-ico { font-size: 54px; opacity: .5; }
.empty h3 { color: var(--ink-700); margin: 14px 0 6px; font-size: 18px; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(6,33,29,.55); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal-overlay.open { display: flex; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--card); border-radius: 20px; max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: pop .2s ease;
}
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: .6 } to { transform: none; opacity: 1 } }
.modal-head {
  background: linear-gradient(150deg, var(--brand-600), var(--brand-800));
  color: #fff; padding: 24px; border-radius: 20px 20px 0 0; position: relative;
}
.modal-head .close {
  position: absolute; right: 16px; top: 16px; width: 34px; height: 34px;
  border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff;
  font-size: 20px; cursor: pointer; display: grid; place-items: center;
}
.modal-head .close:hover { background: rgba(255,255,255,.32); }
.modal-head h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; padding-right: 40px; }
.modal-head .m-brand { font-size: 13px; opacity: .9; }
.modal-head .m-ingredient { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,.18); padding: 6px 12px; border-radius: 999px; }

.modal-body { padding: 22px 24px 26px; }
.m-row { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.m-row:last-child { border-bottom: 0; }
.m-row .m-ico { font-size: 18px; width: 26px; flex-shrink: 0; }
.m-row .m-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.m-row .m-val { font-size: 14.5px; color: var(--ink-900); margin-top: 2px; }
.m-warn { background: var(--rx-bg); border-radius: 12px; padding: 14px; margin-top: 8px; }
.m-warn .m-val { color: #a54318; }

.m-symptoms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.m-symptoms .s { font-size: 12px; background: var(--brand-50); color: var(--brand-700); padding: 5px 11px; border-radius: 999px; border: 1px solid var(--brand-100); }

.modal-foot { display: flex; gap: 10px; padding: 0 24px 24px; }
.btn-primary, .btn-ghost { flex: 1; padding: 14px; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; border: 0; }
.btn-primary { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(16,153,129,.4); }
.btn-ghost { background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }

.m-price-big { font-size: 26px; font-weight: 800; color: var(--brand-800); }
.m-price-big span { font-size: 14px; color: var(--muted); font-weight: 500; }

/* ===== Footer ===== */
.site-footer { background: var(--brand-900); color: rgba(255,255,255,.75); padding: 34px 0; margin-top: 20px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-inner .f-brand { font-size: 18px; font-weight: 800; color: #fff; }
.footer-inner small { font-size: 12px; opacity: .7; display: block; margin-top: 4px; }
.disclaimer { font-size: 12px; max-width: 460px; line-height: 1.6; }

/* ===== Til almashtirgich ===== */
.lang-switch { display: inline-flex; background: var(--brand-50); border: 1px solid var(--brand-100);
  border-radius: 999px; padding: 3px; gap: 2px; }
.lang-btn { border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700;
  padding: 6px 11px; border-radius: 999px; cursor: pointer; transition: all .15s; }
.lang-btn:hover { color: var(--brand-700); }
.lang-btn.active { background: var(--brand-600); color: #fff; box-shadow: 0 2px 8px rgba(16,153,129,.3); }

/* ===== Biz haqimizda ===== */
.about { padding: 56px 0 40px; background: #fff; border-top: 1px solid var(--line); }
.about h2 { font-size: 28px; color: var(--brand-800); margin-bottom: 10px; }
.about-lead { font-size: 17px; color: var(--ink-700); max-width: 640px; margin-bottom: 26px; }
.about-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.stat { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 14px;
  padding: 18px; text-align: center; }
.stat b { display: block; font-size: 26px; color: var(--brand-700); font-weight: 800; }
.stat span { font-size: 13px; color: var(--muted); }
.about-p { font-size: 14.5px; color: var(--ink-600); max-width: 720px; margin-bottom: 14px; line-height: 1.7; }
.about-otbk { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, var(--brand-50), #fff);
  border: 1px solid var(--brand-100); border-radius: 16px; padding: 20px; margin: 24px 0; max-width: 640px; }
.otbk-logo { width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-800)); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 16px; letter-spacing: 1px; }
.otbk-name { font-size: 16px; font-weight: 700; color: var(--brand-800); text-decoration: none; }
.otbk-name:hover { text-decoration: underline; }
.otbk-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.about-disclaimer { font-size: 13px; color: var(--muted); background: var(--rx-bg); border-radius: 12px;
  padding: 14px 16px; max-width: 720px; line-height: 1.6; }

/* ===== Footer qo'shimcha ===== */
.footer-inner small a, .f-otbk { color: rgba(255,255,255,.85); }
.f-otbk { text-decoration: none; font-size: 14px; font-weight: 600; }
.f-otbk:hover { color: #fff; text-decoration: underline; }

/* ===== Xarita modal ===== */
.map-modal { max-width: 620px; }
.map-body { padding: 20px 24px 24px; }
.map-status { font-size: 13px; color: var(--muted); margin-bottom: 10px; min-height: 18px; }
.map-frame { width: 100%; height: 320px; border: 1px solid var(--line); border-radius: 14px;
  margin-bottom: 14px; background: var(--bg); overflow: hidden; position: relative; z-index: 0; }
.map-locate { width: 100%; margin-bottom: 20px; }

/* Xarita nishonlari */
.pin-user { width: 18px; height: 18px; border-radius: 50%; background: var(--accent);
  border: 3px solid #fff; box-shadow: 0 0 0 3px rgba(47,111,237,.35), 0 2px 6px rgba(0,0,0,.3); }
.pin-pharm { width: 26px; height: 26px; display: grid; place-items: center; font-size: 15px; font-weight: 900;
  line-height: 1; color: #fff; background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  border: 2px solid #fff; border-radius: 50%; box-shadow: 0 3px 8px rgba(6,65,58,.45); }

/* Yaqin aptekalar ro'yxati */
.map-chains-label { font-size: 14px; color: var(--ink-700); margin-bottom: 12px; font-weight: 700; }
.nearby-list { display: flex; flex-direction: column; gap: 8px; }
.nearby-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  cursor: pointer; transition: all .12s; font-size: 14px; }
.nearby-item:hover { border-color: var(--brand-400); background: var(--brand-50); transform: translateX(2px); }
.ni-pin { width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center; font-size: 14px;
  font-weight: 900; color: #fff; background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); border-radius: 9px; }
.ni-name { flex: 1; font-weight: 600; color: var(--ink-900); }
.ni-dist { font-size: 13px; font-weight: 700; color: var(--brand-700); background: var(--brand-50);
  border: 1px solid var(--brand-100); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.nearby-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 20px; }

/* ===== SEO matn (yashirin) ===== */
.seo-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .hero h1 { font-size: 24px; }
  .search-box { flex-wrap: wrap; }
  .search-btn { width: 100%; }
  .header-link { display: none; }
  .grid { grid-template-columns: 1fr; }
  .modal-foot { flex-direction: column; }
  .about-stats { grid-template-columns: repeat(2, 1fr); }
  .map-actions { flex-direction: column; }
  .header-badge { display: none; }
  .lang-switch { padding: 2px; }
  .lang-btn { padding: 5px 8px; }
}
