/* ============================================================
   IVY PHARMACEUTICALS — Heritage Ivy Design System
   Palette: Deep Ivy #1E4D3B · Leaf #2E7D5B · Ink #20362B
            Paper #FDFDFB · Mist #E4E8E1 · Sage #5C6E62
   Type:    Fraunces (display) · Source Sans 3 (body)
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Source Sans 3', sans-serif;
  background: #FDFDFB;
  color: #20362B;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- Navigation ---------- */
.nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px; border-bottom: 1px solid #E4E8E1;
  background: rgba(253,253,251,.94); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.brand {
  font-family: 'Fraunces', serif; font-size: 19px; font-weight: 600;
  color: #1E4D3B; text-decoration: none; display: flex; align-items: center; gap: 9px;
}
.brand svg { flex: 0 0 auto; }
.navlinks { display: flex; gap: 24px; align-items: center; }
.navlinks a {
  font-size: 14px; font-weight: 500; color: #5C6E62;
  text-decoration: none; transition: color .2s;
}
.navlinks a:hover, .navlinks a.current { color: #1E4D3B; }
.navlinks a.portal-link {
  color: #1E4D3B; border: 1.5px solid #BFCDBF; padding: 8px 18px;
  border-radius: 999px; font-weight: 600;
}
.navlinks a.portal-link:hover { background: #1E4D3B; color: #F4F7F2; border-color: #1E4D3B; }
.menu-btn {
  display: none; background: none; border: none; font-size: 24px;
  color: #1E4D3B; cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
  font-size: 14.5px; font-weight: 600; padding: 13px 26px; border-radius: 999px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  border: none; cursor: pointer; font-family: inherit; transition: all .2s;
}
.btn-primary { background: #1E4D3B; color: #F4F7F2; }
.btn-primary:hover { background: #2E7D5B; }
.btn-ghost { color: #1E4D3B; border: 1.5px solid #BFCDBF; background: transparent; }
.btn-ghost:hover { border-color: #1E4D3B; }

/* ---------- Hero ---------- */
.hero {
  position: relative; padding: 72px 24px 56px;
  max-width: 960px; margin: 0 auto; overflow: hidden;
}
.vine {
  position: absolute; right: -30px; top: -10px; width: 260px;
  opacity: .45; pointer-events: none;
}
.est {
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: #7A8B7C; margin-bottom: 20px;
}
h1 {
  font-family: 'Fraunces', serif; font-weight: 500;
  font-size: clamp(32px, 6.4vw, 56px); line-height: 1.14;
  margin-bottom: 18px; max-width: 660px;
}
h1 em { font-style: italic; color: #2E7D5B; }
.sub {
  font-size: 16.5px; line-height: 1.65; color: #54655A;
  max-width: 560px; margin-bottom: 32px;
}
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Sections ---------- */
.section { max-width: 960px; margin: 0 auto; padding: 48px 24px; }
.section-title {
  font-family: 'Fraunces', serif; font-size: clamp(24px, 4vw, 34px);
  font-weight: 500; margin-bottom: 8px;
}
.section-sub { color: #5C6E62; margin-bottom: 32px; max-width: 560px; }
.divider { border: none; border-top: 1px solid #E4E8E1; max-width: 960px; margin: 8px auto; }
.leaf-mark { color: #2E7D5B; font-size: 18px; margin-bottom: 10px; }

.pillars { display: flex; gap: 28px; flex-wrap: wrap; }
.pillar { flex: 1; min-width: 220px; }
.pillar h3 { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.pillar p { font-size: 14.5px; color: #5C6E62; }

/* ---------- Product grid ---------- */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.chip {
  font-size: 13px; font-weight: 600; color: #5C6E62;
  border: 1.5px solid #D8DFD6; background: #fff; padding: 7px 16px;
  border-radius: 999px; cursor: pointer; font-family: inherit; transition: all .2s;
}
.chip.active { background: #1E4D3B; color: #F4F7F2; border-color: #1E4D3B; }

.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.product-card {
  background: #fff; border: 1px solid #E4E8E1; border-radius: 14px;
  overflow: hidden; cursor: pointer; transition: box-shadow .2s, transform .2s;
  display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: 0 8px 24px rgba(30,77,59,.12); transform: translateY(-2px); }
.product-media {
  height: 170px; background: #EEF2EC; display: flex;
  align-items: center; justify-content: center; position: relative;
}
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-media .placeholder { font-size: 40px; opacity: .35; }
.video-badge {
  position: absolute; bottom: 8px; right: 8px; background: rgba(30,77,59,.85);
  color: #fff; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
.product-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.product-cat { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #7A8B7C; }
.product-name { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 600; }
.product-comp { font-size: 13px; color: #5C6E62; }
.product-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto; padding-top: 10px;
}
.product-pack { font-size: 12.5px; color: #7A8B7C; }
.product-mrp { font-size: 14px; font-weight: 700; color: #1E4D3B; }

.loading-state, .empty-state { text-align: center; color: #7A8B7C; padding: 60px 20px; font-size: 15px; }

/* ---------- Product modal ---------- */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(20,32,26,.55);
  z-index: 100; padding: 20px; overflow-y: auto;
}
.modal-overlay.open { display: flex; align-items: flex-start; justify-content: center; }
.modal {
  background: #FDFDFB; border-radius: 16px; max-width: 620px; width: 100%;
  margin: 30px 0; overflow: hidden; position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 12px; background: rgba(253,253,251,.9);
  border: 1px solid #E4E8E1; width: 36px; height: 36px; border-radius: 50%;
  font-size: 18px; cursor: pointer; color: #20362B; z-index: 2;
}
.modal-media img, .modal-media video { width: 100%; max-height: 340px; object-fit: cover; }
.modal-media video { background: #000; }
.modal-body { padding: 24px; }
.modal-body h2 { font-family: 'Fraunces', serif; font-size: 24px; margin-bottom: 4px; }
.modal-detail { display: flex; gap: 8px; font-size: 14px; margin-top: 10px; }
.modal-detail b { color: #1E4D3B; min-width: 110px; }
.modal-desc { margin-top: 16px; font-size: 14.5px; color: #54655A; white-space: pre-wrap; }

/* ---------- Contact ---------- */
.contact-grid { display: flex; gap: 24px; flex-wrap: wrap; }
.contact-card {
  flex: 1; min-width: 240px; background: #fff; border: 1px solid #E4E8E1;
  border-radius: 14px; padding: 24px;
}
.contact-card h3 { font-family: 'Fraunces', serif; font-size: 17px; margin-bottom: 8px; }
.contact-card a { color: #1E4D3B; font-weight: 600; text-decoration: none; }
.contact-card p { color: #5C6E62; font-size: 14.5px; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid #E4E8E1; margin-top: 40px;
  padding: 36px 24px; text-align: center; color: #7A8B7C; font-size: 13.5px;
}
.footer .brand { justify-content: center; margin-bottom: 10px; }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .navlinks {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #FDFDFB; border-bottom: 1px solid #E4E8E1;
    flex-direction: column; padding: 16px 24px; gap: 16px; align-items: flex-start;
  }
  .navlinks.open { display: flex; }
  .menu-btn { display: block; }
}
