/* ==========================================================================
   MojLek - Glavni Stilski Fajl (Design System: Predlog 2 - Clinical Blue & Mint)
   Pravila: Bez emodžija, Lucide ikone, kompaktan i maksimalno funkcionalan UI
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Fontovi */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Svetla tema (Default) - 100% WCAG AA & AAA */
  --bg-app: #f4f7fb;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #edf2f9;
  --border: #dbe4f0;
  --border-subtle: #e8eef6;
  --border-focus: #1d4ed8;

  --text-main: #0f172a;       /* 17.85:1 AAA */
  --text-muted: #475569;      /* 7.58:1 AAA */
  --text-subtle: #64748b;     /* 4.76:1 AA */
  --text-inverse: #ffffff;

  /* Brend & Akcenti (Predlog 2) */
  --primary: #2563eb;         /* 5.17:1 AA */
  --primary-hover: #1d4ed8;   /* 6.70:1 AA */
  --primary-subtle: #dbeafe;
  --primary-text: #1e40af;    /* 7.15:1 AAA */

  --accent-mint: #047857;     /* 5.48:1 AA */
  --accent-mint-hover: #065f46;
  --accent-mint-subtle: #d1fae5;
  --accent-mint-text: #064e3b;/* 7.21:1 AAA */

  /* Statusi Lista */
  --badge-a-bg: #e0f2fe;
  --badge-a-text: #0369a1;    /* 5.17:1 AA */
  --badge-a-border: #bae6fd;

  --badge-a1-bg: #fef3c7;
  --badge-a1-text: #92400e;   /* 6.37:1 AA */
  --badge-a1-border: #fde68a;

  --badge-b-bg: #f3e8ff;
  --badge-b-text: #6b21a8;    /* 7.39:1 AAA */
  --badge-b-border: #e9d5ff;

  --savings-bg: #ecfdf5;
  --savings-text: #047857;    /* 5.21:1 AA */
  --savings-border: #a7f3d0;

  /* Senke i Zaobljenja */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08);

  --transition: all 0.18s ease-in-out;
}

[data-theme="dark"] {
  --bg-app: #0a101d;
  --bg-surface: #111b2e;
  --bg-surface-subtle: #18263f;
  --border: #223554;
  --border-subtle: #1a2a44;
  --border-focus: #3b82f6;

  --text-main: #f1f5f9;       /* 15.71:1 AAA */
  --text-muted: #94a3b8;      /* 6.71:1 AA */
  --text-subtle: #64748b;
  --text-inverse: #0f172a;

  --primary: #2563eb;         /* 5.17:1 AA sa belim tekstom */
  --primary-hover: #3b82f6;
  --primary-subtle: #1e3a8a;
  --primary-text: #93c5fd;    /* 5.74:1 AA */

  --accent-mint: #10b981;
  --accent-mint-hover: #34d399;
  --accent-mint-subtle: rgba(16, 185, 129, 0.15);
  --accent-mint-text: #6ee7b7;

  --badge-a-bg: rgba(14, 165, 233, 0.15);
  --badge-a-text: #7dd3fc;
  --badge-a-border: rgba(56, 189, 248, 0.35);

  --badge-a1-bg: rgba(245, 158, 11, 0.15);
  --badge-a1-text: #fbbf24;
  --badge-a1-border: rgba(245, 158, 11, 0.35);

  --badge-b-bg: rgba(168, 85, 247, 0.15);
  --badge-b-text: #d8b4fe;
  --badge-b-border: rgba(192, 132, 252, 0.35);

  --savings-bg: rgba(16, 185, 129, 0.15);
  --savings-text: #6ee7b7;
  --savings-border: rgba(52, 211, 153, 0.35);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.6);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  max-width: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  max-width: 100%;
}

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

button, input, select {
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

/* ==========================================================================
   NAVBAR & HEADER
   ========================================================================== */
.site-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  height: 64px;
  box-sizing: border-box;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 16px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}

.brand-logo-img {
  height: 22px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

.brand-logo-img.logo-dark {
  display: none;
}

[data-theme="dark"] .brand-logo-img.logo-light {
  display: none;
}

[data-theme="dark"] .brand-logo-img.logo-dark {
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary);
  background-color: var(--bg-surface-subtle);
}

