/* ============================================================
   ABU SHUJAA PHARMACY — DESIGN TOKENS
   Palette drawn from the logo: leaf green + pill blue, on a
   soft mint paper background. Sora for display type, Inter
   for body/UI text.
   ============================================================ */

:root {
  --ink: #12261F;
  --ink-soft: #40554C;
  --paper: #F5FAF7;
  --white: #FFFFFF;

  --blue-700: #114C86;
  --blue-500: #2C7FC4;
  --blue-100: #E4F0FB;

  --green-700: #146A3B;
  --green-500: #1F9A52;
  --green-100: #E4F6EA;

  --amber-500: #DB8E2E;
  --amber-100: #FBEBD3;

  --line: #DCE8E1;

  --font-display: "Sora", sans-serif;
  --font-body: "Inter", sans-serif;

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 26px;

  --shadow-soft: 0 18px 40px -22px rgba(18, 38, 31, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0;
  line-height: 1.15;
  color: var(--ink);
}

p { margin: 0; }

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--blue-500);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245, 250, 247, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.brand-text span {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.main-nav {
  display: flex;
  gap: 28px;
  font-size: 0.95rem;
}

.main-nav a {
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  padding-bottom: 4px;
}

.main-nav a:hover { color: var(--ink); border-color: var(--green-500); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--green-500);
  color: var(--white);
}
.btn-primary:hover { background: var(--green-700); }

.btn-secondary {
  background: var(--white);
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { border-color: var(--ink-soft); }

.btn-small { padding: 9px 16px; font-size: 0.85rem; }

.header-cta { display: flex; }

.nav-toggle { display: none; }

/* ============================================================
   HERO
   ============================================================ */

.hero {
  padding: 72px 0 56px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.1rem, 3.6vw, 3rem);
  max-width: 15ch;
}

.hero-sub {
  margin-top: 20px;
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 46ch;
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.trust-list {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trust-list li {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.trust-list li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-500);
  flex-shrink: 0;
}

.hero-art {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-art .blob {
  position: absolute;
  inset: -10% -10% -10% -10%;
  background: radial-gradient(circle at 32% 28%, var(--blue-100), transparent 55%),
              radial-gradient(circle at 68% 72%, var(--green-100), transparent 55%);
  border-radius: 50%;
  z-index: 0;
}

.hero-art .logo-card {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: var(--radius-l);
  padding: 34px;
  box-shadow: var(--shadow-soft);
  width: min(320px, 80%);
}

/* ============================================================
   SERVICES
   ============================================================ */

.services {
  padding: 40px 0 72px;
  border-top: 1px solid var(--line);
}

.services-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.service-item {
  padding: 28px 26px;
  border-left: 1px solid var(--line);
}

.service-item:first-child { border-left: none; padding-left: 0; }

.service-item .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--green-100);
  color: var(--green-700);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.service-item h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.service-item p {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ============================================================
   CATALOG
   ============================================================ */

.catalog {
  padding: 12px 0 80px;
}

.catalog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.catalog-head h2 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); }

.catalog-head p {
  margin-top: 10px;
  color: var(--ink-soft);
  max-width: 56ch;
}

.catalog-controls {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-row {
  display: flex;
  gap: 12px;
}

.search-row input {
  flex: 1;
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink);
}

