/* ==========================================================================
   VAAYU CHEST & PAIN CLINIC - BASE CSS
   ========================================================================== */

/* --- CSS VARIABLES & GLOBAL TOKENS --- */
:root {
  /* Brand Colors */
  --crimson: #CA0451;      /* Lung & Chest care accent */
  --slate: #4E4864;        /* Pain management accent */
  --ink: #1A1A1A;          /* Primary dark/text color */
  --bg: #FFFFFF;           /* Core background */
  --bg-alt: #F7F5F8;       /* Alternating section backgrounds */
  
  /* UI Colors */
  --text-muted: #625E73;
  --border: #E8E5EC;
  --white: #FFFFFF;
  --shadow-sm: 0 2px 8px rgba(26, 26, 26, 0.05);
  --shadow-md: 0 8px 30px rgba(26, 26, 26, 0.08);
  
  /* Typography */
  --font-headings: "Fraunces", serif;
  --font-body: "DM Sans", sans-serif;
  
  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  color: var(--ink);
  line-height: 1.25;
  font-weight: 700;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

ul, ol {
  list-style: none;
}

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

/* Scroll Block */
body.no-scroll {
  overflow: hidden;
}

/* --- SITE HEADER & CONTAINER --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.site-header.scrolled {
  box-shadow: var(--shadow-sm);
  border-bottom-color: transparent;
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  z-index: 1001;
}

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

/* --- NAVIGATION MENU (DESKTOP) --- */
.nav-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-grow: 1;
  margin-left: 3rem;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-item {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 1.8rem 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-body);
}

.nav-item:hover,
.nav-item:focus {
  color: var(--crimson);
}

.chevron-icon {
  transition: transform 0.2s ease;
}

.nav-item:hover .chevron-icon {
  transform: translateY(2px);
}

/* --- ACTIONS (PHONE & CTA) --- */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-phone {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
}

.nav-phone:hover {
  color: var(--slate);
}

.phone-icon {
  color: var(--slate);
  transition: transform 0.2s ease;
}

.nav-phone:hover .phone-icon {
  transform: scale(1.1);
}

.btn-appointment {
  background-color: var(--crimson);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(202, 4, 81, 0.15);
}

.btn-appointment:hover {
  background-color: #aa0343;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(202, 4, 81, 0.25);
}

/* --- MEGA MENU BASE (DESKTOP) --- */
.has-mega-menu {
  position: relative;
}

.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 900px;
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  padding: 2.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  pointer-events: none;
  z-index: 999;
}

/* Desktop Hover Trigger */
@media (min-width: 1024px) {
  .has-mega-menu:hover .mega-menu,
  .has-mega-menu:focus-within .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
  }
  
  .has-mega-menu:hover .chevron-icon {
    transform: rotate(180deg);
  }
}

/* 50/50 Strict Grid Layout */
.mega-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.mega-col {
  display: flex;
  flex-direction: column;
}

.mega-header {
  font-family: var(--font-headings);
  font-size: 1.35rem;
  font-weight: 700;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Accent Underlines */
.mega-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  border-radius: 2px;
}

.pain-header::after {
  background-color: var(--slate);
}

.lung-header::after {
  background-color: var(--crimson);
}

.doctor-sub {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.3;
}

.mega-sublist {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mega-sublist.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.5rem;
}

.mega-sublist a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--ink);
  padding: 0.25rem 0;
}

.mega-sublist a:hover {
  padding-left: 4px;
}

.pain-col .mega-sublist a:hover {
  color: var(--slate);
}

.lung-col .mega-sublist a:hover {
  color: var(--crimson);
}

.service-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 1.5px;
}

.pain-col .service-icon {
  color: var(--slate);
}

.lung-col .service-icon {
  color: var(--crimson);
}

/* Conditions Menu Sizing Adjustment */
.conditions-mega {
  width: 800px;
}

/* --- MOBILE NAVIGATION TRIGGER & OVERLAY --- */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1002;
}

.mobile-toggle svg {
  width: 28px;
  height: 28px;
}

@media (max-width: 1023px) {
  .mobile-toggle {
    display: block;
  }
  
  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    margin-left: 0;
    padding: 90px 2rem 2rem;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, visibility 0.35s;
    z-index: 999;
  }

  .nav-menu.nav-menu-open {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-bottom: 2rem;
  }

  .nav-item {
    width: 100%;
    padding: 1rem 0;
    font-size: 1.15rem;
    border-bottom: 1px solid var(--border);
    justify-content: space-between;
  }

  .nav-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
  }

  .nav-phone {
    justify-content: center;
    padding: 1rem;
    background-color: var(--bg-alt);
    border-radius: 6px;
  }

  .btn-appointment {
    text-align: center;
    padding: 1rem;
    font-size: 1rem;
  }

  /* --- MOBILE ACCORDIONS --- */
  .mega-menu {
    position: static;
    transform: none;
    width: 100% !important;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .mega-menu.mega-menu-open {
    max-height: 1200px; /* arbitrary height to allow expansion transition */
    padding: 1rem 0;
  }

  .mega-grid-2 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .mega-header {
    font-size: 1.15rem;
    margin-bottom: 1rem;
  }

  .mega-sublist.grid-2col {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .mega-sublist a {
    padding: 0.5rem 0;
  }

  .chevron-icon {
    transform: rotate(0deg);
  }

  .mega-trigger[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
  }
}

/* --- SITE FOOTER --- */
.site-footer {
  background-color: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 5rem 0 2rem;
  color: var(--ink);
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 4rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
}

.brand-col .footer-logo {
  margin-bottom: 1.25rem;
  display: inline-block;
}

.footer-logo-img {
  height: 48px;
  width: auto;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--white);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.social-links a:hover {
  background-color: var(--slate);
  color: var(--white);
  border-color: var(--slate);
  transform: translateY(-2px);
}

.social-links svg {
  width: 18px;
  height: 18px;
}

.footer-heading {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  position: relative;
}

.footer-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background-color: var(--border);
}

.footer-heading.pain-border::after {
  background-color: var(--slate);
}

.footer-heading.lung-border::after {
  background-color: var(--crimson);
}

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

.footer-links a {
  font-size: 0.95rem;
  color: var(--text-muted);
}

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

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-info p {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.contact-info a:hover {
  color: var(--ink);
}

.contact-icon {
  width: 18px;
  height: 18px;
  color: var(--slate);
  flex-shrink: 0;
  margin-top: 3px;
}

.map-container {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.map-container iframe {
  display: block;
}

/* Footer Bottom Bar */
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.copyright {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
}

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

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

/* --- FOOTER RESPONSIVENESS --- */
@media (max-width: 1023px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 639px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .site-footer {
    padding: 3.5rem 0 2rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
