/* ============================================================
   MOBILE RESPONSIVENESS AUDIT — COMPREHENSIVE FIX
   Fixes: broken layouts, overflowing text, overlapping elements,
   excessive spacing, cropped images, misaligned sections, menus,
   sliders, buttons, forms, doctor cards, floating widgets, footer.
   Loads AFTER styles.css to override all conflicting rules.
   ============================================================ */

/* ========== 1. GLOBAL SAFETY — Kill horizontal scroll ========== */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}
*, *::before, *::after {
  box-sizing: border-box !important;
}

/* ========== 2. RESOLVE HERO PADDING CONFLICTS ========== */
/* The original CSS has 6+ conflicting padding-top values for #hero.
   This establishes ONE clean rule per breakpoint — content starts
   right at the bottom of the welcome marquee bar (no gap). */

/* Mobile hero: welcome bar bottom = ~136px + ~36px bar height = ~172px, minus 15px = 157px */
#hero {
  padding-top: 157px !important;
  padding-bottom: 16px !important;
}

@media (min-width: 431px) and (max-width: 768px) {
  #hero { padding-top: 157px !important; }
}

@media (min-width: 769px) and (max-width: 1023px) {
  #hero { padding-top: 183px !important; padding-bottom: 20px !important; }
}

@media (min-width: 1024px) {
  #hero { padding-top: 210px !important; padding-bottom: 24px !important; }
}

@media (min-width: 1280px) {
  #hero { padding-top: 215px !important; padding-bottom: 24px !important; }
}

/* ========== 3. RESOLVE MARQUEE BAR POSITIONING ========== */
/* Updated for taller header + larger logo */
.marquee-sticky-bar {
  top: 147px !important;
}
.marquee-welcome-bar {
  top: 189px !important;
}

@media (min-width: 1024px) {
  .marquee-sticky-bar { top: 147px !important; }
  .marquee-welcome-bar { top: 189px !important; }
}

@media (min-width: 1280px) {
  .marquee-sticky-bar { top: 152px !important; }
  .marquee-welcome-bar { top: 194px !important; }
}

@media (max-width: 1023px) {
  .marquee-sticky-bar { top: 120px !important; }
  .marquee-welcome-bar { top: 162px !important; }
}

@media (max-width: 768px) {
  .marquee-sticky-bar { top: 94px !important; }
  .marquee-welcome-bar { top: 136px !important; }
}

/* ========== 4. HERO TITLE — No overflow on any phone ========== */
.hero-title {
  font-size: clamp(24px, 6.5vw, 32px) !important;
  line-height: 1.12 !important;
  letter-spacing: -0.3px !important;
  max-width: 100% !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  white-space: normal !important;
}
.hero-title > span {
  display: block;
  white-space: normal !important;
  overflow-wrap: break-word !important;
}

/* Tablet+ desktop: single-line per span */
@media (min-width: 769px) {
  .hero-title {
    font-size: clamp(28px, 3vw, 48px) !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
  .hero-title > span {
    white-space: nowrap !important;
  }
}

@media (min-width: 1280px) {
  .hero-title { font-size: clamp(34px, 2.6vw, 48px) !important; }
}

/* Small phones */
@media (max-width: 400px) {
  .hero-title { font-size: clamp(22px, 7vw, 28px) !important; }
}
@media (max-width: 360px) {
  .hero-title { font-size: clamp(20px, 6.5vw, 26px) !important; }
}

/* ========== 5. HERO GRID — Clean stacking on mobile ========== */
@media (max-width: 768px) {
  #hero .grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    align-items: stretch !important;
  }
  #hero .grid > * {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
  }
  .hero-content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
  .hero-slider-col {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ========== 6. HERO CAROUSEL — Fully visible on all devices ========== */
.hero-carousel {
  width: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 3 / 2 !important;
  height: auto !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.hero-slide {
  display: block !important;
  visibility: visible !important;
  opacity: 0;
}
.hero-slide.is-active { opacity: 1; }
.hero-slide img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  max-height: none !important;
}

/* ========== 7. HERO BUTTONS — Stack and stretch on mobile ========== */
@media (max-width: 768px) {
  #hero .mt-4.flex,
  #hero .flex.flex-wrap {
    flex-direction: column !important;
    gap: 10px !important;
    align-items: stretch !important;
  }
  #hero .mt-4.flex > a,
  #hero .flex.flex-wrap > a,
  #hero .cta-pill {
    width: 100% !important;
    justify-content: center !important;
    padding: 14px 20px !important;
    min-height: 48px !important;
  }
}

/* ========== 8. NAVBAR LOGO — Proper sizing on all screens ========== */
@media (max-width: 768px) {
  .brand-logo--nav, .hero-logo-large {
    max-height: 80px !important;
    width: auto !important;
  }
}
@media (max-width: 430px) {
  .brand-logo--nav, .hero-logo-large {
    max-height: 65px !important;
  }
}

