/* 
 * Premium Gynecologist Clinic - Responsive CSS 
 */

/* ==========================================================================
   Desktop vs Mobile Hero Display Controls
   ========================================================================== */
@media (min-width: 992px) {
  .mobile-only-hero,
  #mobileHeroSection,
  section.mobile-hero-section {
    display: none !important;
  }
  .desktop-only-hero,
  #heroSliderSection,
  section.hero-slider-section {
    display: flex !important;
  }
}

@media (max-width: 991px) {
  .desktop-only-hero,
  #heroSliderSection,
  section.hero-slider-section {
    display: none !important;
  }
  .mobile-only-hero,
  #mobileHeroSection,
  section.mobile-hero-section {
    display: block !important;
  }
  .quick-appointment {
    margin-top: 0 !important;
  }
}

/* ==========================================================================
   1200px and below
   ========================================================================== */
@media (max-width: 1200px) {
  .hero-title {
    font-size: 2.8rem;
  }
  
  .main-nav .nav-list {
    gap: 12px;
  }
  
  .nav-link {
    font-size: 0.88rem;
  }

  .header-cta {
    padding: 8px 14px;
    font-size: 0.82rem;
  }
  
  .about-section .container,
  .hero .container {
    gap: 30px;
  }
}

/* ==========================================================================
   1024px and below (Tablets & Small Desktops)
   ========================================================================== */
@media (max-width: 1024px) {
  /* Header & Nav Drawer */
  .main-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 340px;
    height: 100vh;
    height: 100dvh;
    background: var(--white);
    box-shadow: 8px 0 35px rgba(0, 0, 0, 0.25);
    z-index: 1050;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
  }
  
  .main-nav.open {
    left: 0;
  }

  /* Drawer Header */
  .mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
    flex-shrink: 0;
    width: 100%;
  }

  .mobile-nav-brand {
    display: flex;
    align-items: center;
    max-width: calc(100% - 46px);
  }

  .mobile-nav-logo {
    height: 38px;
    width: auto;
    max-width: 170px;
    object-fit: contain;
    display: block;
  }

  .mobile-nav-close {
    background: rgba(155, 77, 104, 0.1);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
  }

  .mobile-nav-close:hover {
    background: var(--primary);
    color: var(--white);
  }

  /* Drawer Scrollable Nav List */
  .main-nav .nav-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 12px 14px;
    margin: 0;
    width: 100%;
  }

  .main-nav .nav-list li {
    width: 100%;
  }
  
  .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--dark);
    border-bottom: none;
    transition: all 0.2s ease;
  }

  .nav-link::after {
    display: none;
  }
  
  .nav-link:hover,
  .nav-link.active {
    background: rgba(155, 77, 104, 0.08);
    color: var(--primary);
    font-weight: 600;
  }

  .has-dropdown > .nav-link i {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
  }

  .has-dropdown.active > .nav-link i {
    transform: rotate(180deg);
  }
  
  .dropdown-menu {
    position: static;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    padding: 4px 0 4px 10px;
    border-left: 2px solid var(--primary);
    background: rgba(155, 77, 104, 0.04);
    border-radius: 0 10px 10px 0;
    margin: 4px 0 6px 12px;
    width: calc(100% - 20px);
  }
  
  .has-dropdown.active .dropdown-menu {
    display: block;
  }

  .dropdown-menu li a {
    padding: 9px 14px;
    font-size: 0.9rem;
    color: #555;
    border-radius: 6px;
    display: block;
  }

  .dropdown-menu li a:hover {
    color: var(--primary);
    background: rgba(155, 77, 104, 0.08);
  }

  /* Drawer Footer */
  .mobile-nav-footer {
    display: block;
    padding: 14px 16px 18px;
    border-top: 1px solid var(--border);
    background: #faf6f8;
    flex-shrink: 0;
  }

  .mobile-nav-footer .btn-block {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 11px 16px;
    font-size: 0.92rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(155, 77, 104, 0.2);
  }

  .mobile-nav-contact {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .mobile-nav-contact a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 0.82rem;
    text-decoration: none;
    transition: color 0.2s ease;
  }

  .mobile-nav-contact a i {
    color: var(--primary);
    font-size: 0.9rem;
    width: 16px;
  }

  .mobile-nav-contact a:hover {
    color: var(--primary);
  }
  
  .mobile-toggle {
    display: block;
    z-index: 1001;
    transition: opacity 0.2s ease;
  }
  
  /* Hide the outer hamburger toggle when drawer is open so there is only one close button */
  .mobile-toggle.open {
    opacity: 0;
    pointer-events: none;
  }

  .mobile-overlay {
    z-index: 1040;
  }

  .mobile-bottom-nav {
    z-index: 990;
  }
  
  .header-cta {
    display: none;
  }

  .site-header {
    padding: 10px 0;
  }

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

  /* Dedicated Mobile Hero Section Responsive Overrides */
  .mobile-hero-section {
    padding: 16px 12px 24px;
  }

  .hero-nav-btn {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }
  .hero-nav-prev { left: 10px; }
  .hero-nav-next { right: 10px; }
  
  .appointment-form {
    grid-template-columns: 1fr 1fr;
  }
  
  .about-section .container {
    grid-template-columns: 1fr;
  }
  
  .about-image-wrap {
    max-width: 600px;
    margin: 0 auto 40px;
  }
  
  .services-grid,
  .pregnancy-grid,
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .why-choose-us-grid,
  .why-grid {
    grid-template-columns: 1fr;
  }
  
  .why-image-col img,
  .why-choose-us-image img {
    min-height: 360px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Tablet Timeline 3x2 Grid */
  .timeline-items {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 16px;
    padding: 10px 0;
  }
  
  .timeline-items::before {
    display: none;
  }
  
  .timeline-card {
    min-height: auto;
    padding: 18px 14px;
  }
}

