/* ============================================================
   MOBILE OPTIMIZATION & RESPONSIVE ENHANCEMENTS
   ============================================================ */

/* Base mobile-first approach */
:root {
  --mobile-padding: clamp(1rem, 4vw, 2rem);
  --mobile-gap: clamp(0.8rem, 2vw, 1.5rem);
  --touch-target: 44px; /* Minimum touch target size */
}

/* Improve touch targets on mobile */
@media (max-width: 768px) {
  button, a, input, select, textarea {
    min-height: var(--touch-target);
    min-width: var(--touch-target);
  }
  
  button, .btn {
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    min-height: 48px;
  }

  a {
    padding: 0.4rem 0;
  }

  /* Tap highlight color */
  -webkit-tap-highlight-color: rgba(0, 61, 165, 0.1);
  tap-highlight-color: rgba(0, 61, 165, 0.1);
}

/* Mobile-friendly form layout */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .field {
    width: 100%;
  }

  .field input,
  .field select,
  .field textarea {
    width: 100%;
    padding: 0.8rem;
    font-size: 16px; /* Prevents zoom on focus */
    border-radius: 8px;
    line-height: 1.5;
  }

  .field textarea {
    min-height: 120px;
    resize: vertical;
  }

  .form-actions {
    flex-direction: column;
    gap: 1rem;
  }

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

/* Mobile navigation improvements */
@media (max-width: 900px) {
  .nav {
    height: 70px;
  }

  .nav__links {
    top: 70px;
  }

  .nav__links a {
    font-size: 1rem;
    padding: 1rem;
    min-height: 48px;
  }

  .brand__name {
    font-size: 1.1rem;
  }

  .nav__toggle {
    width: 48px;
    height: 48px;
  }
}

/* Mobile hero optimization */
@media (max-width: 768px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  h1 {
    font-size: clamp(1.8rem, 6vw, 3rem);
  }

  .lede {
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  }

  .cta-actions {
    flex-direction: column;
  }

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

/* Mobile-friendly cards */
@media (max-width: 768px) {
  .svc-card {
    padding: 1.5rem;
  }

  .svc-card__media {
    margin: -1.5rem -1.5rem 1.2rem;
    aspect-ratio: 16 / 9;
  }

  .svc-card__icon {
    width: 40px;
    height: 40px;
  }
}

/* Mobile-friendly stats grid */
@media (max-width: 600px) {
  .stats {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .stat__num {
    font-size: 2rem;
  }
}

/* Mobile-friendly feature grid */
@media (max-width: 768px) {
  .feat-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .feat {
    padding: 1.5rem;
  }

  .feat__ic {
    width: 44px;
    height: 44px;
  }
}

/* Mobile-friendly process steps */
@media (max-width: 768px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .step {
    padding: 1.5rem;
  }

  .step__num {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
}

/* Mobile-friendly footer */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-block: 2rem;
  }

  .footer-brand .brand__name {
    font-size: 1.6rem;
  }

  .footer-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    font-size: 0.7rem;
  }
}

/* Optimize images on mobile */
@media (max-width: 768px) {
  img {
    max-width: 100%;
    height: auto;
    display: block;
  }

  .media--band {
    aspect-ratio: 4 / 3;
  }

  .media--tall {
    aspect-ratio: 1 / 1.2;
  }
}

/* Marquee optimization for mobile */
@media (max-width: 768px) {
  .ticker {
    padding: 1rem 0;
  }

  .ticker__track {
    font-size: 0.8rem;
    gap: 2.5rem;
  }

  .ticker__track span::before {
    font-size: 0.6rem;
  }
}

/* Improve readability on mobile */
@media (max-width: 768px) {
  body {
    font-size: 0.95rem;
    line-height: 1.75;
  }

  h2 {
    font-size: clamp(1.4rem, 4vw, 2rem);
  }

  h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  }

  p {
    line-height: 1.8;
  }
}

/* Optimize spacing on mobile */
@media (max-width: 768px) {
  .section {
    padding-block: clamp(3rem, 8vw, 5rem);
  }

  .section--tight {
    padding-block: clamp(2rem, 5vw, 3rem);
  }

  .wrap {
    padding-left: var(--mobile-padding);
    padding-right: var(--mobile-padding);
  }
}

/* Mobile-friendly split sections */
@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Optimize contact cards for mobile */
@media (max-width: 768px) {
  .contact-cards {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-card {
    padding: 1.5rem;
  }
}

/* Page head mobile optimization */
@media (max-width: 768px) {
  .page-head {
    padding-block: 2rem;
  }

  .page-head .wrap {
    text-align: left;
  }

  .page-head h1 {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
  }

  .breadcrumb {
    font-size: 0.85rem;
  }
}

/* Smooth transitions on mobile */
@media (max-width: 768px) {
  * {
    transition-duration: 0.25s !important;
  }
}

/* Ensure full viewport width on mobile */
html, body {
  width: 100%;
  overflow-x: hidden;
}

/* Fix landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-block: 2rem;
  }

  .nav {
    height: 60px;
  }

  .page-head {
    padding-block: 1rem;
  }
}

/* Prevent zoom on input focus (iOS) */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px;
  }
}

/* Optimize performance on mobile */
@media (max-width: 768px) {
  /* Reduce animation complexity on lower-end devices */
  @media (prefers-reduced-motion: no-preference) {
    * {
      animation-duration: 0.3s;
    }
  }
}

/* Improve link touch targets in footer */
.footer-grid a {
  display: block;
  padding: 0.6rem 0;
  min-height: 44px;
  line-height: 44px;
}

/* Mobile-friendly buttons */
.btn {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  border: none;
}

/* Prevent iOS button styling */
.btn::-moz-focus-inner {
  border: 0;
  padding: 0;
}

/* Ensure labels are clickable on mobile */
label {
  display: block;
  cursor: pointer;
  padding: 0.25rem 0;
}

@media (max-width: 768px) {
  label {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
  }
}