/* ========== 9. DOCTOR CARDS GRID — Responsive columns ========== */
/* 2 columns on 481-768px, 1 column on <=480px */
@media (max-width: 768px) {
  .doctors-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .doctor-card .photo {
    aspect-ratio: 4/4.5 !important;
  }
  .doctor-card .meta {
    padding: 10px 12px !important;
  }
  .doctor-card .meta h3 {
    font-size: 13px !important;
    line-height: 1.2 !important;
  }
  .doctor-card .meta p {
    font-size: 11px !important;
  }
  .doctor-card .availability {
    font-size: 8px !important;
    padding: 3px 7px !important;
    top: 8px !important;
    left: 8px !important;
  }
  .doctor-card .qr {
    width: 30px !important;
    height: 30px !important;
    top: 8px !important;
    right: 8px !important;
    border-radius: 8px !important;
  }
  .doctor-card .book-doctor.link {
    font-size: 11px !important;
  }
}

@media (max-width: 480px) {
  .doctors-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .doctor-card .photo {
    aspect-ratio: 4/3.5 !important;
  }
  .doctor-card .meta {
    padding: 14px 16px !important;
  }
  .doctor-card .meta h3 {
    font-size: 16px !important;
  }
  .doctor-card .meta p {
    font-size: 13px !important;
  }
}

/* ========== 10. DOCTOR FILTER BUTTONS — Wrap properly ========== */
@media (max-width: 768px) {
  #specialization-filters {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .spec-filter {
    font-size: 12px !important;
    padding: 8px 14px !important;
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
  }
  #doctor-search {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 48px !important;
    font-size: 16px !important; /* Prevents iOS zoom */
  }
}

/* ========== 11. SERVICE CARDS — Clean mobile layout ========== */
@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .service-card {
    padding: 18px !important;
  }
  .service-card h3 {
    font-size: 16px !important;
  }
  .service-card p {
    font-size: 13px !important;
  }
  .service-card .icon {
    width: 40px !important;
    height: 40px !important;
    margin-bottom: 12px !important;
  }
}

/* ========== 12. PREGNANCY PACKAGE — Mobile stacking ========== */
@media (max-width: 1024px) {
  .pkg-card {
    grid-template-columns: 1fr !important;
  }
  .pkg-card > div {
    border-left: none !important;
    border-top: 1px solid rgba(224,181,61,.2) !important;
  }
  .pkg-card > div:first-child {
    border-top: none !important;
  }
}
@media (max-width: 768px) {
  .pkg-card > div {
    padding: 20px !important;
  }
  .pkg-card .text-5xl {
    font-size: clamp(24px, 6vw, 32px) !important;
  }
  .pkg-card .text-4xl {
    font-size: clamp(20px, 5vw, 28px) !important;
  }
  .pkg-card .grid.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
  .pkg-card .grid.grid-cols-3 .text-2xl,
  .pkg-card .grid.grid-cols-3 .text-3xl {
    font-size: 18px !important;
  }
  .pkg-card .grid.grid-cols-3 .text-xs {
    font-size: 9px !important;
  }
  .pkg-feature {
    padding: 8px !important;
    gap: 10px !important;
  }
  .pkg-feature .num {
    width: 28px !important;
    height: 28px !important;
    font-size: 12px !important;
  }
}
@media (max-width: 400px) {
  .pkg-card .grid.grid-cols-3 {
    grid-template-columns: 1fr !important;
  }
}

/* ========== 13. TESTIMONIAL SECTION — Stack on mobile ========== */
@media (max-width: 768px) {
  #trust .grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  #trust .lg\:col-span-2 {
    grid-column: auto !important;
  }
  #trust article[style*="min-height"] {
    min-height: 200px !important;
  }
  .testi-card {
    padding: 18px !important;
  }
  .review-text-enhanced {
    font-size: 14px !important;
    line-height: 1.4 !important;
  }
}

/* ========== 14. STATISTICS STRIP — 2x2 on mobile ========== */
@media (max-width: 768px) {
  #stats-strip .grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }
  .stats-strip-divider::before {
    display: none !important;
  }
  .stats-strip-number {
    font-size: 1.8rem !important;
  }
  .stats-strip-label {
    font-size: 9px !important;
  }
}
@media (max-width: 400px) {
  #stats-strip .grid {
    grid-template-columns: 1fr !important;
  }
}

/* ========== 15. BOOKING FORM — Touch-friendly on mobile ========== */
@media (max-width: 768px) {
  #book .glass {
    padding: 16px !important;
    border-radius: 20px !important;
  }
  #book .grid.sm\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }
  #book h3 {
    font-size: 20px !important;
  }
  #book .chip {
    padding: 14px !important;
    min-height: 48px !important;
  }
  #book .stepper .flex {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
  .field {
    min-height: 48px !important;
    font-size: 16px !important; /* Prevents iOS zoom */
  }
  .calendar-picker {
    max-width: 100% !important;
    width: 100% !important;
  }
  #time-slots {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  #book .step span {
    font-size: 10px !important;
  }
  #book .step .bullet {
    width: 24px !important;
    height: 24px !important;
    font-size: 10px !important;
  }
}

