/* ==========================================================================
   THE NXGEN - 100% BULLETPROOF RESPONSIVE STYLESHEET
   Supports all screen sizes: 320px, 360px, 375px, 390px, 414px, 768px, 1024px, 1440px+
   Zero horizontal overflow, touch-optimized UI, fluid typography
   ========================================================================== */

/* Global Anti-Overflow Container Protection */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  max-width: 100vw;
  overflow-x: hidden !important;
}

/* --------------------------------------------------------------------------
   Laptops & Desktops (1081px - 1366px)
   -------------------------------------------------------------------------- */
@media (max-width: 1280px) {
  .nav-menu {
    gap: 0.95rem;
  }
  .nav-link {
    font-size: 0.8125rem;
  }
  .hero-container {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
  }
  .hero-title {
    font-size: 3rem;
  }
}

/* --------------------------------------------------------------------------
   Tablets & Compact Laptops (max-width: 1080px)
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  :root {
    --nav-height: 70px;
  }

  section {
    padding: 4rem 0;
  }

  .nav-menu {
    display: none !important;
  }

  .btn-wa-nav {
    display: none !important;
  }

  .mobile-nav-toggle {
    display: flex !important;
  }

  /* Hero Section */
  .hero-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: left;
  }

  .hero-title {
    font-size: clamp(2.2rem, 5vw, 3rem);
  }

  .hero-visual-wrapper {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }

  .hero-main-img {
    height: 400px;
  }

  /* About Section */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .about-visual-col {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }

  .about-clinic-img {
    height: 380px;
  }

  /* Genetics 3D Section */
  .genetics-3d-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .canvas-3d-wrapper {
    height: 400px;
  }

  /* Services Grid */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  /* Milestone Explorer */
  .milestone-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Clinic Tour */
  .clinic-features-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Location Section */
  .location-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .map-embed-wrapper {
    min-height: 320px;
  }

  /* Booking Grid */
  .booking-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  /* Reviews Block */
  .reviews-header-block {
    flex-direction: column;
    align-items: flex-start;
  }

  .reviews-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-top-row {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

/* --------------------------------------------------------------------------
   Mobile Devices (max-width: 767px)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  *, *::before, *::after {
    box-sizing: border-box !important;
  }

  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    position: relative !important;
    padding-bottom: 68px; /* Safe space for bottom sticky action bar */
  }

  /* Global typography wrap protection on mobile */
  h1, h2, h3, h4, h5, h6, p, span, a, label, li, strong, div {
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    max-width: 100% !important;
  }

  .font-marathi {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    display: inline-block;
    max-width: 100% !important;
  }

  .container {
    padding-left: 1.15rem !important;
    padding-right: 1.15rem !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .container-fluid {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Prevent grid blowout on mobile */
  .about-grid, .hero-container, .genetics-3d-layout, .milestone-grid, .clinic-features-grid, .location-grid, .booking-grid, .footer-top-row {
    display: grid !important;
    grid-template-columns: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .about-visual-col, .about-content-col, .hero-content, .hero-visual-wrapper, .service-card, .review-card, .location-card, .map-container-card, .glass-form-card, .booking-direct-healthplix-card, .milestone-display-card {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .hero-spotlight, .hero-floating-element {
    display: none !important;
  }

  .top-status-bar {
    display: none !important;
  }

  .site-header {
    padding: 0.65rem 0;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .nav-container {
    padding: 0 1rem;
    gap: 0.75rem;
    justify-content: space-between;
  }

  .brand-logo {
    gap: 0.5rem;
  }

  .logo-icon-wrap {
    width: 36px;
    height: 36px;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .brand-marathi-tag {
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
  }

  .brand-subtitle {
    font-size: 0.68rem;
  }

  /* On mobile <=767px, hide duplicate navbar button in favor of clean hamburger + bottom sticky bar */
  .nav-actions .btn-primary-glow {
    display: none !important;
  }

  .mobile-nav-toggle {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    cursor: pointer;
  }

  .mobile-nav-toggle .bar {
    width: 22px;
    height: 2px;
    background: var(--text-white);
    border-radius: 2px;
  }

  /* Bottom Floating Action Bar */
  .mobile-sticky-action-bar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(7, 12, 24, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-glass);
    padding: 0.5rem 0.75rem;
    z-index: 100;
    justify-content: space-around;
    align-items: center;
  }

  .mobile-act-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
  }

  .mobile-act-btn i {
    font-size: 1.1rem;
  }

  .mobile-act-btn.btn-call { color: var(--emerald-400); }
  .mobile-act-btn.btn-wa { color: #25d366; }
  .mobile-act-btn.btn-map { color: var(--cyan-400); }
  .mobile-act-btn.btn-book-highlight {
    background: linear-gradient(135deg, #06b6d4, #0284c7);
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
  }

  /* Section Spacing */
  section {
    padding: 3rem 0;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .section-title {
    font-size: 1.65rem;
    line-height: 1.22;
  }

  .section-subtitle {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  /* Hero Section Mobile */
  .hero-section {
    padding: 2rem 0 3rem;
    min-height: auto;
  }

  .hero-title {
    font-size: clamp(1.75rem, 6.5vw, 2.2rem);
    line-height: 1.18;
    margin-bottom: 0.85rem;
  }

  .hero-description {
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 1.5rem;
  }

  .hero-badge-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    margin-bottom: 1rem;
  }

  .badge-pill {
    font-size: 0.72rem;
    padding: 0.3rem 0.65rem;
    white-space: normal;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    gap: 0.65rem;
    margin-bottom: 1.75rem;
  }

  .btn-hero-primary, .btn-hero-secondary, .btn-whatsapp-pill {
    width: 100%;
    justify-content: center;
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    border-radius: var(--radius-full);
  }

  .hero-proof-bar {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding-top: 1.25rem;
  }

  .proof-item {
    gap: 0.6rem;
  }

  .proof-icon {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .proof-info strong {
    font-size: 0.78rem;
  }

  .proof-info span {
    font-size: 0.7rem;
  }

  /* Hero Visual & Floating Cards (Contained without screen overflow) */
  .hero-visual-wrapper {
    max-width: 100%;
    margin-top: 1rem;
    position: relative;
  }

  .hero-image-card {
    max-width: 100%;
    position: relative;
  }

  .hero-main-img {
    height: 300px;
    width: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
  }

  .floating-stat-card {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    border-radius: var(--radius-md);
  }

  .card-stat-top {
    left: 8px;
    top: 8px;
  }

  .card-stat-bottom {
    right: 8px;
    bottom: 8px;
  }

  .stat-icon-wrap {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }

  .stat-number {
    font-size: 0.85rem;
  }

  .stat-label {
    font-size: 0.65rem;
  }

  .floating-chip-live {
    position: static;
    transform: none;
    margin-top: 0.75rem;
    width: 100%;
    justify-content: center;
    font-size: 0.7rem;
    padding: 0.35rem 0.65rem;
  }

  /* About Doctor Mobile */
  .about-img-frame {
    border-radius: var(--radius-lg);
  }

  .about-clinic-img {
    height: 260px;
  }

  .about-badge-overlay {
    bottom: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    padding: 0.65rem 0.85rem;
    gap: 0.65rem;
  }

  .badge-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .about-float-card {
    position: static;
    margin-top: 0.85rem;
    max-width: 100%;
    padding: 0.85rem 1rem;
  }

  .about-lead {
    font-size: 0.95rem;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .about-body {
    font-size: 0.825rem;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .philosophy-tabs-container {
    padding: 0.85rem 0.75rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  .tab-buttons {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tab-buttons::-webkit-scrollbar {
    display: none;
  }

  .philo-tab-btn {
    padding: 0.4rem 0.65rem;
    font-size: 0.725rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .doctor-stats-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.35rem !important;
    padding-top: 1rem;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .doc-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .doc-stat-num {
    font-size: 1.25rem;
  }

  .doc-stat-lbl {
    font-size: 0.62rem;
    line-height: 1.2;
    text-align: center;
  }

  /* Services Grid Mobile */
  .service-pill-nav {
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .service-nav-btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .service-card {
    padding: 1.35rem 1.15rem;
    border-radius: var(--radius-lg);
  }

  .service-badge {
    top: 1.35rem;
    right: 1.15rem;
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
  }

  .service-icon-box {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }

  .service-card-title {
    font-size: 1.15rem;
    margin-bottom: 0.65rem;
  }

  .service-card-desc {
    font-size: 0.825rem;
    margin-bottom: 1rem;
  }

  /* 3D Genome Hub Mobile */
  .canvas-3d-wrapper {
    height: 320px;
    border-radius: var(--radius-lg);
  }

  .canvas-control-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr) auto;
    padding: 0.35rem;
    gap: 0.3rem;
  }

  .canvas-btn {
    font-size: 0.68rem;
    padding: 0.35rem 0.4rem;
    white-space: nowrap;
  }

  /* Milestone Explorer Mobile */
  .age-timeline-slider {
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .age-btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .milestone-display-card {
    padding: 1.35rem 1rem;
    border-radius: var(--radius-lg);
  }

  .col-title-wrap {
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }

  .milestone-list li {
    font-size: 0.825rem;
    gap: 0.5rem;
  }

  .milestone-action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .milestone-action-bar button {
    width: 100%;
    justify-content: center;
  }

  /* Clinic Tour Mobile */
  .clinic-feature-img {
    height: 240px;
  }

  .amenity-card {
    padding: 1rem;
    gap: 0.85rem;
  }

  .amenity-icon {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .amenity-title {
    font-size: 0.95rem;
  }

  .amenity-desc {
    font-size: 0.78rem;
  }

  /* Reviews Section Mobile */
  .rating-summary-box {
    width: 100%;
    padding: 1rem;
    gap: 1rem;
  }

  .big-rating {
    font-size: 2.4rem;
  }

  .review-tag-filters {
    gap: 0.4rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.4rem;
    -webkit-overflow-scrolling: touch;
  }

  .review-filter-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.72rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .reviews-grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .review-card {
    padding: 1.15rem;
    border-radius: var(--radius-lg);
  }

  .reviewer-avatar {
    width: 38px;
    height: 38px;
    font-size: 0.85rem;
  }

  .reviewer-name {
    font-size: 0.88rem;
  }

  .review-text {
    font-size: 0.825rem;
  }

  .reviews-cta-banner {
    padding: 1.35rem 1.15rem;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 1rem;
  }

  .banner-left h3 {
    font-size: 1.15rem;
  }

  .banner-left p {
    font-size: 0.8rem;
  }

  .btn-google-review {
    width: 100%;
    justify-content: center;
  }

  /* Booking & Forms Mobile */
  .booking-direct-healthplix-card {
    padding: 1.15rem;
    border-radius: var(--radius-lg);
  }

  .glass-form-card {
    padding: 1.35rem 1.15rem;
    border-radius: var(--radius-lg);
  }

  .form-row-2 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .type-selector-grid {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .type-box {
    padding: 0.55rem 0.75rem;
    font-size: 0.75rem;
  }

  /* Location Section Mobile */
  .location-card {
    padding: 1.35rem 1.15rem;
    border-radius: var(--radius-lg);
  }

  .location-address {
    font-size: 0.85rem;
  }

  .plus-code-box {
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
  }

  .hours-schedule-box {
    padding: 1rem 0.85rem;
  }

  .hours-table {
    gap: 0.3rem;
  }

  .hour-row {
    font-size: 0.725rem;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.35rem 0.45rem;
  }

  .location-btns-row {
    flex-direction: column;
    gap: 0.65rem;
  }

  .btn-directions, .btn-call-clinic {
    width: 100%;
    justify-content: center;
  }

  .map-container-card {
    border-radius: var(--radius-lg);
  }

  .map-embed-wrapper {
    min-height: 260px;
  }

  .map-landmarks-overlay {
    position: static;
    margin-top: 0.75rem;
    border-radius: var(--radius-md);
  }

  /* FAQs Mobile */
  .faq-question {
    padding: 0.95rem 1.15rem;
    font-size: 0.92rem;
  }

  .faq-answer {
    padding: 0 1.15rem 0.95rem;
    font-size: 0.825rem;
  }

  /* Footer Mobile */
  .site-footer {
    padding: 3rem 0 2rem;
  }

  .footer-top-row {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    margin-bottom: 2rem;
  }

  .footer-bottom-row {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding-top: 1.5rem;
  }

  /* Modal Popup Mobile */
  .modal-overlay {
    padding: 0.75rem;
  }

  .modal-dialog {
    padding: 1.35rem 1.15rem;
    border-radius: var(--radius-lg);
    max-height: 88vh;
    overflow-y: auto;
  }

  .modal-title {
    font-size: 1.1rem;
  }

  .modal-options-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
}

/* --------------------------------------------------------------------------
   Small Screen Handsets (max-width: 360px)
   -------------------------------------------------------------------------- */
@media (max-width: 360px) {
  .hero-title {
    font-size: 1.55rem;
  }

  .brand-title {
    font-size: 1rem;
  }

  .brand-marathi-tag {
    font-size: 0.65rem;
    padding: 0.08rem 0.3rem;
  }

  .brand-subtitle {
    font-size: 0.65rem;
  }

  .doctor-stats-row {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    text-align: center;
  }

  .doc-stat {
    align-items: center;
  }
}
