/*
  Nani Ambulance Service - Responsive Stylesheet
  Handles responsiveness for different viewport widths and mobile layout enhancements
*/

/* Mobile Bottom Navigation & Action Bar */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 65px;
  background: var(--color-white);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  z-index: 9998;
  border-top: 1px solid var(--color-gray-100);
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  text-align: center;
}
.mobile-bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--color-gray-600);
  font-weight: 600;
  gap: 4px;
}
.mobile-bottom-item svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.mobile-bottom-item.active {
  color: var(--color-primary);
}
.mobile-bottom-item.emergency-call {
  background: var(--color-primary);
  color: var(--color-white);
  height: 100%;
  justify-content: center;
}
.mobile-bottom-item.whatsapp-action {
  background: #25D366;
  color: var(--color-white);
  height: 100%;
  justify-content: center;
}

/* =================================================
   VIEWPORT BREAKPOINTS
   ================================================= */

/* 1440px - Extra Large Desktop */
@media (min-width: 1440px) {
  .container {
    max-width: 1380px;
  }
}

/* 1024px to 1439px - Large Screen / Laptop */
@media (max-width: 1200px) {
  h1 { font-size: 2.75rem; }
  h2 { font-size: 2rem; }
  .mega-menu {
    width: 700px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 1024px) {
  .nav-links {
    gap: 18px;
  }
  .nav-link {
    font-size: 0.9rem;
  }
  .mega-menu {
    width: 600px;
  }
  .split-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .related-services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 768px - Tablet */
@media (max-width: 768px) {
  .section-padding {
    padding: 70px 0;
  }
  .section-header h2 {
    font-size: 2rem;
  }
  
  /* Mobile Menu Toggle logic */
  .menu-btn {
    display: block;
    z-index: 1001;
  }
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 380px;
    height: 100vh;
    background: var(--color-white);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    flex-direction: column;
    align-items: flex-start;
    padding: 100px 30px 40px;
    gap: 0;
    overflow-y: auto;
    transition: right var(--transition-normal);
    z-index: 1000;
  }
  .nav-links.active {
    right: 0;
  }
  .nav-item {
    width: 100%;
    border-bottom: 1.5px solid var(--color-gray-100);
  }
  .nav-link {
    padding: 16px 0;
    justify-content: space-between;
    font-size: 1.05rem;
  }
  
  /* Mobile Accordion Menu for Dropdown */
  .mega-menu {
    position: static;
    transform: none;
    width: 100%;
    box-shadow: none;
    padding: 0 0 20px 20px;
    opacity: 1;
    visibility: visible;
    display: none; /* Controlled by toggle script */
    grid-template-columns: 1fr;
    gap: 14px;
    border-top: none;
  }
  .mega-menu-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .mega-menu-cta {
    display: none; /* Hide desktop cta to save vertical space on mobile */
  }
  .nav-item.active .mega-menu {
    display: grid;
  }
  .nav-item.active .nav-link svg {
    transform: rotate(180deg);
  }
  
  /* Hide Top Bar Info */
  .top-bar-info {
    display: none;
  }
  .top-bar-content {
    justify-content: center;
  }
  
  /* Zigzag layout stacking */
  .zigzag-row, .zigzag-row:nth-child(even) {
    flex-direction: column;
    gap: 30px;
  }
  .zigzag-col-image {
    width: 100%;
    order: -1; /* Image first on mobile */
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
  .related-services-grid {
    grid-template-columns: 1fr;
  }
  
  /* Mobile bottom sticky action bar activation */
  .mobile-bottom-bar {
    display: grid;
  }
  body {
    padding-bottom: 65px; /* Offset bottom navigation height */
  }
  .floating-widgets {
    bottom: 85px; /* Push floating widgets above bottom nav */
    right: 20px;
  }
  
  /* Mobile CTA optimizations */
  .btn {
    width: 100%;
    padding: 16px 20px; /* Touch target size optimization (at least 48px height) */
  }
  
  /* Typography scales */
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.4rem; }
}

/* 425px - Large Mobile Screen */
@media (max-width: 425px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  .section-header h2 { font-size: 1.6rem; }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 14px;
    text-align: center;
  }
}

/* 375px - Medium Mobile Screen */
@media (max-width: 375px) {
  h1 { font-size: 1.8rem; }
  .logo-text h1 { font-size: 1.15rem; }
  .logo-text span { font-size: 0.65rem; }
  .container {
    padding: 0 16px;
  }
  .testimonial-card-premium {
    padding: 30px 20px;
  }
}

/* 320px - Small Mobile Screen */
@media (max-width: 320px) {
  h1 { font-size: 1.65rem; }
  .logo-text h1 { font-size: 1rem; }
  .nav-cta {
    display: none; /* Hide primary navbar CTA to fit logo & menu button */
  }
}