/* ========== 16. CONTACT SECTION — Mobile stacking ========== */
@media (max-width: 1024px) {
  #contact .grid {
    grid-template-columns: 1fr !important;
  }
  #contact .lg\:col-span-5,
  #contact .lg\:col-span-7 {
    max-width: 100% !important;
    flex: 0 0 100% !important;
    width: 100% !important;
  }
  .map-frame iframe {
    height: 350px !important;
  }
}
@media (max-width: 768px) {
  #contact .grid.sm\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }
  .map-frame iframe {
    height: 280px !important;
  }
  .map-frame {
    border-radius: 14px !important;
  }
}

/* ========== 17. FLOATING WIDGETS — No overlap with sticky CTA ========== */
@media (max-width: 768px) {
  .doctors-duty-widget {
    bottom: 140px !important;
    right: 10px !important;
    width: 200px !important;
    max-width: calc(100vw - 20px) !important;
    z-index: 45 !important;
  }
  #fab-wrap {
    bottom: 85px !important;
    right: 10px !important;
  }
  .fab-main {
    width: 50px !important;
    height: 50px !important;
  }
}

@media (max-width: 480px) {
  .doctors-duty-widget {
    bottom: 130px !important;
    width: 180px !important;
  }
  #fab-wrap {
    bottom: 80px !important;
  }
}

/* ========== 18. FOOTER — Single column on mobile ========== */
@media (max-width: 768px) {
  #footer {
    padding-top: 32px !important;
    padding-bottom: 90px !important; /* Space for sticky CTA */
  }
  #footer .grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  #footer .grid > div {
    text-align: center;
  }
  #footer .flex.items-center.gap-8 {
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
  }
  #footer .flex.items-center.gap-8 p {
    text-align: center;
    max-width: 100% !important;
  }
  #footer .flex.items-start.gap-4 {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  #footer .pt-6 {
    flex-direction: column !important;
    text-align: center;
    gap: 12px !important;
  }
  #footer .pt-6 .flex {
    justify-content: center;
  }
  .divider-gold {
    margin-top: 24px !important;
  }
}

/* ========== 19. STICKY MOBILE CTA — Touch-friendly ========== */
@media (max-width: 768px) {
  .lg\:hidden.fixed.bottom-0 {
    padding: 10px 12px !important;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .lg\:hidden.fixed.bottom-0 a {
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
  }
}

/* ========== 20. WELCOME BAR — Smaller text on mobile ========== */
@media (max-width: 768px) {
  .welcome-pill {
    font-size: 10px !important;
    letter-spacing: 0.01em !important;
  }
}
@media (max-width: 400px) {
  .welcome-pill {
    font-size: 9px !important;
  }
}

/* ========== 21. ACCREDITATION BANNER — Stack on mobile ========== */
@media (max-width: 768px) {
  #accreditation {
    padding: 8px 0 !important;
  }
  #accreditation .flex-col.sm\:flex-row {
    flex-direction: column !important;
    gap: 10px !important;
  }
  #accreditation .hidden.sm\:block {
    display: none !important;
  }
}

/* ========== 22. SECTION HEADING SIZES — Responsive ========== */
@media (max-width: 768px) {
  section .h-display.text-5xl,
  section .h-display.text-6xl {
    font-size: clamp(26px, 6vw, 36px) !important;
    line-height: 1.1 !important;
  }
  section .text-4xl {
    font-size: clamp(22px, 5vw, 30px) !important;
  }
  section .text-3xl {
    font-size: clamp(18px, 4.5vw, 26px) !important;
  }
}

/* ========== 23. SECTION SPACING — Tighter on mobile ========== */
@media (max-width: 768px) {
  section.py-12 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
  section.py-10 {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
  }
  section.py-8 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
  section .mb-14 {
    margin-bottom: 1rem !important;
  }
  section .mb-10 {
    margin-bottom: 0.75rem !important;
  }
  section .mb-8 {
    margin-bottom: 0.75rem !important;
  }
}

/* ========== 24. DECORATIVE ORBS — Tame on mobile ========== */
@media (max-width: 768px) {
  .orb {
    opacity: 0.1 !important;
    filter: blur(50px) !important;
  }
  #hero .orb {
    width: 200px !important;
    height: 200px !important;
  }
}

/* ========== 25. IMAGE LIGHTBOX — Mobile optimized ========== */
@media (max-width: 640px) {
  .lightbox-nav {
    width: 40px !important;
    height: 40px !important;
  }
  .lightbox-close {
    width: 40px !important;
    height: 40px !important;
    top: 12px !important;
    right: 12px !important;
  }
  .lightbox-prev { left: 8px !important; }
  .lightbox-next { right: 8px !important; }
  .lightbox-content img {
    max-width: 94vw !important;
    max-height: 70vh !important;
    border-radius: 8px !important;
  }
  .lightbox-caption {
    font-size: 13px !important;
    padding: 0 10px !important;
  }
}

