/* ==========================================================================
   SP EVENTS — RESPONSIVE MEDIA QUERIES & MOBILE FLEXIBILITY
   Breakpoints: 1400px, 1200px, 992px, 768px, 576px, 400px, 340px
   ========================================================================== */

/* Touch Action Optimization & Overflow Safeguards */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea, a {
  touch-action: manipulation;
}

/* Mobile Nav Backdrop Overlay */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 21, 36, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  z-index: 999;
  transition: all var(--transition-medium);
}

.nav-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Hamburger Cross Animation */
.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Extra Large Screens (Max 1400px) */
@media (max-width: 1400px) {
  .hero-title {
    font-size: clamp(3rem, 4.8vw, 4.2rem);
  }
  
  .portfolio-item.col-6 { height: 380px; }
  .portfolio-item.col-4 { height: 340px; }
  .portfolio-item.col-8 { height: 380px; }
}

/* Large Desktops / Laptops (Max 1200px) */
@media (max-width: 1200px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
  
  .intro-grid {
    gap: 3.5rem;
  }
  
  .service-row {
    grid-template-columns: 60px 1fr 1.5fr 50px;
    gap: 1.5rem;
  }

  .pillars-grid {
    gap: 1.5rem;
  }
  
  .process-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

/* Tablets & Small Laptops (Max 992px) */
@media (max-width: 992px) {
  .section-padding {
    padding: 4.5rem 0;
  }
  
  .section-padding-large {
    padding: 5.5rem 0;
  }
  
  .hamburger {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 82%;
    max-width: 360px;
    height: 100vh;
    background-color: var(--navy-dark);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 2.25rem;
    gap: 1.75rem;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    transition: right var(--transition-medium);
    border-left: 1px solid var(--border-dark);
    z-index: 1000;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-cta-mobile {
    display: inline-flex !important;
    margin-top: 1.25rem;
    width: 100%;
  }

  .nav-cta-desktop {
    display: none !important;
  }

  .nav-link {
    font-size: 1.15rem;
    width: 100%;
    padding: 0.5rem 0;
  }

  .hero {
    min-height: auto;
    padding: 8.5rem 0 4.5rem;
  }

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

  .hero-visual-card img {
    height: clamp(280px, 48vw, 420px);
  }

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

  .intro-image-frame img {
    height: clamp(320px, 50vw, 480px);
  }

  .intro-badge {
    bottom: -1rem;
    right: 1rem;
    padding: 1.25rem 1.75rem;
  }

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

  .stat-item:nth-child(2)::after {
    display: none;
  }

  .service-row {
    grid-template-columns: 40px 1fr 40px;
    padding: 1.75rem 1rem;
    gap: 1rem;
  }

  .service-desc {
    grid-column: span 3;
    margin-top: 0.5rem;
  }

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

  .pillar-card {
    height: clamp(300px, 50vw, 420px);
  }

  .portfolio-grid {
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
  }

  .portfolio-item.col-6,
  .portfolio-item.col-4,
  .portfolio-item.col-8,
  .portfolio-item.col-12 {
    grid-column: span 1;
    height: clamp(260px, 45vw, 360px);
  }

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

  .featured-visual img {
    height: clamp(280px, 48vw, 450px);
  }

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

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

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

/* Mobile Devices (Max 768px) */
@media (max-width: 768px) {
  .section-padding {
    padding: 3.5rem 0;
  }

  .section-padding-large {
    padding: 4.5rem 0;
  }

  .hero-title {
    font-size: clamp(2.2rem, 6.5vw, 3.2rem);
  }

  .hero-description {
    font-size: 1.05rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .btn {
    width: 100%;
  }

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

  .stat-item::after {
    display: none !important;
  }

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

  .process-card {
    padding: 2rem 1.5rem;
  }

  .form-card {
    padding: 2rem 1.25rem;
  }

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

  .form-control {
    font-size: 16px !important; /* Prevents iOS auto-zoom */
    padding: 0.85rem 1rem;
  }

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

  /* Lightbox Mobile Adjustments */
  .lightbox-content {
    max-width: 94vw;
  }

  .lightbox-content img {
    max-height: 60vh;
  }

  .lightbox-close {
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
  }

  .lightbox-prev {
    left: 10px;
    width: 44px;
    height: 44px;
  }

  .lightbox-next {
    right: 10px;
    width: 44px;
    height: 44px;
  }

  /* Floating Buttons on Mobile */
  .whatsapp-float {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 52px;
    height: 52px;
    font-size: 1.6rem;
  }

  .back-to-top-btn {
    bottom: 1.25rem;
    left: 1.25rem;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
}

/* Small Mobile Devices (Max 576px) */
@media (max-width: 576px) {
  .container, .container-wide {
    width: 92%;
    padding: 0 0.75rem;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .brand-subtitle {
    font-size: 0.55rem;
  }

  .brand-logo-mark {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

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

  .service-row {
    grid-template-columns: 1fr 36px;
    padding: 1.35rem 0.5rem;
  }

  .service-num {
    display: none;
  }

  .service-title {
    font-size: 1.3rem;
  }

  .portfolio-filters {
    gap: 0.5rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }

  .why-heading-large {
    font-size: clamp(1.8rem, 6vw, 2.6rem);
  }

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

/* Extra Small Devices (Max 400px) */
@media (max-width: 400px) {
  .hero-title {
    font-size: 1.95rem;
  }

  .section-label {
    font-size: 0.7rem;
    letter-spacing: 1.2px;
  }

  .btn {
    padding: 0.85rem 1.25rem;
    font-size: 0.8rem;
    letter-spacing: 1px;
  }
}

/* Bottom Google Map Mobile Responsiveness */
@media (max-width: 768px) {
  .bottom-map-section {
    padding: 2.5rem 0 1.5rem;
  }

  .map-header {
    padding: 1rem 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .map-iframe-box {
    height: 230px;
  }
}

@media (max-width: 480px) {
  .map-iframe-box {
    height: 200px;
  }

  .form-card {
    padding: 1.5rem 1rem;
  }
}
