/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-dark:  #065f46;
  --green-mid:   #059669;
  --green-light: #d1fae5;
  --green-xlight:#ecfdf5;
  --white:       #ffffff;
  --gray-50:     #f9fafb;
  --gray-100:    #f3f4f6;
  --gray-200:    #e5e7eb;
  --gray-500:    #6b7280;
  --gray-700:    #374151;
  --gray-900:    #111827;
  --amber:       #f59e0b;
  --radius:      12px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.14);
}

body {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gray-900);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 70px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  background-image: url('/header-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--green-dark);
  font-weight: 700;
  font-size: 1.2rem;
}

.nav-logo img {
  height: 40px;
  width: auto;
}

.nav-cta {
  background: var(--green-mid);
  color: var(--white);
  text-decoration: none;
  padding: .5rem 1.1rem;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  transition: background .2s;
}

.nav-cta:hover { background: var(--green-dark); }

/* ===== HERO ===== */
.hero {
  min-height: calc(100vh - 64px);
  background: linear-gradient(135deg, var(--green-dark) 0%, #047857 50%, #065f46 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1.5rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 30%, rgba(16,185,129,.25) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  width: 100%;
}

.badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  color: var(--white);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  padding: .35rem 1rem;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  letter-spacing: .02em;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.highlight {
  color: #6ee7b7;
}

.hero-sub {
  color: rgba(255,255,255,.8);
  font-size: 1.1rem;
  max-width: 520px;
  margin: 0 auto 2.5rem;
}

/* ===== SEARCH BOX ===== */
.search-box {
  display: flex;
  gap: .5rem;
  max-width: 640px;
  margin: 0 auto 1.5rem;
}

.search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  width: 20px;
  height: 20px;
  color: var(--gray-500);
  pointer-events: none;
}

#searchInput {
  width: 100%;
  padding: .875rem 3rem .875rem 2.8rem;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--white);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  color: var(--gray-900);
}

#searchInput:focus {
  border-color: #6ee7b7;
  box-shadow: 0 0 0 4px rgba(110,231,183,.25);
}

.clear-btn {
  position: absolute;
  right: .75rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  font-size: .9rem;
  display: none;
  padding: .2rem .4rem;
  border-radius: 4px;
  transition: color .15s;
}

.clear-btn:hover { color: var(--gray-900); }
.clear-btn.visible { display: block; }

.search-submit {
  padding: .875rem 1.6rem;
  background: var(--amber);
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, transform .15s;
}

.search-submit:hover {
  background: #d97706;
  transform: translateY(-1px);
}

/* ===== POPULAR TAGS ===== */
.popular-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem;
  color: rgba(255,255,255,.7);
  font-size: .875rem;
}

.popular-tags button {
  background: rgba(255,255,255,.15);
  color: var(--white);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  padding: .3rem .9rem;
  font-size: .85rem;
  cursor: pointer;
  transition: background .2s;
  font-family: inherit;
}

.popular-tags button:hover {
  background: rgba(255,255,255,.28);
}

/* ===== HERO STATS ===== */
.hero-stats {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 4rem;
  position: relative;
  z-index: 1;
}

.stat-card {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
  padding: 1.2rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  backdrop-filter: blur(8px);
}

.stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
}

.stat-label {
  font-size: .8rem;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ===== RESULTS SECTION ===== */
.results-section {
  background: var(--gray-50);
  padding: 3rem 2rem;
}

.results-header {
  max-width: 1100px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.results-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}

.results-count {
  font-size: .9rem;
  color: var(--gray-500);
}

.results-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* ===== DRUG CARD ===== */
.drug-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  animation: fadeUp .3s ease both;
}

.drug-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.drug-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: .75rem;
}

.drug-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--green-mid);
  margin-bottom: .75rem;
}

.drug-meta {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.drug-meta span {
  font-size: .85rem;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.pill {
  display: inline-block;
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: 999px;
  padding: .15rem .65rem;
  font-size: .78rem;
  font-weight: 600;
}

.no-results {
  text-align: center;
  padding: 3rem;
  color: var(--gray-500);
  font-size: 1rem;
  grid-column: 1/-1;
}

/* ===== HOW IT WORKS ===== */
.how-it-works {
  padding: 5rem 2rem;
  text-align: center;
  background: var(--white);
}

.how-it-works h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 3rem;
}

.steps {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
}

.step {
  flex: 1;
  min-width: 200px;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.step-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.step h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--gray-900);
}

.step p {
  color: var(--gray-500);
  font-size: .95rem;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--gray-900);
  color: var(--gray-200);
  padding: 3rem 2rem 1.5rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #374151;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: .7;
}

.footer-brand span {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
}

.footer-brand p {
  font-size: .85rem;
  color: var(--gray-500);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.footer-links a {
  color: var(--gray-200);
  text-decoration: none;
  font-size: .9rem;
  transition: color .15s;
}

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

.footer-copy {
  max-width: 1100px;
  margin: 1.5rem auto 0;
  font-size: .8rem;
  color: var(--gray-500);
  text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .search-box { flex-direction: column; }
  .search-submit { width: 100%; }
  .hero h1 { font-size: 2rem; }
  .hero-stats { gap: 1rem; }
  .stat-card { padding: 1rem 1.5rem; }
  .navbar { padding: 0 1rem; }
  .footer-inner { flex-direction: column; }
}