/* ========== 26. MOBILE DRAWER — Full screen, touch-friendly ========== */
@media (max-width: 768px) {
  #drawer .absolute.right-0 {
    width: 90% !important;
    max-width: 340px !important;
  }
  .drawer-link {
    padding: 16px 4px !important;
    font-size: 18px !important;
    min-height: 52px !important;
    display: flex !important;
    align-items: center !important;
  }
}

/* ========== 27. DOCTORS.HTML — Mobile fixes ========== */
@media (max-width: 768px) {
  .dr-card .dr-meta {
    padding: 12px 14px 14px !important;
  }
  .dr-card .dr-name {
    font-size: 1rem !important;
  }
  .dr-card .dr-photo {
    aspect-ratio: 4/3 !important;
  }
  .chip-filter {
    padding: 8px 12px !important;
    font-size: 12px !important;
    min-height: 40px !important;
  }
  .search-wrap input {
    min-height: 48px !important;
    font-size: 16px !important;
  }
}

/* ========== 28. SCROLLBAR — Hide on mobile for clean look ========== */
@media (max-width: 768px) {
  ::-webkit-scrollbar { width: 4px; }
}

/* ========== 29. SAFE AREA — Notched phones (iPhone X+) ========== */
@supports (padding: env(safe-area-inset-bottom)) {
  .lg\:hidden.fixed.bottom-0 {
    padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
  }
  #fab-wrap {
    bottom: calc(85px + env(safe-area-inset-bottom)) !important;
  }
  .doctors-duty-widget {
    bottom: calc(140px + env(safe-area-inset-bottom)) !important;
  }
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom)) !important;
  }
}

/* ========== 30. PREVENT ZOOM ON FOCUS (iOS) ========== */
@media (max-width: 768px) {
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ========== 31. PERFORMANCE — Reduce motion ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .marquee-track { animation: none !important; }
  .marquee-track--welcome { animation: none !important; }
  .stats-strip-shimmer { animation: none !important; }
}

/* ========== 32. LANDSCAPE PHONE FIXES ========== */
@media (max-height: 500px) and (orientation: landscape) {
  #hero { padding-top: 140px !important; }
  .marquee-sticky-bar { top: 82px !important; }
  .marquee-welcome-bar { top: 124px !important; }
  .hero-carousel { max-height: 200px !important; aspect-ratio: auto !important; }
  .doctors-duty-widget { display: none !important; }
  #fab-wrap { bottom: 60px !important; }
}

/* ========== 33. TABLET SPECIFIC (768-1024px) ========== */
@media (min-width: 769px) and (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .doctors-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  #footer .grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .hero-carousel {
    border-radius: 16px !important;
  }
}

/* ========== 34. CTA PILL — Touch-friendly everywhere ========== */
.cta-pill {
  min-height: 44px !important;
  touch-action: manipulation;
}

/* ========== 35. WELCOME BAR — Fix for hero clearance ========== */
/* Hero content must clear below the welcome bar */
#hero {
  margin-top: 0 !important;
}

/* ========== 36. FIX OVERLAPPING FIXED ELEMENTS ========== */
/* Ensure fixed elements don't overlap content */
@media (max-width: 768px) {
  /* Add bottom padding to all sections near sticky CTA */
  #footer {
    margin-bottom: 0 !important;
    padding-bottom: 90px !important;
  }
  /* Ensure FAB doesn't cover content */
  main {
    padding-bottom: 72px;
  }
}

/* ========== 37. HERO CAROUSEL HINT — Mobile sizing ========== */
@media (max-width: 640px) {
  .hero-carousel-hint {
    bottom: 36px !important;
    right: 8px !important;
    font-size: 10px !important;
    padding: 4px 8px !important;
  }
  .hero-carousel-hint svg {
    width: 12px !important;
    height: 12px !important;
  }
}

/* ========== 38. STAT CARDS IN PREGNANCY SECTION — Mobile ========== */
@media (max-width: 640px) {
  .stat-card-3d {
    padding: 12px 8px !important;
  }
  .stat-card-3d .font-display {
    font-size: 1.5rem !important;
  }
}

/* ========== 39. GLASS CARDS IN CONTACT — Mobile ========== */
@media (max-width: 768px) {
  #contact .glass {
    padding: 16px !important;
    border-radius: 14px !important;
  }
  #contact .glass a {
    font-size: 18px !important;
    word-break: break-word;
  }
}

/* ========== 40. PREVENT TEXT OVERFLOW EVERYWHERE ========== */
@media (max-width: 768px) {
  h1, h2, h3, h4, h5 {
    overflow-wrap: break-word;
    word-break: break-word;
  }
  .font-display {
    overflow-wrap: break-word;
  }
  /* Prevent long phone numbers from overflowing */
  a[href^="tel:"] {
    word-break: break-all;
  }
  /* Ensure cards don't overflow */
  .glass, .service-card, .doctor-card, .testi-card, .offer-card, .pkg-card {
    overflow: hidden;
    max-width: 100%;
  }
}