.nav-link.active {
  color: var(--primary-text);
  background-color: var(--primary-subtle);
  font-weight: 700;
}

[data-theme="dark"] .nav-link {
  color: #94a3b8;
}

[data-theme="dark"] .nav-link:hover {
  color: #f1f5f9;
  background-color: var(--bg-surface-subtle);
}

[data-theme="dark"] .nav-link.active {
  color: #ffffff;
  background-color: #2563eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  color: var(--text-main);
  border-color: var(--primary);
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-mint {
  background-color: var(--accent-mint);
  color: #ffffff;
}

.btn-mint:hover {
  background-color: var(--accent-mint-hover);
}

[data-theme="dark"] .btn-mint {
  background-color: #059669;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .btn-mint:hover {
  background-color: #10b981;
}

.btn-outline {
  background-color: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
  word-break: break-word;
}

.badge i,
.badge svg {
  flex-shrink: 0;
}

.badge-lista-a {
  background-color: var(--badge-a-bg);
  color: var(--badge-a-text);
  border-color: var(--badge-a-border);
}

.badge-lista-a1 {
  background-color: var(--badge-a1-bg);
  color: var(--badge-a1-text);
  border-color: var(--badge-a1-border);
}

.badge-lista-b {
  background-color: var(--badge-b-bg);
  color: var(--badge-b-text);
  border-color: var(--badge-b-border);
}

.badge-lista-c {
  background-color: rgba(234, 88, 12, 0.1);
  color: #ea580c;
  border-color: rgba(234, 88, 12, 0.3);
}

.badge-mint {
  background-color: var(--accent-mint-subtle);
  color: var(--accent-mint-text);
  border-color: var(--accent-mint);
}

/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */
.breadcrumb-nav {
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-subtle);
  overflow-x: auto;
  white-space: nowrap;
}

.breadcrumb-nav a {
  color: var(--text-muted);
  transition: var(--transition);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}

.breadcrumb-nav a:hover {
  color: var(--primary);
}

.breadcrumb-separator {
  color: var(--text-subtle);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.breadcrumb-current {
  color: var(--text-main);
  font-weight: 600;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}

@media (max-width: 768px) {
  .breadcrumb-nav {
    display: none;
  }
}

/* ==========================================================================
   SEARCH BAR COMPONENT
   ========================================================================== */
.search-bar-wrap {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 8px 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.search-bar-wrap:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

.search-bar-input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  min-width: 0;
  width: 100%;
  font-size: 0.95rem;
  color: var(--text-main);
}

.search-bar-input::placeholder {
  color: var(--text-subtle);
}

.btn-scan-camera {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--primary-subtle);
  color: var(--primary-text);
  border: 1px solid transparent;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition);
}

.btn-scan-camera:hover {
  background-color: var(--primary);
  color: #ffffff;
}

/* ==========================================================================
   SEARCH GRID LAYOUT & SIDEBAR
   ========================================================================== */
.search-grid-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

.search-grid-layout > * {
  min-width: 0;
}

.search-sidebar-filter {
  min-width: 0;
  width: 100%;
}

/* ==========================================================================
   MEDICINE DETAIL GRID LAYOUT & FIXED SIDEBAR
   ========================================================================== */
.medicine-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  margin-top: 12px;
}

.medicine-detail-layout > * {
  min-width: 0;
}

.medicine-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  width: 100%;
}

@media (max-width: 960px) {
  .medicine-detail-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ==========================================================================
   AUTOCOMPLETE DROPDOWN & LIVE SEARCH
   ========================================================================== */
.autocomplete-container {
  position: relative;
  width: 100%;
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  text-align: left;
}

.autocomplete-dropdown.active {
  display: block;
}

.autocomplete-item {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover, .autocomplete-item.selected {
  background-color: var(--bg-surface-subtle);
}

.autocomplete-item-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 2px;
}

.autocomplete-item-sub {
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* ==========================================================================
   QUICK STATS BAR & PILLS
   ========================================================================== */
.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 36px;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background-color: var(--primary-subtle);
  color: var(--primary-text);
  transition: var(--transition);
}

.stat-card:hover .stat-icon-wrap {
  background-color: var(--primary);
  color: #ffffff;
}

.stat-num {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}

.stat-label {
  font-size: 0.775rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   CATEGORY FILTER CHIPS & AZ BAR
   ========================================================================== */
.category-chips-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0 28px 0;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.category-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-subtle);
  transform: translateY(-1px);
}

