﻿/* =========================================
   Niraaya Hospital-Mobile-only overrides
   Load LAST on every page. Desktop unchanged.
   ========================================= */

@media (max-width: 900px) {
  html,
  body {
    /* clip keeps sticky scroll sections working (hidden breaks sticky) */
    overflow-x: clip !important;
    max-width: 100%;
  }

  .container,
  .ent-container,
  .c-banner,
  .c-body-inner,
  .c-map,
  .c-cta,
  .c-nav,
  .page-ent .ent-nav-inner {
    width: min(100% - 1.5rem, 1200px) !important;
    max-width: 100%;
  }

  img,
  video,
  iframe {
    max-width: 100%;
  }

  /* ----- Sticky navbar (all pages, mobile) ----- */
  .header,
  .page-ent .ent-header,
  .page-gallery .header,
  .page-doctors .header,
  .page-services .header,
  .page-contact .header,
  .page-blogs .header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    border-bottom: 1px solid rgba(20, 40, 63, 0.08);
    box-shadow: 0 2px 14px rgba(18, 40, 63, 0.08);
    backdrop-filter: blur(12px);
    padding: 0.35rem 0 !important;
  }

  .header.is-stuck,
  .page-ent .ent-header.is-stuck {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 4px 18px rgba(18, 40, 63, 0.1);
  }

  .header .logo-light {
    display: none !important;
  }

  .header .logo-dark {
    display: block !important;
  }

  .header .nav-link,
  .header .dropdown-btn {
    color: #14283f !important;
  }

  .menu-btn span,
  .header .menu-btn span,
  .header.is-stuck .menu-btn span {
    background: #111 !important;
  }

  .hero-nav-inner,
  .header.is-stuck .hero-nav-inner,
  .c-nav,
  .ent-nav-inner {
    min-height: 56px !important;
    padding-top: 0.35rem !important;
    padding-bottom: 0.35rem !important;
    width: min(100% - 1.25rem, 1200px) !important;
    margin-inline: auto;
  }

  .logo-img {
    height: 44px !important;
  }

  /* Space under fixed navbar-stacked mobile hero */
  .hero {
    padding: 4.25rem 0 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: clip !important;
    box-sizing: border-box !important;
    background: #fff !important;
  }

  .hero-shell {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .page-contact .c-hero,
  .page-blogs .c-hero,
  .page-gallery .c-hero,
  .page-services .c-hero,
  .page-doctors .doctors-hero,
  .page-doctors .c-hero,
  .ent-hero,
  .service-detail {
    padding-top: 4.75rem !important;
  }

  .nav {
    position: fixed !important;
    top: 56px !important;
    left: 0;
    right: 0;
    z-index: 1001 !important;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.15rem 1.35rem;
    gap: 0.65rem;
    display: none;
    max-height: calc(100dvh - 56px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
  }

  .nav.open {
    display: flex !important;
  }

  body.nav-open {
    overflow: hidden;
  }

  /* ----- Shared nav ----- */
  .menu-btn {
    display: flex !important;
  }

  .nav-link,
  .dropdown-btn,
  .header .nav-link {
    color: #111 !important;
    min-height: 44px;
    width: 100%;
    justify-content: space-between;
  }

  .nav .btn-hero-nav,
  .nav .btn.btn-hero-nav {
    width: 100%;
    justify-content: center;
  }

  .dropdown-menu {
    position: static !important;
    transform: none !important;
    left: auto !important;
    min-width: 0 !important;
    width: 100% !important;
    box-shadow: none;
    border: none;
    background: transparent;
    display: none;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    margin: 0.25rem 0 0;
    padding: 0;
    gap: 0.35rem;
  }

  .nav-dropdown {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.15rem;
  }

  .nav-dropdown .dropdown-btn {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    justify-content: flex-start;
  }

  /* Hide leftover chevron inside the link if present */
  .nav-dropdown .dropdown-btn .nav-chevron {
    display: none !important;
  }

  .nav-dropdown-toggle {
    flex: 0 0 auto;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0.65rem;
    background: #f0f4f9;
    color: #14283f;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-dropdown-toggle:active {
    background: #e4ebf4;
  }

  .nav-dropdown-toggle .nav-chevron {
    display: block !important;
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    pointer-events: none;
  }

  .nav-dropdown.open .nav-dropdown-toggle .nav-chevron,
  .nav-dropdown.is-open .nav-dropdown-toggle .nav-chevron {
    transform: rotate(180deg);
  }

  .nav-dropdown.open .dropdown-menu,
  .nav-dropdown.is-open .dropdown-menu,
  .nav-dropdown.open:hover .dropdown-menu,
  .nav-dropdown.is-open:hover .dropdown-menu,
  .nav-dropdown.open:focus-within .dropdown-menu,
  .nav-dropdown.is-open:focus-within .dropdown-menu {
    display: grid !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    position: static !important;
    transform: none !important;
  }

  .nav-dropdown .dropdown-menu {
    flex: 1 1 100%;
  }

  .dropdown-item {
    width: 100%;
    box-sizing: border-box;
    background: #f4f7fb;
    border-radius: 0.75rem;
  }

  .menu-btn span {
    background: #111 !important;
  }

  /* ----- Home hero: image on top, content below ----- */
  .hero {
    padding-top: 4.25rem !important;
    background: #fff !important;
  }

  .hero-shell {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    border-radius: 0 !important;
    justify-content: flex-start !important;
    background: #fff !important;
  }

  .hero-shell::after {
    display: none !important;
  }

  .hero-slider {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .hero-slide {
    position: relative !important;
    inset: auto !important;
    display: none !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .hero-slide.is-active {
    display: flex !important;
  }

  .hero-bg,
  .hero-slide[data-slide="0"] .hero-bg,
  .hero-slide[data-slide="1"] .hero-bg {
    position: relative !important;
    inset: auto !important;
    order: unset !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: min(52vh, 26rem) !important;
    min-height: 14rem !important;
    aspect-ratio: 4 / 3 !important;
    object-fit: cover !important;
    object-position: center top !important;
    transform: none !important;
    display: block !important;
    border-radius: 0 !important;
    background: #d7dde5;
  }

  .hero-bg-picture {
    position: relative !important;
    inset: auto !important;
    order: 2 !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
  }

  .hero-bg-picture .hero-bg {
    position: relative !important;
    inset: auto !important;
  }

  .hero-overlay {
    display: none !important;
  }

  .hero-content {
    position: relative !important;
    z-index: 1 !important;
    order: 1 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 1.35rem 1.15rem 1.75rem !important;
    background: #fff !important;
    text-align: center !important;
    display: flex;
    flex-direction: column;
    align-items: center !important;
    box-sizing: border-box !important;
    overflow: hidden;
  }

  .hero-brand {
    margin-inline: auto;
    color: #14283f !important;
    font-size: clamp(1.85rem, 9vw, 2.5rem) !important;
    text-align: center !important;
  }

  .hero h1 {
    color: #14283f !important;
    font-size: clamp(1.1rem, 4.8vw, 1.4rem) !important;
    max-width: 100% !important;
    padding-inline: 0;
    overflow-wrap: anywhere;
    text-align: center !important;
  }

  .hero .hero-lead,
  .hero-content > p:not(.hero-brand) {
    color: #5b6b7f !important;
    font-size: 0.92rem !important;
    max-width: 22rem !important;
    margin-inline: auto !important;
    margin-bottom: 1.15rem !important;
    text-align: center !important;
    padding-inline: 0;
  }

  .hero-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 0.65rem !important;
    margin-inline: auto !important;
  }

  .hero-actions .btn {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    padding-left: 1.15rem !important;
    padding-right: 0.65rem !important;
  }

  .hero-dots {
    display: none !important;
  }

  /* ----- Generic grids / sections ----- */
  .about-grid,
  .freezing-grid,
  .contact-form-wrap,
  .contact-main-grid,
  .contact-visit-grid,
  .symptoms-grid,
  .care-grid,
  .doctors-preview-grid,
  .blog-grid,
  .blog-cta-wrap,
  .clinic-info-layout,
  .clinic-info-grid {
    grid-template-columns: 1fr !important;
  }

  .about-grid,
  .freezing-grid {
    max-height: none !important;
  }

  .about-image,
  .page-doctors .about-image {
    max-width: 20rem;
    width: 100%;
    margin-inline: auto;
  }

  .about-image-frame img {
    min-height: 0 !important;
    max-height: none !important;
  }

  .section {
    padding: 3rem 0 !important;
  }

  .btn,
  .c-btn,
  .ent-btn,
  .btn-cta,
  .btn-about,
  .pkg-card-btn {
    max-width: 100%;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr !important;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  /* ----- About / doctors ----- */
  .page-doctors .doctors-hero {
    padding: 5.25rem 0 1.5rem !important;
    overflow: hidden;
  }

  .doctors-hero-grid {
    grid-template-columns: 1fr !important;
    gap: 1.35rem !important;
  }

  .doctors-hero-visual {
    order: -1;
    position: relative !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
    min-height: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden;
    align-items: end;
    justify-items: center;
  }

  .doctors-hero-card {
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: min(100%, 10.5rem) !important;
  }

  .doctors-hero-badge {
    position: static !important;
    transform: none !important;
    grid-column: 1 / -1;
    margin: 0.25rem auto 0;
    width: auto !important;
    height: auto !important;
    min-width: 4.25rem;
    min-height: 4.25rem;
  }

  .doctors-trust-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .page-doctors .doctor-actions,
  .page-doctors .doctor-contact,
  .page-doctors .c-hero-cta {
    flex-direction: column !important;
  }

  .page-doctors .doctor-actions .btn,
  .page-doctors .doctor-contact-pill,
  .page-doctors .c-hero-cta .c-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .page-doctors .doctor-stats,
  .page-doctors .about-highlights {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  /* ----- Services listing ----- */
  .page-services .c-hero {
    padding: 5.5rem 0 1.25rem !important;
  }

  .page-services .c-hero-cta,
  .c-hero-cta {
    flex-direction: column !important;
    width: 100% !important;
  }

  .page-services .c-hero-cta .c-btn,
  .c-hero-cta .c-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .services-page {
    padding: 1.75rem 0 3rem !important;
  }

  .services-grid,
  .services-grid--points {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .page-services .svc-card .pkg-card-image,
  .services-grid--points .svc-card .pkg-card-image {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 16 / 10;
    object-fit: cover;
  }

  .page-services .svc-card .pkg-card-footer,
  .page-services .svc-card .pkg-card-btn {
    width: 100% !important;
  }

  .page-services .svc-card .pkg-card-btn {
    justify-content: center !important;
  }

  .service-detail {
    padding: 5.5rem 0 2.75rem !important;
  }

  .sub-services-grid {
    grid-template-columns: 1fr !important;
  }

  /* ----- ENT / surgery detail pages ----- */
  .ent-hero__grid,
  .ent-overview__grid,
  .ent-condition-layout,
  .ent-why__grid,
  .ent-doctor__grid,
  .ent-cta__grid,
  .ent-related__grid,
  .ent-timeline,
  .ent-hero__trust,
  .ent-cta__meta,
  .ent-service-pills {
    grid-template-columns: 1fr !important;
  }

  .ent-hero {
    padding: 5.25rem 0 1.75rem !important;
  }

  .ent-hero h1 {
    max-width: none !important;
    font-size: clamp(1.55rem, 7vw, 2.15rem) !important;
  }

  .ent-hero__lead {
    max-width: none !important;
    font-size: 0.95rem !important;
  }

  .ent-hero__media {
    order: -1 !important;
    width: 100% !important;
    max-width: 20rem !important;
    margin: 0 auto 0.75rem !important;
  }

  .ent-hero__frame {
    max-height: 20rem !important;
    width: 100% !important;
    max-width: 18rem !important;
    margin-inline: auto;
  }

  .ent-hero__float {
    display: none !important;
  }

  .ent-hero__cta,
  .ent-doctor__actions,
  .ent-cta__actions,
  .ent-warning__cta {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .ent-hero__cta .ent-btn,
  .ent-hero__cta .ent-text-link,
  .ent-doctor__actions .ent-btn,
  .ent-cta__actions .ent-btn,
  .ent-warning__cta .ent-btn {
    width: 100% !important;
    justify-content: center !important;
    text-align: center;
  }

  .ent-condition-nav {
    position: static !important;
    display: flex !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.35rem;
  }

  .ent-condition-side {
    position: static !important;
    min-width: 0;
    max-width: 100%;
  }

  .ent-condition-nav__btn {
    min-width: 9.5rem;
  }

  .ent-section {
    padding: 3rem 0 !important;
  }

  .ent-why__media,
  .ent-doctor__media {
    max-width: 18rem;
    width: 100%;
    margin-inline: auto;
  }

  .ent-anchor {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ----- Contact / gallery / blogs ----- */
  .c-body-inner {
    grid-template-columns: 1fr !important;
  }

  .c-map-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .c-form-grid,
  .contact-form-row {
    grid-template-columns: 1fr !important;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.65rem !important;
  }

  .contact-quick-panel {
    grid-template-columns: 1fr 1fr !important;
  }

  .c-cta .c-cta-inner,
  .c-cta-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100%;
  }

  .c-cta .c-cta-actions .c-btn,
  .c-cta-actions .c-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* ----- Home packages / risks / screening ----- */
  .risks-grid,
  .screening-grid {
    grid-template-columns: 1fr !important;
  }

  .packages-top {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .pkg-card {
    flex-basis: min(82vw, 280px) !important;
  }

  /* How it works - sticky pin, scroll drives horizontal slide */
  .works {
    height: 300vh !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .works-pin {
    position: sticky !important;
    top: 0 !important;
    height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    padding: 4.5rem 0 1.25rem !important;
  }

  .works-track {
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    padding: 1.25rem 0 1.75rem !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    touch-action: pan-y !important;
  }

  .works-row {
    display: flex !important;
    flex-direction: row !important;
    width: max-content !important;
    height: min(540px, 62svh) !important;
    gap: 0.95rem !important;
    padding-left: 1rem !important;
    padding-right: 3rem !important;
    will-change: transform !important;
  }

  .h-col,
  .h-col--tall,
  .h-col--fan,
  .h-col--pair,
  .h-col--stagger-top,
  .h-col--stagger-bottom {
    width: min(250px, 72vw) !important;
    max-width: min(250px, 72vw) !important;
    height: 100% !important;
    display: grid !important;
    grid-template-rows: minmax(min-content, 1.2fr) minmax(0, 0.8fr) !important;
    flex-shrink: 0 !important;
  }

  .h-col--rich {
    grid-template-rows: minmax(min-content, 1.65fr) minmax(0, 0.35fr) !important;
  }

  .h-col--tall,
  .h-col--fan {
    grid-template-rows: 1fr !important;
    width: min(270px, 78vw) !important;
    max-width: min(270px, 78vw) !important;
  }

  .h-col--stagger-top {
    transform: translateY(-0.55rem) !important;
  }

  .h-col--stagger-bottom {
    transform: translateY(0.55rem) !important;
  }

  .work-spacer {
    display: block !important;
  }

  .work-fan {
    display: block !important;
    height: 140px !important;
    flex: 0 0 140px !important;
  }

  .work-card,
  .work-card--fan {
    height: auto !important;
    min-height: 100% !important;
  }

  .work-photo-card {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
  }

  .work-photo-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
  /* Care journey (home) */
  .care-journey-panel {
    height: auto !important;
    min-height: min(78dvh, 560px);
    border-radius: 1.35rem !important;
    padding: 1.25rem 1rem 0 !important;
  }

  .care-journey-header {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .care-journey-lead {
    text-align: left !important;
  }
}

@media (max-width: 640px) {
  .ent-mobile-cta {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.4rem;
  }

  .ent-mobile-cta__btn--book {
    grid-column: 1 / -1;
  }

  .ent-mobile-cta__btn {
    min-height: 2.5rem;
    font-size: 0.82rem;
  }

  .page-ent main {
    padding-bottom: 5.25rem !important;
  }

  .doctors-jump {
    grid-template-columns: 1fr !important;
  }

  .gallery-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 560px) {
  .container,
  .ent-container,
  .c-banner,
  .c-body-inner,
  .c-map,
  .c-cta,
  .c-nav {
    width: min(100% - 1.25rem, 1200px) !important;
  }

  .logo-img {
    height: 44px !important;
  }

  .hero-nav-inner {
    min-height: 56px;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .nav {
    top: 56px;
    max-height: calc(100dvh - 56px);
  }

  .hero-bg,
  .hero-slide[data-slide="0"] .hero-bg,
  .hero-slide[data-slide="1"] .hero-bg {
    height: auto !important;
    max-height: min(48vh, 22rem) !important;
    min-height: 12.5rem !important;
    aspect-ratio: 4 / 3 !important;
    object-position: center top !important;
    border-radius: 0 !important;
  }

  .hero-content {
    padding: 1.2rem 1rem 1.5rem !important;
    text-align: center !important;
    background: #fff !important;
  }

  .hero-brand {
    font-size: clamp(1.75rem, 9vw, 2.25rem) !important;
  }

  .hero h1 {
    font-size: clamp(1.05rem, 4.6vw, 1.3rem) !important;
  }

  .footer-top {
    grid-template-columns: 1fr !important;
  }

  .contact-quick-panel,
  .doctors-trust-inner {
    grid-template-columns: 1fr 1fr !important;
  }

  .stats,
  .care-grid {
    grid-template-columns: 1fr !important;
  }

  .page-doctors .about-image {
    max-width: 16.5rem;
  }

  .doctors-hero-card {
    width: min(100%, 9.25rem) !important;
  }

  .services-page {
    padding: 1.35rem 0 2.5rem !important;
  }

  .service-detail {
    padding: 5rem 0 2.5rem !important;
  }

  .ent-hero {
    padding-top: 4.75rem !important;
  }

  .modal-media {
    display: none !important;
  }

  .modal-box {
    grid-template-columns: 1fr !important;
    max-height: 92vh;
  }
}
