/* ==========================================================================
   Primetroniq Innovations - Advanced Responsive Stylesheet
   Optimized for All Devices (Mobile, iPhone SE, Tablets, Laptops & Desktops)
   ========================================================================== */

/* Global Overflow & Sizing Safety */
html {
  overflow-x: clip;
  max-width: 100%;
}

body {
  overflow-x: clip;
  max-width: 100%;
  width: 100%;
}

/* Guarantee all content is 100% visible on mobile and tablets */
@media (max-width: 992px) {
  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    transition: none !important;
  }
}

* {
  box-sizing: border-box;
}

/* Global Responsive Table Container */
.table-container,
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 20px;
  display: block;
}

/* Desktop - Mobile Hidden Elements */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 1050;
  padding: 6px;
  line-height: 1;
}

.mobile-nav,
.mobile-nav-overlay {
  display: none;
}

/* ─── Tablets landscape / small laptops (≤ 1024px) ─────────── */
@media (max-width: 1024px) {
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .mega-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
  }

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

/* ─── Tablets portrait / large phones (≤ 768px) ────────────── */
@media (max-width: 768px) {
  :root {
    --space-16: 40px;
    --space-24: 56px;
  }

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

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

  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Mobile Navigation Drawer */
  .mobile-nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: -320px;
    width: min(300px, 85vw);
    height: 100vh;
    height: 100dvh;
    background: #0b1329;
    background: linear-gradient(180deg, #0b1329 0%, #030712 100%);
    z-index: 1040;
    padding: 20px 20px 30px;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  }

  .mobile-nav.open {
    right: 0;
  }

  .mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mobile-nav-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    background: #ffffff;
    padding: 4px 10px;
    border-radius: 6px;
  }

  .mobile-nav-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
  }

  .mobile-nav-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.4);
  }

  .mobile-nav-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1030;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

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

  body.nav-open {
    overflow: hidden;
  }

  .mobile-nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .mobile-nav-links > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .mobile-nav-links > li > a {
    display: block;
    padding: 12px 0;
    font-size: 0.98rem;
    font-family: var(--font-heading);
    color: #f1f5f9;
    text-decoration: none;
  }

  .mobile-nav-links .dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 0.98rem;
    font-family: var(--font-heading);
    color: #f1f5f9;
    cursor: pointer;
    user-select: none;
  }

  .mobile-dropdown {
    display: none;
    padding-left: 12px;
    padding-bottom: 10px;
  }

  .mobile-nav-links li.open .mobile-dropdown {
    display: block;
  }

  .mobile-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    color: #94a3b8;
    font-size: 0.88rem;
    text-decoration: none;
    transition: color 0.2s;
  }

  .mobile-dropdown a:hover {
    color: #38bdf8;
  }

  .grid-cols-3,
  .grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  /* Compact section padding for mobile */
  .section-padding {
    padding: 2.25rem 0 !important;
  }
  .section-padding-lg {
    padding: 2.75rem 0 !important;
  }

  /* Hero Slider Mobile Adaptations */
  .hero-slider-section {
    min-height: auto !important;
    padding-top: 100px !important;
    padding-bottom: 30px !important;
    display: block !important;
  }
  .hero-slide {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: auto !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
  }
  .hero-slide.active {
    position: relative !important;
    opacity: 1;
    pointer-events: auto;
  }
  .hero-slide .container.grid {
    gap: 24px !important;
    grid-template-columns: 1fr !important;
  }
  .hero-content h1, .hero-content h2 {
    font-size: 1.65rem !important;
    line-height: 1.25 !important;
  }
  .hero-content p {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
  }
  .hero-image-wrap img {
    max-height: 230px !important;
    width: auto !important;
    margin: 0 auto;
  }

  /* Service Detail Hero Responsive Adjustments */
  .service-hero {
    padding: 110px 0 35px !important;
  }
  .service-hero .container {
    min-height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
    padding-top: 10px !important;
    padding-bottom: 20px !important;
  }
  .service-hero-content {
    width: 100% !important;
  }
  .service-hero-content h1 {
    font-size: 1.7rem !important;
  }
  .service-hero-image, .service-hero-custom {
    position: relative !important;
    top: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    justify-content: center !important;
  }
  .service-hero-image img {
    max-height: 230px !important;
    margin: 0 auto;
  }

  /* Try-on custom banner on mobile */
  .tryon-hero-container {
    width: 100% !important;
    max-width: 380px !important;
    margin: 0 auto !important;
  }

  /* Floating WhatsApp Button on Mobile (Stacked above MSG91 chat widget) */
  .whatsapp-widget,
  .whatsapp-float,
  .btn-whatsapp-fixed {
    bottom: 90px !important;
    right: 18px !important;
    z-index: 1040;
  }
}

/* ─── Compact Phones / iPhone SE (≤ 480px) ─────────────────── */
@media (max-width: 480px) {
  .container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
  }

  .section-header h2 {
    font-size: 1.45rem !important;
  }

  /* iOS Auto-Zoom fix: Ensure inputs are at least 16px font */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Buttons on small screens */
  .btn {
    padding: 10px 18px !important;
    font-size: 0.9rem !important;
  }

  .hero-buttons {
    flex-direction: column !important;
    width: 100%;
    gap: 10px !important;
  }

  .hero-buttons .btn {
    width: 100% !important;
    text-align: center !important;
  }

  /* Cards & Items */
  .feature-item-card,
  .service-card,
  .tech-card {
    padding: 16px !important;
  }

  .tech-badge {
    padding: 8px 12px !important;
    font-size: 0.8rem !important;
  }

  /* Try-on pills row on small screens */
  .tryon-pill-grid,
  .tryon-pills-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  /* Breadcrumbs */
  .hero-breadcrumb {
    font-size: 0.8rem !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
}

/* ─── Ultra-Compact Phones / iPhone SE 1st Gen (≤ 360px) ───── */
@media (max-width: 360px) {
  .container {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .hero-content h1, .hero-content h2,
  .service-hero-content h1 {
    font-size: 1.45rem !important;
  }

  .tryon-pill-grid,
  .tryon-pills-row {
    grid-template-columns: 1fr !important;
  }

  .mobile-nav {
    width: 88vw !important;
    padding: 16px 14px;
  }
}

/* Hide about section absolute glass card on small mobile screens to prevent horizontal overflow */
@media (max-width: 500px) {
  .about-image-grid .glass-card {
    display: none !important;
  }
}