.az-letter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 32px;
}

.az-pill {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.az-pill:hover {
  background-color: var(--primary);
  color: #ffffff;
}

/* ==========================================================================
   CARDS & SURFACES
   ========================================================================== */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  max-width: 100%;
  box-sizing: border-box;
}

.card:hover {
  border-color: var(--border-focus);
}

.card-header-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* Meta Grid */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  background-color: var(--bg-surface-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.meta-field {
  display: flex;
  flex-direction: column;
}

.meta-field-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
}

.meta-field-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  font-family: var(--font-mono);
  margin-top: 1px;
}

/* Pricing & Copay Row */
.pricing-flex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 12px;
}

.copay-title {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.copay-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.copay-val span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Savings Box Component */
.savings-banner {
  background-color: var(--savings-bg);
  border: 1px solid var(--savings-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.savings-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--savings-text);
}

.savings-desc-txt {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   FAQ ACCORDION
   ========================================================================== */
.faq-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
  transition: var(--transition);
}

.faq-question {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  user-select: none;
}

.faq-question:hover {
  background-color: var(--bg-surface-subtle);
}

.faq-answer {
  display: none;
  padding: 10px 16px 16px 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  border-top: 1px solid var(--border-subtle);
}

.faq-item.active {
  border-color: var(--primary);
  background-color: var(--bg-surface);
}

.faq-item.active .faq-answer {
  display: block;
}

.faq-question i, .faq-question svg {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq-item.active .faq-question i, .faq-item.active .faq-question svg {
  transform: rotate(180deg);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border);
  margin-top: auto;
  padding: 40px 0 24px 0;
  font-size: 0.85rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-heading {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 12px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: var(--text-muted);
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-subtle);
  font-size: 0.775rem;
}

/* ==========================================================================
   MODAL (Scanner)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-body {
  padding: 20px;
  text-align: center;
}

.scanner-viewfinder {
  width: 100%;
  height: 220px;
  background-color: #0f172a;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.scan-laser-line {
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 2px;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: laserScan 2s infinite ease-in-out;
}

@keyframes laserScan {
  0%, 100% { top: 25%; }
  50% { top: 75%; }
}

/* Tooltip helper za participaciju i oslobođene kategorije */
.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
  color: var(--text-muted);
  vertical-align: middle;
}
.info-tooltip:hover {
  color: var(--primary);
}
.info-tooltip .tooltip-text {
  visibility: hidden;
  opacity: 0;
  width: 250px;
  background-color: var(--bg-surface);
  color: var(--text-main);
  text-align: left;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  position: absolute;
  z-index: 100;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}
.info-tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding-bottom: 64px;
  }

  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58px;
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border);
    z-index: 999;
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.08);
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
  }

  [data-theme="dark"] .mobile-bottom-nav {
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.4);
    background-color: var(--bg-surface);
    border-top-color: var(--border);
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 0.725rem;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 0;
    border-radius: var(--radius-sm);
    transition: var(--transition);
  }

  .mobile-nav-item i, .mobile-nav-item svg {
    width: 20px;
    height: 20px;
    transition: transform 0.15s ease;
  }

  .mobile-nav-item:hover {
    color: var(--primary);
  }

  .mobile-nav-item.active {
    color: var(--primary);
    font-weight: 700;
  }

  .mobile-nav-item.active i, .mobile-nav-item.active svg {
    stroke-width: 2.4px;
    transform: scale(1.08);
  }
}

