/* Design System & Variables */
:root {
  /* ELEXIR Color System */
  --color-primary: #0F3D3E;
  /* Deep Clinical Teal */
  --color-accent: #C6A75E;
  /* Muted Champagne Gold */
  --color-bg-primary: #F7F8F6;
  /* Warm White */
  --color-bg-alt: #EAF1F0;
  /* Light Teal Tint */
  --color-text-primary: #1E1E1E;
  /* Graphite */
  --color-text-muted: #7C8A92;
  /* From Palette */
  --color-border: #DCE6E2;
  /* From Palette */

  /* Typography */
  --font-sans: 'Montserrat', system-ui, -apple-system, sans-serif;
  --font-accent: 'Playfair Display', serif;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ELEXIR Type Scale */
h1,
.hero-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 56px;
  line-height: 1.2;
  letter-spacing: 0.5px;
  color: var(--color-primary);
}

h2,
.section-title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 36px;
  line-height: 1.25;
  color: var(--color-primary);
}

h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.3;
  color: var(--color-text-primary);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: var(--color-primary);
  transition: opacity var(--transition-fast);
}

a:hover {
  opacity: 0.8;
}

ul {
  list-style: none;
}

/* Utilities */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
}

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

.btn-primary:hover {
  background-color: #0c3132;
  /* 5% darker */
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-accent);
}

.btn-outline:hover {
  background-color: rgba(198, 167, 94, 0.1);
  border-color: var(--color-primary);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.mt-4 {
  margin-top: 1rem;
}

/* Flat Medical Design */
.glass-card {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 90px;
  background: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  overflow: hidden; /* Clip logo bleed and ::before overflow */
  transition: all var(--transition-fast);
}

.navbar.scrolled {
  height: 75px;
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.nav-logo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 100%;
  width: 185px;
  background-color: #143942;
  transition: all var(--transition-fast);
  z-index: 1;
  overflow: hidden;
}

.nav-logo::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100vw;
  right: 0;
  height: 100%;
  background-color: #143942;
  z-index: -1;
}

.nav-logo img {
  height: 100% !important;
  width: auto !important;
  max-width: 100% !important;
  object-fit: contain !important;
  transform: scale(1.45); /* Zoom into centre of logo; clipped by overflow:hidden */
  transition: all var(--transition-fast);
  border-radius: 0;
}

.navbar.scrolled .nav-logo img {
  height: 100% !important; /* Keep same scale on scroll */
  transform: scale(1.45);
}

.nav-links {
  display: flex;
  justify-content: space-evenly; /* Distribute items evenly */
  flex: 1; /* Take up remaining space between logo and actions */
  align-items: center;
  margin: 0 2rem; /* Buffer space from logo and buttons */
  gap: 1rem; /* Minimum gap */
}

.nav-links a {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  text-transform: none; /* Changed to match image (Title Case) */
  letter-spacing: 0.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  transition: all var(--transition-fast);
}

.nav-links a:hover {
  color: var(--color-primary);
  transform: translateY(-1px);
}

.hamburger-menu {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 2001;
  margin-left: 0.5rem;
}

@media (min-width: 769px) {
  .hamburger-menu {
    display: none;
  }
}

.hamburger-menu span {
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.hamburger-menu.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-menu.open span:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Navigation Drawer (for both Desktop & Mobile Hamburger Menu) */
.nav-drawer {
  position: fixed;
  top: 0;
  right: -300px; /* Start offscreen */
  width: 300px;
  height: 100vh;
  background-color: var(--color-bg-primary);
  box-shadow: -10px 0 30px rgba(15, 61, 62, 0.08);
  display: flex;
  flex-direction: column;
  padding: 100px 30px;
  z-index: 2000;
  transition: right var(--transition-normal);
  border-left: 1px solid var(--color-border);
}

.nav-drawer.open {
  right: 0;
}

.close-drawer {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
}

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.drawer-links a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  padding: 10px 0;
  border-bottom: 1px solid rgba(15, 61, 62, 0.05);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
}

.drawer-links a:hover {
  color: var(--color-primary);
  transform: translateX(4px);
}

/* Sections */
section {
  padding: 96px 2rem;
  max-width: 1140px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-family: var(--font-accent);
  font-size: 36px;
  font-weight: 500;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.section-subtitle {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 120px;
  gap: 4rem;
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-primary);
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.hero-title {
  font-family: var(--font-accent);
  font-size: 48px;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--color-primary);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
}

.hero-stats {
  display: flex;
  gap: 3rem;
  border-top: 1px solid var(--color-border);
  padding-top: 2rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
}

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