.filter-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.filter-pill.active {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.product-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-media {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--green-100);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-media.media-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-media.media-fallback::before {
  content: "";
  width: 34px;
  height: 34px;
  background: var(--green-500);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.5 20H4a2 2 0 0 1-2-2V9.5A2.5 2.5 0 0 1 4.5 7h3"/><path d="M14 3.5V7h3.5"/><path d="M9 13h5"/><path d="M9 17h2"/><path d="M14 3H8a2 2 0 0 0-2 2v.5"/><path d="M20 15v6"/><path d="M17 18h6"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.5 20H4a2 2 0 0 1-2-2V9.5A2.5 2.5 0 0 1 4.5 7h3"/><path d="M14 3.5V7h3.5"/><path d="M9 13h5"/><path d="M9 17h2"/><path d="M14 3H8a2 2 0 0 0-2 2v.5"/><path d="M20 15v6"/><path d="M17 18h6"/></svg>') center / contain no-repeat;
}

.product-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.product-category {
  font-size: 0.72rem;
  color: var(--blue-700);
  background: var(--blue-100);
  padding: 4px 10px;
  border-radius: 999px;
}

.rx-badge {
  font-size: 0.72rem;
  color: var(--amber-500);
  background: var(--amber-100);
  padding: 4px 10px;
  border-radius: 999px;
}

.product-card h3 {
  font-size: 1.02rem;
}

.product-card .info {
  font-size: 0.88rem;
  color: var(--ink-soft);
  flex: 1;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 4px;
}

.price-now {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--green-700);
}

.price-was {
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-decoration: line-through;
}

.discount-tag {
  font-size: 0.75rem;
  color: var(--white);
  background: var(--amber-500);
  padding: 3px 9px;
  border-radius: 6px;
}

.product-card .btn {
  margin-top: 6px;
  width: 100%;
  justify-content: center;
}

.empty-state {
  margin-top: 40px;
  text-align: center;
  color: var(--ink-soft);
  padding: 40px 0;
}

.load-more-wrap {
  margin-top: 36px;
  text-align: center;
}

.load-more-wrap .btn { padding: 12px 28px; }

.results-count {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ============================================================
   CONTACT / FOOTER
   ============================================================ */

.contact {
  background: var(--ink);
  color: var(--paper);
  padding: 64px 0 32px;
}

.contact .wrap {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
}

.contact h2 { color: var(--white); font-size: clamp(1.5rem, 2.2vw, 2rem); }

.contact p { color: #B9C9C1; margin-top: 14px; max-width: 46ch; }

.contact-details {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-details div {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.95rem;
}

.contact-details strong { display: block; color: var(--white); font-size: 0.85rem; }
.contact-details span { color: #B9C9C1; }

.contact-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-m);
  padding: 30px;
  align-self: start;
}

.contact-card h3 { color: var(--white); font-size: 1.1rem; margin-bottom: 10px; }
.contact-card p { color: #B9C9C1; font-size: 0.92rem; margin-bottom: 20px; }

.footer-bottom {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: #8FA39A;
}

/* ============================================================
   CART
   ============================================================ */

.header-cta { align-items: center; gap: 14px; }

.cart-toggle {
  position: relative;
  background: none;
  border: none;
  color: var(--ink);
  padding: 6px;
  display: flex;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--amber-500);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  display: none;
}

.cart-badge.pulse { animation: cart-pulse 0.35s ease; }

@keyframes cart-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 38, 31, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 60;
}

.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100%);
  background: var(--white);
  z-index: 70;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -20px 0 40px -20px rgba(18, 38, 31, 0.4);
}

.cart-drawer.open { transform: translateX(0); }

.cart-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.cart-drawer-head h3 { font-size: 1.1rem; }

.cart-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--ink-soft);
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cart-empty {
  color: var(--ink-soft);
  font-size: 0.92rem;
  padding: 30px 0;
  text-align: center;
}

.cart-row {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.92rem;
}

.cart-row-price { font-size: 0.82rem; color: var(--ink-soft); }

.cart-row-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
}

.qty-stepper button {
  background: none;
  border: none;
  width: 22px;
  height: 22px;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1;
}

.qty-stepper span { min-width: 14px; text-align: center; font-size: 0.9rem; }

.cart-row-total {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--green-700);
}

.cart-remove {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.cart-remove:hover { color: var(--amber-500); }

.cart-footer {
  padding: 20px 24px 24px;
  border-top: 1px solid var(--line);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  font-size: 1rem;
}

.cart-total-row strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--green-700);
}