/* ========== 41. NAVBAR CTA "BOOK APPOINTMENT" — Hidden on mobile only ========== */
/* Hide the header "Book Appointment" button ONLY on mobile phones (< 768px).
   It remains visible on tablets (>= 768px) and desktop. On mobile the drawer
   and sticky bottom CTA still provide booking access. Header is rebalanced so
   the logo/hospital name consume the freed space cleanly. */
@media (max-width: 767px) {
  #nav .header-actions > a.cta-pill {
    display: none !important;
  }

  /* Rebalance header on mobile: logo section grows to use the space
     freed by the hidden Book Appointment button; menu button pins right. */
  #nav .header-inner {
    padding: 12px 16px !important;
    gap: 12px !important;
    justify-content: space-between !important;
  }

  #nav .header-logo-section {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    justify-content: flex-start !important;
  }

  #nav .header-brand-logo {
    width: 100% !important;
    max-width: 300px !important;
    height: auto !important;
    margin: 0 !important;
    display: block !important;
  }

  #nav .header-actions {
    flex: 0 0 auto !important;
    gap: 0 !important;
    margin-left: auto !important;
  }

  #nav #menuBtn {
    flex-shrink: 0 !important;
  }
}

/* Very small phones — keep logo readable without overflow */
@media (max-width: 380px) {
  #nav .header-brand-logo {
    max-width: 240px !important;
  }
}

/* ========== 41b. DOCTOR CARD — Bold doctor name ========== */
/* Make the doctor's name bold across mobile and desktop.
   Uses high specificity to override existing font-weight rules. */
.doctor-card .meta h3,
#doctors .doctor-card .meta h3 {
  font-weight: 700 !important;
}

/* ========== 41c. DESKTOP HEADER — Prevent CTA overflow at any zoom ==========
   Issue: at 100% zoom on standard laptop widths, the header logo (430px) plus
   nav + phone block + CTA pill overflows the viewport, cutting off
   "Book Appointment". Fix: rebalance widths, allow the middle nav to flex,
   and clamp trailing items so everything fits from 1024px through 1920px+.
   Mobile (<768px) rules already defined above are NOT affected. */
@media (min-width: 768px) {
  #nav .header-inner {
    max-width: 1440px !important;
    padding: 14px 24px !important;
    gap: 16px !important;
    flex-wrap: nowrap !important;
  }

  #nav .header-logo-section {
    flex: 0 0 auto !important;
    min-width: 0 !important;
  }

  #nav .header-brand-logo {
    width: auto !important;
    height: 56px !important;
    max-width: 340px !important;
    object-fit: contain !important;
  }

  #nav .header-nav {
    gap: 22px !important;
    font-size: 14.5px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  #nav .header-nav .nav-link {
    font-size: 14.5px !important;
    white-space: nowrap !important;
  }

  #nav .header-actions {
    flex: 0 0 auto !important;
    gap: 14px !important;
    min-width: 0 !important;
  }

  #nav .header-contact-block {
    font-size: 13px !important;
    gap: 8px !important;
  }

  #nav .header-phone-numbers a {
    font-size: 13px !important;
    white-space: nowrap !important;
  }

  #nav .header-actions > a.cta-pill {
    padding: 10px 18px !important;
    font-size: 13.5px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
}

/* Medium desktop — laptops 1024-1279px */
@media (min-width: 1024px) and (max-width: 1279px) {
  #nav .header-brand-logo {
    height: 52px !important;
    max-width: 300px !important;
  }
  #nav .header-nav {
    gap: 18px !important;
    font-size: 14px !important;
  }
  #nav .header-nav .nav-link {
    font-size: 14px !important;
  }
  /* Hide the second (Front Desk) phone number to save space on small laptops */
  #nav .header-phone-numbers a:nth-of-type(2) {
    display: none !important;
  }
  #nav .header-actions > a.cta-pill {
    padding: 9px 16px !important;
    font-size: 13px !important;
  }
}

/* ========== 41d. DOCTORS-ON-DUTY WIDGET — Locked to bottom-right ==========
   Prevent the widget from being dragged into the header/marquee area.
   Force fixed placement with !important so inline styles from the (now
   disabled) drag script cannot move it. On desktop the widget sits at the
   very bottom-right corner and the message FAB is lifted above it so
   nothing overlaps. Mobile placement is preserved separately. */
.doctors-duty-widget {
  right: 20px !important;
  left: auto !important;
  top: auto !important;
  cursor: default !important;
}
.doctors-duty-widget #widget-drag-handle {
  cursor: pointer !important;
}

/* Desktop / tablet: widget flush to bottom-right, FAB lifted above it */
@media (min-width: 768px) {
  .doctors-duty-widget {
    bottom: 20px !important;
  }
  #fab-wrap {
    bottom: 220px !important;
    right: 20px !important;
  }
}

