/* ═══════════════════════════════════════════════════════════════
   SVSS — Mobile Responsiveness Overhaul
   Fixes: nav visibility, white space, overlapping, alignment,
          proposal form, about page, gallery, footer, all pages.
   ═══════════════════════════════════════════════════════════════ */

/* ── Body offset for fixed utility bar + navbar ─────────────────── */
body {
  padding-top: calc(var(--utility-height) + var(--nav-height));
}

/* ── On mobile: utility bar is hidden → navbar at top:0, body offset = nav only ── */
@media (max-width: 1024px) {
  body {
    padding-top: var(--nav-height) !important;
  }
  .navbar {
    top: 0 !important;
  }
  .utility-bar {
    display: none !important;
  }
}


*, *::before, *::after { box-sizing: border-box; }
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
img, video, iframe, svg {
  max-width: 100%;
  height: auto;
}

/* ═══════════════════════════════════════════════════════════════
   TABLET  ≤ 1024px
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {

/* ── Police Award block: image always above text on tablet/mobile ── */
.police-award-block {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.5rem !important;
}
.police-award-block img {
  width: 100% !important;
  max-height: 320px;
  object-fit: contain;
}

/* ── Hamburger visible, always styled ── */

  .hamburger {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    cursor: pointer;
    z-index: 1100;
    flex-shrink: 0;
  }
  .hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--c-white);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  .hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* ── Desktop nav hidden ── */
  .navbar__nav { display: none !important; }
  #nav-cta.btn-cta-primary { display: none !important; }

  /* ── Navbar inner: logo + hamburger only ── */
  .navbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: 1.25rem;
    height: 68px;
  }

  /* ── Mobile Nav Drawer ── */
  .mobile-nav {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--c-navy-deep);
    z-index: 1050;
    display: flex !important;
    flex-direction: column;
    padding: 2rem 1.5rem;
    gap: 0.25rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
  }
  .mobile-nav.open {
    transform: translateX(0);
    visibility: visible;
  }
  .mobile-nav__link {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
  }
  .mobile-nav__link:hover,
  .mobile-nav__link.active {
    background: rgba(245,158,11,0.1);
    color: var(--c-amber);
  }
  .mobile-cta {
    margin-top: 1rem !important;
    text-align: center !important;
    justify-content: center !important;
    padding: 1rem !important;
    font-size: 1rem !important;
    border-radius: 12px !important;
  }

  /* ── Hero ── */
  .hero {
    padding-top: 68px;
    min-height: auto;
  }
  .hero__inner {
    grid-template-columns: 1fr !important;
    padding-block: 3rem 2.5rem;
    gap: 2.5rem;
  }
  .hero__left { text-align: center; }
  .hero__badge { margin-inline: auto; }
  .hero__headline { font-size: clamp(1.8rem, 6vw, 2.8rem); }
  .hero__subheadline { margin-inline: auto; max-width: 500px; }
  .hero__cta-group { justify-content: center; flex-wrap: wrap; gap: 0.75rem; }
  .hero__trust-bar { justify-content: center; flex-wrap: wrap; }
  .hero__right { width: 100%; }

  /* ── Stats Matrix ── */
  .stats-matrix { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .stat-card { padding: 1.25rem; }

  /* ── Services ── */
  .services__grid { grid-template-columns: repeat(2, 1fr); }

  /* ── Trust Section ── */
  .trust-section__inner { grid-template-columns: 1fr !important; gap: 2.5rem; }
  .trust-img-wrap { height: 320px; }
  .trust-main-img { width: 65%; height: 65%; }
  .trust-secondary-img { width: 45%; height: 45%; }

  /* ── Deployment Timeline ── */
  .deployment__timeline { padding-inline: 0; }

  /* ── Clients ── */
  .clients-logos { gap: 1rem; flex-wrap: wrap; }
  .clients-logo-item { min-width: 120px; }

  /* ── Gallery ── */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: auto !important;
  }
  .gallery-item { height: 200px !important; aspect-ratio: unset !important; }
  .gallery-item--wide { grid-column: span 2; }

  /* ── Footer ── */
  .footer__inner {
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem;
  }
  .footer__col--brand { grid-column: span 2; }

  /* ── About page: proprietor ── */
  .proprietor-block {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }
  .proprietor-img {
    width: 100% !important;
    max-height: 360px;
    object-fit: cover;
    object-position: top center;
    aspect-ratio: unset !important;
  }
  .proprietor-img-wrap { width: 100%; }

  /* ── About: owners, team, values ── */
  .owners-block { grid-template-columns: 1fr !important; }
  .core-values-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .team-gallery-grid { grid-template-columns: repeat(3, 1fr) !important; }

  /* ── Services page detail blocks ── */
  .svc-detail__inner {
    grid-template-columns: 1fr !important;
    gap: 2rem;
    direction: ltr !important;
  }
  .svc-detail__inner--flip { direction: ltr !important; }
  .svc-bottom-cta__inner { grid-template-columns: 1fr !important; }
  .svc-stat-strip { grid-template-columns: repeat(3, 1fr); }

  /* ── Contact page ── */
  .contact-page-inner {
    grid-template-columns: 1fr !important;
    padding-inline: 1.5rem !important;
  }
  .contact-info-panel { position: static !important; }
  .map-trust-inner { grid-template-columns: 1fr !important; }
  .cfp-row { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE  ≤ 640px
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* ── Spacing scale ── */
  :root {
    --space-xl:  1.25rem;
    --space-2xl: 1.75rem;
    --space-3xl: 2.25rem;
    --space-4xl: 2.75rem;
    --space-5xl: 3.5rem;
  }

  /* ── General sections: side padding ── */
  .services__header,
  .deployment__header,
  .clients-section__header,
  .gallery-section__header,
  .trust-section__inner,
  .clients-full-section__inner,
  .about-section__inner {
    padding-inline: 1rem !important;
  }
  section { padding-inline: 0; }

  /* ── Hero ── */
  .hero__inner { padding-inline: 1rem; padding-block: 2.5rem 2rem; }
  .hero__headline { font-size: clamp(1.6rem, 7vw, 2.2rem); }
  .hero__subheadline { font-size: 0.92rem; }
  .btn-hero-primary, .btn-hero-outline { width: 100%; justify-content: center; }

  /* ── Stats ── */
  .stats-matrix { grid-template-columns: 1fr 1fr !important; gap: 0.75rem; }
  .stat-card__metric { font-size: 1.8rem; }
  .tactical-readout { display: none; }

  /* ── Services ── */
  .services { padding-inline: 1rem; }
  .services__grid { grid-template-columns: 1fr !important; gap: 1rem; }
  .services__cta-strip {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding-inline: 1rem;
  }

  /* ── Deployment ── */
  .deployment { padding-inline: 1rem; }
  .timeline-step { grid-template-columns: 50px 1fr; gap: 0.75rem; }
  .timeline-step__number { width: 40px; height: 40px; font-size: 0.8rem; }

  /* ── Gallery ── */
  .gallery-section { padding-inline: 0.5rem; }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.4rem;
  }
  .gallery-item { height: 160px !important; }
  .gallery-item--wide { grid-column: span 2; height: 200px !important; }

  /* ── Clients logos ── */
  .clients-logos { gap: 0.75rem; }
  .clients-logo-item { min-width: 110px; padding: 0.75rem; }
  .clients-sectors { padding-inline: 1rem; }

  /* ── Footer ── */
  .footer__inner {
    grid-template-columns: 1fr !important;
    padding-inline: 1.25rem;
    gap: 2rem;
  }
  .footer__col--brand { grid-column: 1 !important; text-align: center; }
  .footer__bottom-inner { flex-direction: column; text-align: center; gap: 0.5rem; }
  .footer__bottom-inner p { font-size: 0.72rem; }

  /* ── About: proprietor fix ── */
  .proprietor-block { padding-inline: 1rem; }
  .proprietor-img { max-height: 280px; }
  .bio-text { font-size: 0.9rem; }
  .specializations { flex-direction: column; gap: 0.5rem; }
  .spec-tag { width: 100%; text-align: center; }

  /* ── About: values & team ── */
  .core-values-grid { grid-template-columns: 1fr !important; padding-inline: 1rem; }
  .team-gallery-grid { grid-template-columns: repeat(2, 1fr) !important; padding-inline: 1rem; }
  .owners-block { padding-inline: 1rem; }

  /* ── Services page ── */
  .svc-detail { padding-block: 3rem; padding-inline: 1rem; }
  .svc-number { font-size: 3rem; }
  .svc-features { grid-template-columns: 1fr !important; }
  .svc-stat-strip { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .svc-stat span { font-size: 1.1rem; }
  .svc-quick-nav { padding-inline: 1rem; gap: 0.4rem; }
  .svc-bottom-cta { padding-block: 3rem; padding-inline: 1rem; }
  .svc-bottom-cta__actions { flex-direction: column; }

  /* ── Contact page ── */
  .contact-page-section { padding-block: 2.5rem; }
  .contact-page-inner { padding-inline: 1rem !important; gap: 1.5rem; }
  .contact-form-panel { padding: 1.25rem !important; }
  .cfp-row { grid-template-columns: 1fr !important; }
  .cfp-checkboxes { grid-template-columns: 1fr !important; }
  .map-trust-section { padding-block: 2.5rem; }
  .map-trust-inner { padding-inline: 1rem; gap: 2rem; }
  .map-embed-wrap { height: 260px; }
  .contact-hero-chips { flex-direction: column; align-items: stretch; }
  .contact-chip { justify-content: center; }

  /* ── Page hero (inner pages) ── */
  .page-hero { padding-block: 3rem 2rem; }
  .page-hero__title { font-size: clamp(1.6rem, 7vw, 2.2rem); }
  .page-hero__inner { padding-inline: 1rem; }

  /* ── Section headers ── */
  .section-title { font-size: clamp(1.5rem, 6vw, 2rem); }

  /* ── Breadcrumb ── */
  .breadcrumb { font-size: 0.75rem; }

  /* ── Clients page table ── */
  .clients-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .clients-table { font-size: 0.8rem; }
  .clients-table th, .clients-table td { padding: 0.65rem 0.85rem; }

  /* ── Trust section ── */
  .trust-section { padding-inline: 1rem; }
  .trust-section__inner { padding-inline: 1rem; }
  .trust-pillars { gap: 0.85rem; }
  .trust-pillar { gap: 0.75rem; }
  .trust-img-wrap { height: 260px; }
  .trust-award-badge { display: none; }

  /* ── Remove hover transforms on touch (prevents stuck states) ── */
  .service-card:hover { transform: none; }
  .ctp-item:hover { transform: none; }
  .svc-detail__visual:hover { transform: none; }
}

/* ═══════════════════════════════════════════════════════════════
   SMALL MOBILE  ≤ 380px
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 380px) {
  .stats-matrix { grid-template-columns: 1fr 1fr !important; }
  .stat-card { padding: 1rem 0.75rem; }
  .stat-card__metric { font-size: 1.6rem; }
  .hero__headline { font-size: 1.5rem; }
  .gallery-item { height: 130px !important; }
  .gallery-item--wide { height: 160px !important; }
  .svc-stat-strip { grid-template-columns: 1fr 1fr 1fr; }
  .navbar__brand-text { display: none; }
  .footer__logo { height: 70px; }
}