.hero-visual {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image-wrapper {
  max-width: 500px;
  width: 100%;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-cat-image {
  width: 100%;
  height: auto;
  border-radius: 4px;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

.hero-image-caption {
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-primary);
  font-family: var(--font-sans);
}

.hero-image-caption strong {
  color: var(--color-primary);
}

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  background-color: var(--color-bg-primary);
  border-radius: 4px;
  border: 1px solid var(--color-border);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.feature-image-wrapper {
  width: 100%;
  height: 250px;
  border-bottom: 1px solid var(--color-border);
}

.feature-cat-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.feature-content h3 {
  color: var(--color-primary);
  font-family: var(--font-accent);
  font-size: 24px;
}

.feature-content p {
  color: var(--color-text-muted);
}

/* Products */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.product-card {
  background-color: var(--color-bg-primary);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-primary);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.product-image {
  width: 100%;
  height: 300px;
  object-fit: contain;
  background-color: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem;
}

.product-content {
  padding: 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-category {
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.product-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.product-desc {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  flex: 1;
}

.product-price {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.product-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

/* Info Section */
.info-section {
  background-color: var(--color-bg-alt);
  padding: 96px 2rem;
}

.info-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.info-list {
  margin: 2rem 0;
}

.info-list li {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.info-list li::before {
  content: '✓';
  color: var(--color-accent);
  font-weight: bold;
}

.dosage-card {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: var(--color-border);
  border-radius: 4px;
  margin: 1.5rem 0 0.5rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
  border-radius: 4px;
}

.small-text {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Footer */
.footer {
  background-color: var(--color-primary);
  padding: 4rem 2rem 2rem;
  border-top: 1px solid var(--color-border);
  color: white;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto 3rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
}

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

.footer-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 166px;
  height: 166px;
  background-color: #143942;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.footer-logo img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transform: scale(1.2); /* Unzoomed further to show more details of the logo */
  transition: all var(--transition-fast);
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.7);
  max-width: 300px;
}

.footer-links h4,
.footer-contact h4 {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.footer-links a,
.footer-contact p {
  display: block;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

/* Animations Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 992px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding-top: 150px;
  }

  .hero-content {
    margin: 0 auto;
  }

  .hero-actions,
  .hero-stats {
    justify-content: center;
  }

  .info-container {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 0;
    text-align: center;
  }

  .footer-brand,
  .footer-links,
  .footer-contact {
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-contact {
    border-bottom: none;
  }

  .footer-brand p {
    max-width: 100%;
    text-align: center;
  }

  .footer-links a,
  .footer-contact p {
    text-align: center;
  }
}

@media (max-width: 1024px) {
  .hero-title {
    font-size: 3rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none !important; /* Hide inline navigation links on mobile */
  }

  .nav-btn:not(.cart-btn):not(.mobile-btn) {
    display: none;
  }

  .cart-btn {
    display: flex;
    white-space: nowrap;
  }

  /* Tablet/large-phone navbar — slightly compact but logo still clear */
  .navbar {
    height: 72px;
  }
  .navbar.scrolled {
    height: 60px;
  }
  .nav-logo {
    width: 160px;
  }
  .nav-logo img,
  .navbar.scrolled .nav-logo img {
    height: 100% !important;
    transform: scale(1.35) !important; /* Slightly less zoom on tablet */
  }
  .nav-container {
    padding: 0 1rem;
  }
}

@media (max-width: 600px) {
  .hero-title { font-size: 2.2rem; }
  .hero-subtitle { font-size: 1.1rem; }
  .section-title { font-size: 28px; }
  .section-subtitle { font-size: 16px; }
  
  .nav-container { padding: 0 0.75rem; }

  /* Mobile navbar — compact but logo stays centred and visible */
  .navbar {
    height: 64px;
  }
  .navbar.scrolled {
    height: 56px;
  }
  .nav-logo {
    width: 140px;
  }
  .nav-logo img,
  .navbar.scrolled .nav-logo img {
    height: 100% !important;
    transform: scale(1.25) !important; /* Gentle zoom — keeps central content clear */
  }
  
  .btn-outline, .btn-primary { 
    padding: 0.5rem 0.75rem; 
    font-size: 0.9rem;
  }
  
  .cart-text { display: none; }
  
  .hero-actions { 
    flex-direction: column; 
    width: 100%; 
    gap: 1rem;
  }
  .hero-actions .btn { 
    width: 100%; 
    text-align: center; 
    box-sizing: border-box;
  }
  
  section { padding: 60px 1rem; }
  
  /* Make cards horizontally scrollable */
  /* Features horizontally scrollable */
  .features-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    padding-bottom: 2rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  
  .feature-card {
    flex: 0 0 85%;
    scroll-snap-align: center;
  }

  /* Products 2-column tight grid */
  .products-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .product-image {
    height: 150px;
    padding: 0.5rem;
  }

  .product-content {
    padding: 1rem 0.75rem;
  }

  .product-category {
    font-size: 0.65rem;
    margin-bottom: 0.25rem;
  }

  .product-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }

  .product-desc {
    display: none; /* Hide heavy description on mobile to keep grid clean */
  }

  .product-price {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
  }

  .product-card .btn {
    padding: 0.5rem;
    font-size: 0.8rem;
    width: 100%;
  }
}

/* Cart Button & Modal */
.nav-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.cart-modal {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 400px;
  height: 100vh;
  background-color: var(--color-bg-primary);
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  transition: right var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.cart-modal.open {
  right: 0;
}

.cart-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2rem;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.close-cart {
  background: none;
  border: none;
  color: var(--color-text-primary);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.empty-cart-msg {
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 2rem;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-bg-alt);
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

.cart-item-details h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.cart-item-price {
  color: var(--color-primary);
  font-weight: 600;
}

.remove-item {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 1.25rem;
}

.cart-footer {
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
  margin-top: auto;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

@keyframes wa-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ── Cart scroll hint ─────────────────────────────────────────────────────── */
/* Hidden by default on desktop — only shown on mobile via JS */
.cart-scroll-hint {
  display: none;
}

@keyframes cart-bounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%       { transform: translateY(6px); opacity: 0.7; }
}

@media (max-width: 768px) {
  .cart-scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    /* Gradient fade that sits just above the footer */
    background: linear-gradient(
      to bottom,
      transparent 0%,
      var(--color-bg-primary) 60%
    );
    padding: 1.2rem 1rem 0.6rem;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    /* Visibility is toggled by .visible class via JS */
  }

  .cart-scroll-hint.visible {
    opacity: 1;
    transform: translateY(0);
  }

  .cart-scroll-hint__arrow {
    font-size: 1.8rem;
    line-height: 1;
    color: var(--color-primary);
    animation: cart-bounce 1.1s ease-in-out infinite;
  }

  .cart-scroll-hint__label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
  }
}