/* ==========================================================================
   RESPONSIVE COMPONENT RULES
   ========================================================================== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .search-grid-layout {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .search-sidebar-filter {
    display: none;
  }
  .search-sidebar-filter.is-open {
    display: block;
    margin-bottom: 16px;
    animation: filterSlideDown 0.2s ease-out;
  }
  @keyframes filterSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .mobile-filter-trigger-row {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
  }
  .dual-pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .dual-pricing-grid > div {
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
    padding-right: 0 !important;
    padding-bottom: 10px !important;
  }
  .dual-pricing-grid > div:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
  }
}

.mobile-filter-trigger-row {
  display: none;
}

@media (max-width: 640px) {
  .search-bar-wrap {
    padding: 6px 8px 6px 10px;
    gap: 6px;
  }
  .btn-scan-camera .btn-text {
    display: none;
  }
  .btn-scan-camera {
    padding: 7px 10px;
  }
  .quick-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-bottom: 24px !important;
  }
  .stat-card {
    padding: 10px 12px !important;
    gap: 8px !important;
  }
  .stat-icon-wrap {
    width: 32px !important;
    height: 32px !important;
  }
  .stat-num {
    font-size: 1.05rem !important;
  }
  .stat-label {
    font-size: 0.7rem !important;
  }
  .az-letter-bar {
    gap: 4px !important;
    padding: 8px !important;
  }
  .az-pill {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.85rem !important;
  }
  .savings-comparison-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .savings-comparison-grid > div:last-child {
    border-left: none !important;
    border-top: 2px solid var(--accent-mint) !important;
    padding-left: 0 !important;
    padding-top: 12px !important;
  }
  .therapy-box-btn {
    min-height: 42px !important;
    font-size: 0.85rem !important;
  }
  .pagination-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px !important;
  }
  .pagination-numbers {
    display: none !important;
  }
  .pagination-mobile-info {
    display: block !important;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
  }
  .pagination-controls {
    width: 100%;
    justify-content: space-between;
  }
  .az-item-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .az-item-actions {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-top: 8px !important;
    border-top: 1px solid var(--border-subtle) !important;
  }
}

.pagination-mobile-info {
  display: none;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 600px) {
  .pharmacy-actions-cell {
    display: flex !important;
    gap: 8px !important;
    padding-top: 8px !important;
  }
  .pharmacy-actions-cell .btn {
    flex: 1 !important;
    justify-content: center !important;
    padding: 10px 14px !important;
    font-size: 0.85rem !important;
  }
}

/* ==========================================================================
   FOOTER STYLES
   ========================================================================== */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 28px 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr 1.2fr;
  gap: 36px;
  margin-bottom: 36px;
}

.footer-title {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 14px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
  padding-left: 2px;
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .card-header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .pricing-flex-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .pricing-flex-row .btn {
    width: 100%;
  }
}

/* ==========================================================================
   FAQ ACCORDION COMPONENT
   ========================================================================== */
.faq-container {
  margin: 48px auto;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}

.faq-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
  transform: translateY(-1px);
}

.faq-item.active {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.12);
  transform: none;
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease;
  user-select: none;
}

.faq-item.active .faq-question {
  color: var(--primary);
}

.faq-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--bg-surface-subtle);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.25s ease, background-color 0.2s ease, color 0.2s ease;
}

.faq-item:hover .faq-icon-wrap {
  color: var(--primary);
}

.faq-item.active .faq-icon-wrap {
  transform: rotate(180deg);
  background-color: var(--primary-subtle);
  color: var(--primary-text);
}

.faq-answer {
  display: none;
  padding: 0 20px 18px 20px;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

.faq-item.active .faq-answer {
  display: block;
  animation: faqFadeIn 0.2s ease-out;
}

@keyframes faqFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   LIST HERO CARD & COMPACT ACCORDION
   ========================================================================== */
.list-hero-card {
  transition: var(--transition);
}

.list-hero-accordion summary {
  list-style: none;
  outline: none;
  cursor: pointer;
  user-select: none;
}

.list-hero-accordion summary::-webkit-details-marker {
  display: none;
}

.list-hero-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.list-hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.list-hero-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin: 0;
  line-height: 1.2;
}