/* ==========================================================================
   768px and below (Mobile)
   ========================================================================== */
@media (max-width: 768px) {
  .top-bar {
    display: none;
  }
  
  .site-header {
    padding: 4px 0;
  }

  .site-logo-img {
    max-height: 42px;
  }

  .mobile-hero-section {
    padding: 4px 10px 18px;
  }

  .hero-specialties-chips {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 6px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .hero-specialties-chips::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.78rem;
    padding: 5px 12px;
  }

  .appointment-form {
    grid-template-columns: 1fr;
  }
  
  .services-grid,
  .pregnancy-grid,
  .blog-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .qualification-cards {
    grid-template-columns: 1fr;
  }
  
  .footer-bottom .container {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .about-section {
    padding: 1.75rem 0 0.5rem !important;
  }

  .services-section {
    padding: 0.75rem 0 0.5rem !important;
  }

  .why-choose-us-section {
    padding: 1rem 0 1.75rem !important;
  }

  .why-choose-us-grid {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
  }

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

  .service-detail-row {
    flex-direction: column !important;
    gap: 25px !important;
  }
  
  /* Mobile Bottom Nav */
  .mobile-bottom-nav {
    display: flex;
  }
  
  .float-call {
    display: none; /* Handled by bottom nav */
  }
  
  .float-whatsapp {
    bottom: 80px; /* Above bottom nav */
  }
  
  .back-to-top {
    bottom: 80px; /* Above bottom nav */
  }
  
  /* Mobile Timeline (Vertical Connected Roadmap) */
  .timeline-wrapper {
    position: relative;
    padding: 0 5px;
  }

  .timeline-items {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 10px 0;
    position: relative;
  }

  .timeline-items::before {
    content: '';
    position: absolute;
    top: 25px;
    bottom: 25px;
    left: 23px;
    right: auto;
    width: 3px;
    height: auto;
    background: linear-gradient(180deg, rgba(155, 77, 104, 0.3) 0%, var(--primary) 50%, rgba(155, 77, 104, 0.3) 100%);
    z-index: 1;
    display: block !important;
  }

  .timeline-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 15px;
    width: 100%;
  }

  .timeline-dot {
    width: 48px;
    height: 48px;
    font-size: 1.15rem;
    margin-bottom: 0;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
  }

  .timeline-card {
    align-items: flex-start;
    text-align: left;
    min-height: auto;
    padding: 16px 18px;
    flex: 1;
  }

  .timeline-stage-tag {
    margin-bottom: 6px;
  }
  
  body {
    padding-bottom: 65px; /* Space for bottom nav */
  }
}

/* ==========================================================================
   576px and below (Small Mobile)
   ========================================================================== */
@media (max-width: 576px) {
  .container {
    padding: 0 16px;
  }

  .site-header {
    padding: 6px 0;
  }

  .site-logo-img {
    max-height: 40px;
  }

  .m-doctor-image-frame {
    height: 250px;
    border-radius: 18px;
  }

  .m-photo-name-row h3 {
    font-size: 1.12rem;
  }

  .m-photo-sub {
    font-size: 0.76rem;
  }

  .m-photo-badge {
    padding: 4px 10px;
    font-size: 0.72rem;
  }

  .hero-slide {
    padding: 12px 0 24px;
  }

  .hero-image-wrap {
    max-width: 320px;
    margin: 8px auto 0;
  }

  .hero-image-container {
    border-radius: 16px;
    aspect-ratio: 4/3;
    max-height: 230px;
  }

  .hero-doctor-profile-bar {
    padding: 6px 12px 6px 8px;
    gap: 10px;
    margin-bottom: 10px;
  }

  .doctor-avatar-wrap {
    width: 38px;
    height: 38px;
  }

  .doctor-name-title strong {
    font-size: 0.85rem;
  }

  .doctor-deg {
    font-size: 0.68rem;
  }

  .rating-count {
    display: none;
  }

  .hero-title {
    font-size: 1.6rem;
    line-height: 1.22;
  }

  .hero-subtitle,
  .hero-description {
    font-size: 0.86rem;
    line-height: 1.5;
    margin-bottom: 12px;
  }
  
  .hero-buttons {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }
  
  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
    padding: 12px 18px;
    font-size: 0.92rem;
  }
  
  .hero-float-card {
    padding: 7px 11px;
    gap: 8px;
  .about-image-badge {
    width: 90px;
    height: 90px;
    padding: 12px;
    bottom: -10px;
    right: 0;
  }
  
  .about-image-badge span:first-child {
    font-size: 1.35rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .testimonial-card {
    padding: 25px 20px;
  }

  .testimonial-text {
    font-size: 0.92rem;
  }

  .site-logo-img {
    max-height: 42px;
  }

  h1, h2 {
    word-wrap: break-word;
  }
}

/* ==========================================================================
   380px and below (Extra Small Mobile)
   ========================================================================== */
@media (max-width: 380px) {
  .m-doctor-image-frame {
    height: 220px;
  }

  .m-hero-title {
    font-size: 1.5rem;
  }

  .btn {
    padding: 10px 18px;
    font-size: 0.9rem;
  }
}