.cart-note {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-align: center;
}

/* ============================================================
   HEALTH TIPS
   ============================================================ */

.health-tips {
  padding: 20px 0 80px;
  border-top: 1px solid var(--line);
}

.health-tips h2 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); margin-top: 32px; }

.health-sub {
  margin-top: 10px;
  color: var(--ink-soft);
  max-width: 60ch;
}

.article-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.article-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 24px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-card:hover { border-color: var(--green-500); }

.article-tag {
  align-self: flex-start;
  font-size: 0.72rem;
  color: var(--green-700);
  background: var(--green-100);
  padding: 4px 10px;
  border-radius: 999px;
}

.article-card h3 { font-size: 1.05rem; }

.article-card p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  flex: 1;
}

.article-read-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-700);
}

.article-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 38, 31, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 80;
}
.article-overlay.open { opacity: 1; pointer-events: auto; }

.article-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100%);
  background: var(--white);
  z-index: 90;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -20px 0 40px -20px rgba(18, 38, 31, 0.4);
}
.article-modal.open { transform: translateX(0); }

html[dir="rtl"] .article-modal {
  right: auto;
  left: 0;
  transform: translateX(-100%);
}
html[dir="rtl"] .article-modal.open { transform: translateX(0); }

.article-modal-head {
  display: flex;
  justify-content: flex-end;
  padding: 18px 20px 0;
}

.article-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 32px 40px;
}

.article-modal-body h2 {
  margin-top: 14px;
  font-size: 1.5rem;
}

.article-modal-body h3 {
  margin-top: 24px;
  font-size: 1.05rem;
  color: var(--green-700);
}

.article-modal-body p {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* ============================================================
   FLOATING WHATSAPP BUTTON
   ============================================================ */

.wa-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  background: var(--green-500);
  color: var(--white);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
}

.wa-float:hover { background: var(--green-700); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ============================================================
   LANGUAGE SWITCHER
   ============================================================ */

.lang-switch {
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
}

/* ============================================================
   RTL SUPPORT (Arabic, Urdu)
   ============================================================ */

html[dir="rtl"] body {
  font-family: "Noto Naskh Arabic", "Noto Nastaliq Urdu", var(--font-body);
}

html[lang="ur"] body { font-family: "Noto Nastaliq Urdu", var(--font-body); }
html[lang="ar"] body { font-family: "Noto Naskh Arabic", var(--font-body); }
html[lang="bn"] body { font-family: "Noto Sans Bengali", var(--font-body); }

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3 {
  font-family: inherit;
}

html[dir="rtl"] .trust-list li::before {
  margin-inline-end: 0;
}

html[dir="rtl"] .service-item {
  border-left: none;
  border-right: 1px solid var(--line);
}
html[dir="rtl"] .service-item:first-child { border-right: none; }

html[dir="rtl"] .cart-drawer {
  right: auto;
  left: 0;
  transform: translateX(-100%);
  box-shadow: 20px 0 40px -20px rgba(18, 38, 31, 0.4);
}
html[dir="rtl"] .cart-drawer.open { transform: translateX(0); }

html[dir="rtl"] .cart-badge {
  right: auto;
  left: -6px;
}

html[dir="rtl"] .wa-float {
  right: auto;
  left: 22px;
}

html[dir="rtl"] .discount-tag,
html[dir="rtl"] .price-was {
  direction: ltr;
  display: inline-block;
}

@media (max-width: 920px) {
  .main-nav { display: none; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .service-item { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 24px; }
  .service-item:first-child { border-top: none; padding-top: 0; }
  html[dir="rtl"] .service-item { border-right: none; padding-right: 0; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .contact .wrap { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .hero-art .logo-card { width: 200px; padding: 22px; margin: 0 auto; }
  .services-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .article-grid { grid-template-columns: 1fr; }
  .catalog-head { flex-direction: column; align-items: flex-start; }
  .search-row { flex-direction: column; }
}