.list-hero-badges {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.list-hero-count-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  background-color: var(--bg-surface-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.list-hero-toggle-btn {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  margin-left: auto;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.list-hero-toggle-btn:hover {
  color: var(--primary-hover);
}

.list-hero-accordion[open] .list-hero-chevron,
.list-hero-accordion[open] summary i,
.list-hero-accordion[open] summary svg {
  transform: rotate(180deg);
}

.list-hero-accordion-content {
  animation: faqFadeIn 0.2s ease-out;
}

@media (max-width: 768px) {
  .list-hero-summary-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .list-hero-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
  }

  .list-hero-title {
    font-size: 1.15rem;
  }

  .list-hero-toggle-btn {
    margin-left: 0;
    margin-top: 2px;
  }
}

/* ==========================================================================
   SEARCH RESULTS TOOLBAR & CONTROLS
   ========================================================================== */
.search-results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-only-filter-btn {
  display: none;
}

.desktop-only-count {
  display: block;
}

.desktop-only-sort-label {
  display: inline;
}

.sort-select-input {
  height: 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

@media (max-width: 768px) {
  .search-grid-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .search-sidebar-filter {
    display: none;
  }

  .search-sidebar-filter.is-open {
    display: block;
    margin-bottom: 12px;
    animation: faqFadeIn 0.2s ease-out;
  }

  .mobile-only-filter-btn {
    display: inline-flex;
    height: 36px;
    align-items: center;
  }
  
  .desktop-only-count {
    display: none;
  }
  
  .desktop-only-sort-label {
    display: none;
  }
  
  .search-results-toolbar {
    margin-bottom: 8px;
    padding-bottom: 8px;
  }
}

/* ==========================================================================
   STICKY MEDICINE BAR (Theme Surface Color, Light & Dark Adaptable)
   ========================================================================== */
.sticky-medicine-bar {
  display: block;
  position: fixed;
  top: 63px;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  z-index: 99;
  background-color: var(--bg-surface);
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  padding: 8px 0;
  user-select: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  overflow: hidden;
}

[data-theme="dark"] .sticky-medicine-bar {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.sticky-medicine-bar.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.sticky-medicine-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.sticky-medicine-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.sticky-medicine-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--primary-subtle);
  color: var(--primary);
  flex-shrink: 0;
}

.sticky-medicine-text-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  gap: 1px;
}

.sticky-medicine-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.sticky-medicine-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.sticky-list-badge-a { color: var(--accent-mint); }
.sticky-list-badge-a1 { color: var(--badge-a1-text); }
.sticky-list-badge-b { color: var(--badge-b-text); }
.sticky-list-badge-c { color: var(--text-main); }

.sticky-medicine-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.sticky-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.18s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.sticky-action-btn:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ==========================================================================
   SUBSTITUTES HIGHLIGHT CARD
   ========================================================================== */
.substitutes-highlight-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.substitutes-highlight-content {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.substitutes-highlight-action {
  flex-shrink: 0;
}

.meta-spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .site-header {
    position: static;
  }
  .sticky-medicine-bar {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    z-index: 1000;
    background: #1e40af !important;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 16px rgba(29, 78, 216, 0.35) !important;
    color: #ffffff !important;
    border-radius: 0 !important;
  }
  .sticky-medicine-bar .sticky-medicine-title {
    color: #ffffff !important;
  }
  .sticky-medicine-bar .sticky-medicine-subtitle {
    color: rgba(255, 255, 255, 0.9) !important;
  }
  .sticky-medicine-bar .sticky-medicine-icon-wrap {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
  }
  .sticky-medicine-bar .sticky-list-badge-a {
    color: #6ee7b7 !important;
  }
  .sticky-medicine-bar .sticky-list-badge-a1 {
    color: #fde68a !important;
  }
  .sticky-medicine-bar .sticky-list-badge-b {
    color: #e9d5ff !important;
  }
  .sticky-medicine-bar .sticky-list-badge-c {
    color: #ffffff !important;
  }
  .sticky-medicine-inner {
    display: flex !important;
    align-items: center;
    width: 100% !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
  }
  .sticky-medicine-right {
    display: none !important;
  }
  .sticky-medicine-left {
    width: 100% !important;
    min-width: 0 !important;
  }
  .card-header-flex {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .meta-spec-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .substitutes-highlight-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .substitutes-highlight-content {
    width: 100%;
    align-items: flex-start;
  }
  .substitutes-highlight-action {
    width: 100%;
  }
  .substitutes-highlight-action .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .sticky-medicine-title {
    font-size: 0.825rem;
  }
  .sticky-medicine-subtitle {
    font-size: 0.7rem;
  }
  .meta-spec-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}