/* Mobile keeps existing stacking (widget above sticky CTA bar) */
@media (max-width: 767px) {
  .doctors-duty-widget {
    bottom: 150px !important;
  }
}

/* ========== 41e. HEADER ↔ YELLOW MARQUEE — Close the gap on desktop ==========
   The gold marquee bar is fixed to `top: 152px` (>=1024px), but the header
   at 100% zoom is now ~84px tall, leaving a visible gap. Pull the marquee
   flush against the header for desktop. Mobile values remain untouched. */
@media (min-width: 768px) and (max-width: 1023px) {
  .marquee-sticky-bar { top: 84px !important; }
  .marquee-welcome-bar { top: 124px !important; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .marquee-sticky-bar { top: 80px !important; }
  .marquee-welcome-bar { top: 120px !important; }
}
@media (min-width: 1280px) {
  .marquee-sticky-bar { top: 88px !important; }
  .marquee-welcome-bar { top: 128px !important; }
}

/* Wide desktop — 1280px+ can afford a slightly larger logo */
@media (min-width: 1280px) {
  #nav .header-brand-logo {
    height: 60px !important;
    max-width: 360px !important;
  }
  #nav .header-nav {
    gap: 28px !important;
    font-size: 15px !important;
  }
  #nav .header-nav .nav-link {
    font-size: 15px !important;
  }
  #nav .header-actions > a.cta-pill {
    padding: 11px 20px !important;
    font-size: 14px !important;
  }
}

/* ========== 42. PREGNANCY SECTION — Stat boxes & PERSONALISED PLAN gold text ========== */
/* Fix: styles.css has ".pkg-card > div.bg-black *{ color:inherit !important; }"
   which overrides inline gold colors on stat cards and badges.
   This block restores gold color for stat cards and the badge. */

/* Stat card numbers — bold gold */
.pkg-card > div.bg-black .stat-card-3d .font-display,
.pkg-card > div.bg-black .stat-card-3d .font-display span,
.pkg-card > div.bg-black .stat-card-3d .counter {
  color: #FFD700 !important;
  -webkit-text-fill-color: #FFD700 !important;
  text-shadow: 0 2px 4px rgba(0,0,0,1), 0 0 8px rgba(255,215,0,0.35) !important;
  font-weight: 800 !important;
}

/* Stat card labels — bold gold */
.pkg-card > div.bg-black .stat-card-3d .font-bold,
.pkg-card > div.bg-black .stat-card-3d div[style*="color: #FFD700"] {
  color: #FFD700 !important;
  -webkit-text-fill-color: #FFD700 !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9) !important;
  font-weight: 700 !important;
}

/* PERSONALISED PLAN badge — bold gold text */
.pkg-card > div.bg-black span[style*="color: #FFD700"],
.pkg-card > div.bg-black span[style*="FFD700"] {
  color: #FFD700 !important;
  -webkit-text-fill-color: #FFD700 !important;
  font-weight: 800 !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 10px rgba(255,215,0,0.4) !important;
}

/* Ensure stat card backgrounds remain dark/black */
.pkg-card > div.bg-black .stat-card-3d {
  background: linear-gradient(145deg, #111111 0%, #050505 100%) !important;
  border: 1px solid rgba(255, 215, 0, 0.45) !important;
  box-shadow: 0 8px 25px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05) !important;
}

/* Mobile adjustments for stat cards */
@media (max-width: 768px) {
  .pkg-card > div.bg-black .stat-card-3d .font-display {
    font-size: 1.4rem !important;
  }
  .pkg-card > div.bg-black .stat-card-3d .font-bold {
    font-size: 9px !important;
    letter-spacing: 0.12em !important;
  }
  /* PERSONALISED PLAN badge — visible on mobile */
  .pkg-card > div.bg-black span[style*="FFD700"] {
    font-size: 9px !important;
    padding: 4px 10px !important;
    letter-spacing: 0.2em !important;
  }
}

/* ========== 43. BOOKING FORM — Full mobile responsiveness ========== */
/* Root cause: on mobile the 6 service chips stack vertically, pushing the
   Continue button past the viewport where it is covered by the fixed
   sticky bottom CTA bar. Fix: reduce chip height, add section padding,
   make Continue button full-width and prominent, prevent clipping. */

