/* Responsive Breakpoints - Mobile Menu & Layouts */

/* Tablets & Smaller (max 992px) */
@media (max-width: 992px) {
  /* Hide utility bar on mobile to prioritize main content area */
  .top-bar {
    display: none; 
  }

  /* Set nav wrapper to relative so mobile menu drops down cleanly */
  .main-nav-wrapper {
    position: relative;
  }

  /* Keep container block visible */
  .main-navigation {
    display: block; 
  }

  /* Hide primary desktop navigation list by default */
  .main-navigation ul {
    display: none;
  }

  /* Show mobile hamburger menu toggle */
  .menu-toggle {
    display: block; 
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--bv-primary);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
  }
  .menu-toggle:hover {
    color: var(--bv-secondary);
  }

  /* Mobile Menu Drop-down Overlay when toggled */
  .main-navigation.toggled ul {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bv-bg-primary);
    box-shadow: var(--bv-shadow-lg);
    padding: 20px;
    z-index: 1001;
    gap: 10px;
    border-top: 2px solid var(--bv-primary);
  }

  /* Mobile menu item rows */
  .main-navigation.toggled li {
    width: 100%;
    position: relative;
    border-bottom: 1px solid var(--bv-border-light);
    padding-bottom: 8px;
    margin-bottom: 8px;
  }
  
  .main-navigation.toggled li:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .main-navigation.toggled a {
    padding: 8px 0;
    font-weight: 600;
    font-size: 1rem;
    color: var(--bv-text-dark);
  }

  /* Nested mobile sub-menus (initially hidden) */
  .main-navigation.toggled ul ul {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 20px;
    padding-top: 5px;
    display: none; 
    background: none;
    border-radius: 0;
    border-top: none;
    margin-top: 5px;
  }

  /* Render sub-menu vertical grid when parent is activated */
  .main-navigation.toggled li.menu-item-has-children.active > ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  /* Custom dropdown arrow buttons on mobile */
  .dropdown-toggle-btn {
    position: absolute;
    right: 0;
    top: 4px;
    background: none;
    border: none;
    color: var(--bv-primary);
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 10;
  }

  /* Footer widgets: drop to 2 columns on tablets */
  .footer-widgets {
    grid-template-columns: repeat(2, 1fr);
  }

  /* About Section Split */
  .about-split {
    flex-direction: column;
    gap: 30px;
  }
  .about-image,
  .about-content {
    width: 100%;
    flex: none;
  }

  /* Health Packages Grid Responsiveness */
  .packages-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
  }

  /* News Grid Section Responsiveness */
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* Hero Floating Dock Swipeable Actions Overrides */
  .bv-hero-dock {
    border-radius: 50px !important;
    bottom: -28px !important;
    max-width: calc(100% - 32px) !important;
    width: 100% !important;
    padding: 6px !important;
  }
  
  .bv-hero-dock-inner {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 8px !important;
    scrollbar-width: none !important; /* Hide scrollbars in Firefox */
  }
  
  .bv-hero-dock-inner::-webkit-scrollbar {
    display: none !important; /* Hide scrollbars in Chrome, Safari, Opera */
  }
  
  .bv-dock-btn {
    flex: 0 0 auto !important; /* Lock the buttons from shrinking */
    padding: 10px 20px !important;
    font-size: 0.84rem !important;
    border-radius: 40px !important;
    gap: 6px !important;
  }

  .bv-dock-btn i {
    font-size: 0.95rem !important;
  }
}

/* Mobile Devices (max 768px) */
@media (max-width: 768px) {
  /* Typography Scale Down */
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }

  /* Hide CTA header button on mobile screens to avoid branding text overlap */
  .header-cta {
    display: none;
  }

  /* Footer widgets: drop to single column on mobile */
  .footer-widgets {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* Health Packages Grid Stacked & Overlap Neutralization */
  .packages-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .packages-grid .popular-package {
    transform: none !important;
    margin: 0 !important;
  }
  .packages-grid .popular-package:hover {
    transform: translateY(-5px) !important;
  }

  /* News Grid Stacked */
  .news-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Small Mobile (max 576px) */
@media (max-width: 576px) {
  /* Branding Logo Sizing */
  .site-branding img {
    max-height: 40px;
  }
  
  .site-title {
    font-size: 1.25rem;
  }

  /* Doctors Grid Archive Single-Column Stack */
  .bv-doctors-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Services Grid Section Single-Column Stack */
  .bv-services-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}
