/* ==========================================================================
   ZAB TECHNICAL SERVICES - DUBAI, UAE
   Responsive Breakpoints & Mobile Adaptations
   ========================================================================== */

/* --- Tablet Landscape / Small Desktop (<= 1200px) --- */
@media (max-width: 1200px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2.5rem;
  }

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

  .bento-card.span-2 {
    grid-column: span 1;
  }

  .trust-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
}

/* --- Tablet Portrait (<= 1024px) --- */
@media (max-width: 1024px) {
  :root {
    --header-height: 72px;
  }

  .site-header {
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--border-light);
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-subtle);
    border-radius: var(--radius-sm);
    width: 42px;
    height: 42px;
  }

  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: var(--color-white);
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem 1.5rem;
    gap: 1.25rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 998;
    overflow-y: auto;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    font-size: 1.25rem;
    font-weight: 800;
    width: 100%;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-light);
  }

  .header-actions .btn-primary {
    display: none;
  }

  .header-phone-btn::after,
  .header-phone-btn::before,
  .header-phone::after,
  .header-phone::before {
    display: none !important;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

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

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

  .editorial-item, .editorial-item.reversed {
    grid-template-columns: 1fr;
    gap: 2rem;
    direction: ltr;
  }

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

  .stats-panel {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 1.75rem;
  }

  .stat-item:nth-child(2) {
    border-right: none;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .steps-grid::before {
    display: none;
  }

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

  .reviews-grid {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin: 0 auto;
  }

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

  .emergency-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .emergency-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

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

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

/* --- Mobile Landscape / Large Mobile (<= 768px) --- */
@media (max-width: 768px) {
  body {
    padding-bottom: 72px; /* For sticky mobile bar */
  }

  .mobile-sticky-bar {
    display: block;
  }

  .floating-whatsapp {
    bottom: 84px;
    right: 16px;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
  }

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

  .trust-item:last-child {
    grid-column: span 2;
    justify-content: center;
  }

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

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

  .why-features-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .floating-card-1 {
    left: 0;
    top: 4%;
  }

  .floating-card-2 {
    right: 0;
    bottom: 4%;
  }
}

/* --- Standard Mobile (<= 430px / iPhone Pro Max) --- */
@media (max-width: 430px) {
  .hero-cta-group {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta-group .btn {
    width: 100%;
  }

  .hero-rating-strip {
    width: 100%;
    justify-content: center;
  }

  .stats-panel {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .stat-item {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
  }

  .stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

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

  .trust-item:last-child {
    grid-column: span 1;
    justify-content: flex-start;
  }

  .emergency-actions {
    flex-direction: column;
    width: 100%;
  }

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

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

  .floating-card {
    position: static;
    margin-top: 1rem;
    width: 100%;
    animation: none;
  }
}

/* --- Compact Mobile (<= 390px / 360px) --- */
@media (max-width: 390px) {
  .header-phone-btn,
  .header-phone {
    width: 38px;
    height: 38px;
  }

  .quote-card {
    padding: 1.5rem 1.15rem;
  }

  .btn-lg {
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
  }
}

/* --- 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;
  }
}