/* 43.1 Section — allow scroll, add bottom padding for sticky bar clearance */
@media (max-width: 768px) {
  #book {
    overflow: visible !important;
    padding-bottom: 100px !important; /* clear the sticky bottom CTA bar */
  }

  /* The glass card must not clip content and must have breathing room */
  #book .glass {
    padding: 16px 14px 100px !important; /* big bottom padding so Continue is reachable */
    border-radius: 18px !important;
    overflow: visible !important;
  }

  /* Left pitch column — stack normally, not sticky on mobile */
  #book .lg\:col-span-3 {
    position: relative !important;
    top: auto !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    width: 100% !important;
  }
  #book .lg\:col-span-9 {
    max-width: 100% !important;
    flex: 0 0 100% !important;
    width: 100% !important;
  }

  /* Full-width grid stacking */
  #book .grid.lg\:grid-cols-12 {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  /* Left pitch — compact on mobile */
  #book h2 {
    font-size: clamp(22px, 5.5vw, 30px) !important;
    line-height: 1.1 !important;
  }
  #book p {
    font-size: 13px !important;
  }
  #book .eyebrow {
    margin-bottom: 8px !important;
  }

  /* Step labels — fit without wrapping */
  #book .step {
    gap: 6px !important;
  }
  #book .step span:not(.bullet) {
    font-size: 10px !important;
    white-space: nowrap !important;
  }
  #book .step .bullet {
    width: 26px !important;
    height: 26px !important;
    font-size: 11px !important;
    flex-shrink: 0 !important;
  }
  /* Step connector lines — shrink to save space */
  #book .step ~ span.flex-1,
  #book .step + span.flex-1 {
    min-width: 8px !important;
    flex: 1 1 4px !important;
  }
}

/* 43.2 Service chips — compact rows so 6 fit comfortably */
@media (max-width: 768px) {
  #book .chip {
    padding: 12px 14px !important;
    min-height: 56px !important;
    border-radius: 14px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }
  #book .chip .font-display,
  #book .chip div:first-child {
    font-size: 15px !important;
    line-height: 1.2 !important;
  }
  #book .chip .text-white\/60,
  #book .chip div.text-white\/60 {
    font-size: 11px !important;
    margin-top: 2px !important;
    line-height: 1.3 !important;
  }
  /* Chips grid: single column on mobile */
  #book .grid.sm\:grid-cols-2[data-chip-group] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  /* Reduce heading margin inside form */
  #book h3 {
    font-size: 19px !important;
    margin-bottom: 14px !important;
    line-height: 1.15 !important;
  }
  /* Reduce stepper row height */
  #book .flex.items-center.gap-2 {
    gap: 6px !important;
    padding-bottom: 0 !important;
  }
  /* Gold divider — less vertical space */
  #book .divider-gold.my-8 {
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
  }
}

/* 43.3 Booking nav — Back (left) + optional Confirm (right on Review only) */
@media (max-width: 768px) {
  /* The nav row containing Back + (hidden) Confirm */
  #book-form > div.mt-8,
  #book .mt-8.flex.items-center.justify-between {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 10 !important;
    background: linear-gradient(to top, rgba(255,255,255,1) 40%, rgba(255,255,255,0.9) 70%, rgba(255,255,255,0)) !important;
  }

  /* Confirm Booking (shown only on Review step) — prominent, right-aligned */
  #btn-next.cta-pill {
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: 100% !important;
    justify-content: center !important;
    padding: 14px 20px !important;
    min-height: 52px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-radius: 14px !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    touch-action: manipulation !important;
    margin-left: auto !important;
  }
  #btn-next.cta-pill span {
    font-size: 15px !important;
    font-weight: 700 !important;
  }
  /* When Continue is hidden, no need to reserve space for it */
  #btn-next.hidden {
    display: none !important;
  }

  /* Back button — left aligned, always easy to reach on mobile */
  #btn-prev {
    flex-shrink: 0 !important;
    padding: 12px 14px !important;
    min-height: 48px !important;
    min-width: 88px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 14px !important;
    background: rgba(10,21,48,0.06) !important;
    border: 1px solid rgba(10,21,48,0.15) !important;
    color: var(--ink) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    touch-action: manipulation !important;
    margin-right: auto !important;
  }
  /* On the first step Back is not applicable — keep it invisible */
  #btn-prev.invisible {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    /* keep left slot reserved so Confirm sits on the right when both exist */
    width: 88px !important;
    min-width: 88px !important;
  }
}

/* 43.4 Small phones — tighter chip sizes */
@media (max-width: 400px) {
  #book .chip {
    padding: 10px 12px !important;
    min-height: 50px !important;
  }
  #book .chip div:first-child {
    font-size: 14px !important;
  }
  #book .chip div.text-white\/60 {
    font-size: 10px !important;
  }
  #book .step span:not(.bullet) {
    font-size: 9px !important;
  }
  #book .step .bullet {
    width: 24px !important;
    height: 24px !important;
    font-size: 10px !important;
  }
  #btn-next.cta-pill {
    padding: 12px 16px !important;
    font-size: 14px !important;
  }
  #btn-next.hidden { display: none !important; }
}

/* 43.5 Fix for very small phones (≤360px) */
@media (max-width: 360px) {
  #book .glass {
    padding: 12px 10px 110px !important;
  }
  #book .chip {
    padding: 9px 10px !important;
    min-height: 46px !important;
  }
}

/* 43.6 Ensure the booking section content is never clipped by overflow */
@media (max-width: 768px) {
  #book,
  #book > .relative,
  #book .grid.lg\:grid-cols-12,
  #book .glass,
  #book-form {
    overflow: visible !important;
  }
}

