/* ==========================================================================
   RESPONSIVE STYLESHEET
   Supports: 1440px+, 1280px, 1024px, 768px, 480px, 320px
   ========================================================================== */

/* Laptops & Wide Tablets Navigation Tuning (Max 1380px) */
@media (max-width: 1380px) {
  .header-container {
    gap: 0.4rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .header-logo img {
    height: 38px;
  }

  .nav-list {
    gap: 0.2rem;
  }

  .nav-link {
    font-size: 0.8rem;
    padding: 0.32rem 0.42rem;
  }

  .nav-link::after {
    left: 0.42rem;
    right: 0.42rem;
  }

  .header-actions {
    margin-left: 0.4rem;
    gap: 0.4rem;
  }

  .header-actions .btn {
    font-size: 0.8rem;
    padding: 0.48rem 0.95rem;
    white-space: nowrap;
  }

  .grid-4,
  .why-us-grid,
  .process-grid,
  .credibility-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

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

  .hero-grid {
    gap: 2rem;
  }
}

/* Medium Tablets & Below (Max 1280px) */
@media (max-width: 1280px) {
  :root {
    --header-height: 72px;
  }

  .header-nav {
    display: none; /* Collapses cleanly to drawer before any crowding */
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  .header-actions .btn {
    display: inline-flex !important;
    font-size: 0.82rem;
    padding: 0.5rem 1rem;
    white-space: nowrap;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3.5rem;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
    margin: 0 auto;
  }

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

  .hero-trust-row {
    justify-content: center;
  }

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

  .floating-badge.badge-top {
    right: 0;
  }
  .floating-badge.badge-bottom {
    left: 0;
  }

  .about-grid,
  .about-grid-clean,
  .specialists-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .services-grid,
  .methods-four-grid,
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .location-grid {
    grid-template-columns: 1fr;
  }

  .top-bar-right .top-hours {
    display: none;
  }
}

/* Mobile Devices (Max 768px) */
@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }

  .section {
    padding-top: 3.75rem;
    padding-bottom: 3.75rem;
  }

  .section-sm {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  .top-bar {
    display: none; /* Cleaner mobile view */
  }

  /* Show floating bottom CTA bar on mobile */
  .mobile-bottom-bar {
    display: block;
  }

  /* Add padding to body so bottom bar doesn't overlay footer */
  body {
    padding-bottom: 72px;
  }

  .container,
  .hero-grid,
  .hero-content,
  .hero-visual,
  .grid-2,
  .grid-3,
  .grid-4 {
    min-width: 0;
    max-width: 100%;
  }

  .page-hero {
    padding: 2.25rem 0 2rem;
  }

  .page-hero h1,
  .hero-title,
  h1.page-title {
    font-size: clamp(1.65rem, 6.2vw, 2.15rem) !important;
    line-height: 1.25;
    word-break: break-word;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .services-grid,
  .methods-four-grid,
  .why-us-grid,
  .process-grid,
  .testimonials-grid,
  .credibility-grid,
  .case-studies-grid,
  .specialists-grid,
  .about-grid-clean,
  .location-grid,
  .cm-layout-grid {
    grid-template-columns: 1fr !important;
  }

  .methods-four-grid .service-card-media {
    height: 280px;
  }

  .ba-comparison-wrapper {
    height: 380px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .ba-case-info-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* Tables: scroll inside wrapper, never widen the page */
  .edu-table-responsive,
  .edu-comparison-table-wrapper,
  .table-responsive,
  .cm-spec-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .edu-table,
  .cm-spec-table {
    min-width: 560px;
  }

  .about-features-list,
  .about-features-grid {
    grid-template-columns: 1fr;
  }

  .about-float-badge.badge-top-right {
    right: 8px;
    top: 12px;
  }
  .about-float-badge.badge-bottom-left {
    left: 8px;
    bottom: 12px;
  }
  .about-image-wrapper img {
    height: 360px;
  }

  /* Hero floating badges — no negative offsets off-screen */
  .floating-badge {
    padding: 0.55rem 0.75rem;
    font-size: 0.75rem;
    gap: 0.55rem;
    max-width: calc(100% - 16px);
  }
  .floating-badge.badge-top {
    top: 12px;
    right: 8px;
    left: auto;
  }
  .floating-badge.badge-bottom {
    bottom: 12px;
    left: 8px;
    right: auto;
  }
  .badge-icon {
    width: 32px;
    height: 32px;
  }
  .badge-icon svg {
    width: 16px;
    height: 16px;
  }

  .hero-image-wrapper img {
    height: 280px;
  }

  .hero-visual {
    max-width: 100% !important;
  }

  .map-container,
  .map-container iframe,
  iframe {
    max-width: 100%;
  }
  .map-container iframe {
    width: 100% !important;
    height: 280px;
  }

  .cta-banner-content,
  .cta-banner-buttons {
    text-align: center;
  }
  .cta-banner-buttons {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .specialist-card .btn,
  .service-card-link,
  .btn {
    max-width: 100%;
  }

  .rating-social-badge {
    width: 100%;
    justify-content: center !important;
    border-radius: 16px !important;
    padding: 0.85rem 1rem !important;
  }

  /* Keep WhatsApp above bottom bar */
  .floating-wa-btn {
    bottom: 84px;
    right: 14px;
  }

  .cm-stat-pill-row {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Small Smartphone Devices (Max 480px) */
@media (max-width: 480px) {
  .container {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  /* Header: menu + logo first; keep consult compact */
  .header-actions .btn {
    display: inline-flex !important;
    padding: 0.42rem 0.7rem;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .header-logo img {
    height: 32px;
  }

  .mobile-menu-toggle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .hero-image-wrapper img {
    height: 240px;
  }

  .ba-comparison-wrapper {
    height: 280px;
  }

  .methods-four-grid .service-card-media {
    height: 220px;
  }

  .ba-handle-button {
    width: 40px;
    height: 40px;
  }
  .ba-handle-button svg {
    width: 18px;
    height: 18px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .cta-banner-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  .about-trust-cards {
    grid-template-columns: 1fr;
  }
  .about-standards-panel {
    padding: 1.5rem 1.25rem;
    border-radius: 18px;
  }
  .about-stats-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .about-stat-number {
    font-size: 1.3rem;
  }
  .about-stat-label {
    font-size: 0.68rem;
  }
  .about-actions {
    flex-direction: column;
    width: 100%;
  }
  .about-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .doctor-credentials-card {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    margin-top: 1rem;
  }

  .faq-question-btn {
    padding: 1.1rem 1.15rem;
    font-size: 0.95rem;
    min-height: 48px;
    text-align: left;
  }
  .faq-answer-inner {
    padding: 0 1.15rem 1.25rem 1.15rem;
  }

  .cm-stat-pill-row {
    grid-template-columns: 1fr !important;
  }

  .floating-badge .badge-text-sub {
    display: none;
  }

  .mobile-bottom-btn {
    min-height: 48px;
    font-size: 0.78rem;
  }
}

/* Extra-small phones (Max 360px) */
@media (max-width: 360px) {
  .container {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .header-actions .btn {
    padding: 0.38rem 0.55rem;
    font-size: 0.68rem;
  }

  .header-logo img {
    height: 28px;
  }

  .page-hero h1,
  .hero-title,
  h1.page-title {
    font-size: 1.45rem !important;
  }

  .mobile-bottom-btn span {
    font-size: 0.7rem;
  }

  .service-card,
  .testimonial-card,
  .faq-item {
    border-radius: 14px;
  }
}

/* Ensure media never overflows any viewport */
img,
video,
iframe,
svg {
  max-width: 100%;
  height: auto;
}

iframe {
  max-width: 100%;
}

/* Accessibility: Reduced 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;
  }
  .js-reveal-enabled .reveal-item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
