/**
 * Foyez AC Repairing — Responsive Design Stylesheet
 * Strict Zero-Overlap Architecture for All Viewports (320px - 1920px)
 */

/* ====================================================================
   LARGE SCREENS (1440px - 1920px)
   ==================================================================== */
@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }
}

/* ====================================================================
   DESKTOP / LAPTOP BREAKPOINT (Under 1200px)
   ==================================================================== */
@media (max-width: 1200px) {
  .desktop-nav {
    gap: 16px;
  }

  .nav-link {
    font-size: 0.9rem;
    padding: 6px 2px;
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }
}

/* ====================================================================
   TABLET / COMPACT DESKTOP (Under 1024px)
   CRITICAL HEADER BREAKPOINT: Switches to Mobile Slide Drawer
   ==================================================================== */
@media (max-width: 1023px) {
  /* Header: Hide Desktop Navigation and Book button in header, Show Hamburger */
  .desktop-nav,
  .header-action .btn-book-desktop {
    display: none !important;
  }

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

  .header-inner {
    height: 68px;
  }

  .brand-logo img {
    height: 42px;
  }

  /* Hero Section */
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

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

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

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

  /* Grids */
  .welcome-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

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

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

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

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

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

  .service-detail-grid {
    grid-template-columns: 1fr;
  }

  .service-detail-media {
    padding: 24px;
  }

  .service-detail-media img {
    max-height: 240px;
  }

  .contact-layout-grid {
    grid-template-columns: 1fr;
  }
}

/* ====================================================================
   TABLET PORTRAIT & PHABLETS (Under 768px)
   ==================================================================== */
@media (max-width: 767px) {
  .section {
    padding: 56px 0;
  }

  /* Top Bar Adaptation: Keep phone & language switcher readable without wrapping overlap */
  .top-bar-inner {
    flex-direction: row;
    justify-content: space-between;
  }

  .top-bar-location {
    display: none; /* Hide location text to guarantee zero collision with phone & switcher */
  }

  .top-info-item {
    font-size: 0.8rem;
  }

  .top-social-links {
    display: none; /* Social icons remain in mobile drawer & footer */
  }

  /* Features & Problems */
  .features-grid {
    grid-template-columns: 1fr;
  }

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

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

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

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

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

  .form-wrapper {
    padding: 24px 20px;
  }

  .service-checklist {
    grid-template-columns: 1fr;
  }

  .service-detail-content {
    padding: 24px 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
}

/* ====================================================================
   MOBILE SCREENS (Under 640px)
   Activates Bottom Sticky Quick Action Bar
   ==================================================================== */
@media (max-width: 639px) {
  body {
    /* Safe spacing so sticky bottom action bar never obscures page content */
    padding-bottom: 64px;
  }

  /* Mobile Quick Action Bar Visible */
  .mobile-bottom-bar {
    display: block;
  }

  /* Elevate floating WhatsApp button above mobile action bar so they NEVER collide */
  .floating-whatsapp {
    bottom: 78px;
    right: 16px;
  }

  .floating-whatsapp-btn {
    width: 52px;
    height: 52px;
  }

  .floating-whatsapp-btn svg {
    width: 28px;
    height: 28px;
  }

  .floating-whatsapp-tooltip {
    display: none; /* Tooltip not needed on touch screens */
  }

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

  .welcome-highlights {
    grid-template-columns: 1fr;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .cta-banner {
    padding: 40px 20px;
  }

  .cta-banner-actions .btn {
    width: 100%;
  }

  /* Lightbox on mobile */
  .lightbox-nav {
    display: none;
  }
}

/* ====================================================================
   EXTRA-SMALL MOBILE (320px - 390px)
   Strict testing: iPhone SE, Galaxy S compact, etc.
   ==================================================================== */
@media (max-width: 390px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand-logo img {
    height: 36px;
  }

  .top-info-item span {
    font-size: 0.76rem;
  }

  .lang-switcher-pill {
    padding: 3px 8px;
    font-size: 0.75rem;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .section-header h2 {
    font-size: 1.6rem;
  }

  .service-card-actions {
    flex-direction: column;
  }

  .service-card-actions .btn {
    width: 100%;
  }

  .mobile-nav-drawer {
    width: 290px;
  }
}