/* 43.7 Doctor dropdown and calendar in booking form */
@media (max-width: 768px) {
  .doctor-dropdown-container,
  #doctor-select {
    width: 100% !important;
    min-height: 48px !important;
    font-size: 16px !important;
  }
  .calendar-picker {
    width: 100% !important;
    max-width: 100% !important;
  }
  /* Calendar + time slots: stack vertically */
  #book .flex.flex-col.md\:flex-row {
    flex-direction: column !important;
    gap: 16px !important;
  }
  #time-slots {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  #time-slots > div {
    padding: 10px 8px !important;
    font-size: 13px !important;
  }
}

/* 43.8 Review step cards — full width on mobile */
@media (max-width: 768px) {
  #book .grid.sm\:grid-cols-2 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  /* Fields — proper mobile sizing */
  #book .grid.sm\:grid-cols-2 > div {
    width: 100% !important;
  }
  .field {
    min-height: 48px !important;
    font-size: 16px !important;
  }
  /* Upload area — mobile friendly */
  #book label.flex.items-center.justify-between {
    padding: 14px !important;
  }
  #book label.flex.items-center.justify-between span {
    font-size: 12px !important;
  }
}

/* 43.9 Hide Doctors on Duty widget while in booking section on mobile
   to prevent overlap with form chips and Continue button */
@media (max-width: 768px) {
  /* Move the widget lower and smaller so it doesn't overlap booking form */
  .doctors-duty-widget {
    bottom: 160px !important;
    right: 8px !important;
    width: 180px !important;
    max-width: calc(100vw - 16px) !important;
    z-index: 44 !important;
    opacity: 0.85;
  }
  .doctors-duty-widget #avail-card {
    font-size: 11px !important;
  }
}

/* 44. Booking calendar — keep the date grid intact on phones.
   Earlier responsive rules intentionally collapse booking grids to one
   column; the calendar must remain a fixed 7-column control. */
#book .calendar-picker {
  box-sizing: border-box !important;
  overflow: visible !important;
}

#book .calendar-picker .calendar-weekdays,
#book .calendar-picker .calendar-days {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  width: 100% !important;
}

#book .calendar-picker .calendar-days {
  gap: 4px !important;
}

#book .calendar-picker .calendar-weekdays > div,
#book .calendar-picker .cal-day,
#book .calendar-picker .cal-day.empty {
  min-width: 0 !important;
}

#book .calendar-picker .cal-day {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 100% !important;
  min-height: 38px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 12px !important;
  line-height: 1 !important;
  padding: 0 !important;
}

#book .calendar-picker .cal-nav-btn[disabled] {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

#book #time-slots {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

#book #time-slots .chip {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 42px !important;
  text-align: center !important;
}

@media (max-width: 768px) {
  #book .calendar-picker {
    width: 100% !important;
    max-width: 420px !important;
    margin-inline: auto !important;
    padding: 12px !important;
  }

  #book .calendar-picker .calendar-weekdays {
    gap: 4px !important;
    margin-bottom: 6px !important;
  }

  #book .calendar-picker .calendar-weekdays > div {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 10px !important;
    padding: 4px 0 !important;
  }

  #book .calendar-picker .cal-day {
    min-height: clamp(34px, 10.5vw, 46px) !important;
    font-size: 13px !important;
  }
}

@media (max-width: 360px) {
  #book .calendar-picker {
    padding: 10px !important;
  }

  #book .calendar-picker .calendar-days,
  #book .calendar-picker .calendar-weekdays {
    gap: 3px !important;
  }

  #book .calendar-picker .cal-day {
    min-height: 32px !important;
    border-radius: 10px !important;
    font-size: 12px !important;
  }
}

/* ============================================================
   REQUESTED SPACING FIX — header/marquee/hero stack
   Keeps the yellow marquee tight to the header and brings the
   hero "Welcome to Aadityaa Hospital" text closer to the blue ticker.
   NOTE: Default values are set in sections 2-3 above. This section
   only provides overrides for specific larger breakpoints.
   ============================================================ */

@media (max-width: 639px) {
  .marquee-sticky-bar {
    top: 84px !important;
  }
  .marquee-welcome-bar {
    top: 137px !important;
  }
  #hero {
    padding-top: 157px !important;
  }
}

@media (min-width: 640px) and (max-width: 767px) {
  #hero {
    padding-top: 40px !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .marquee-sticky-bar {
    top: 102px !important;
  }
  .marquee-welcome-bar {
    top: 155px !important;
  }
  #hero {
    padding-top: 60px !important;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .marquee-sticky-bar {
    top: 135px !important;
  }
  .marquee-welcome-bar {
    top: 189px !important;
  }
  #hero {
    padding-top: 100px !important;
  }
}

@media (min-width: 1280px) {
  .marquee-sticky-bar {
    top: 139px !important;
  }
  .marquee-welcome-bar {
    top: 194px !important;
  }
  #hero {
    padding-top: 100px !important;
  }
}
