/* ============================================
   TinyTrails — Responsive Styles
   Mobile-first breakpoints
   ============================================ */

/* --- Tablet (max-width: 1024px) --- */
@media (max-width: 1024px) {
  :root {
    --font-size-5xl: 2.5rem;
    --font-size-6xl: 3rem;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    text-align: center;
  }

  .hero__description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__stats {
    justify-content: center;
  }

  .hero__visual {
    order: -1;
  }

  .hero__phone-mockup {
    width: 240px;
    height: 480px;
  }

  .hero__float-badge--gps {
    right: 5%;
  }

  .hero__float-badge--safe {
    left: 5%;
  }

  .hero__float-badge--sos {
    right: 0%;
  }

  .how-it-works__steps {
    grid-template-columns: 1fr;
    gap: var(--space-10);
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }

  .step:not(:last-child)::after {
    display: none;
  }

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

  .devices__grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }

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

  .pricing-card--featured {
    transform: none;
  }

  .pricing-card--featured:hover {
    transform: translateY(-4px);
  }

  .iot-value__inner {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .testimonials__grid {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }

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

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

/* --- Mobile large (max-width: 768px) --- */
@media (max-width: 768px) {
  :root {
    --font-size-4xl: 1.875rem;
    --font-size-5xl: 2.25rem;
    --font-size-6xl: 2.5rem;
    --space-24: 4rem;
    --space-20: 3.5rem;
  }

  /* Navigation mobile */
  .nav__links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    justify-content: flex-start;
    padding: var(--space-8) var(--space-6);
    gap: var(--space-1);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    z-index: 999;
  }

  .nav__links--open {
    transform: translateX(0);
  }

  .nav__link {
    font-size: var(--font-size-lg);
    padding: var(--space-4) var(--space-4);
    width: 100%;
  }

  .nav__actions {
    display: none;
  }

  .nav__links--open ~ .nav__actions {
    display: flex;
  }

  .nav__toggle {
    display: block;
  }

  /* Hero mobile */
  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-height) + var(--space-8));
    padding-bottom: var(--space-12);
  }

  .hero__phone-mockup {
    width: 200px;
    height: 400px;
    border-radius: 28px;
  }

  .hero__phone-screen {
    border-radius: 20px;
    padding: var(--space-4);
  }

  .hero__float-badge {
    display: none;
  }

  .hero__stats {
    flex-direction: column;
    gap: var(--space-4);
  }

  .hero__stat {
    text-align: center;
  }

  .hero__actions {
    flex-direction: column;
    align-items: center;
  }

  .hero__actions .btn {
    width: 100%;
    max-width: 320px;
  }

  /* Features mobile */
  .features__grid {
    grid-template-columns: 1fr;
  }

  /* Pricing mobile */
  .pricing__grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }

  .iot-value__features {
    grid-template-columns: 1fr;
  }

  /* Stats mobile */
  .stats__grid {
    grid-template-columns: 1fr 1fr;
  }

  /* CTA mobile */
  .cta__actions {
    flex-direction: column;
    align-items: center;
  }

  .cta__actions .btn {
    width: 100%;
    max-width: 320px;
  }

  /* Footer mobile */
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer__legal {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* --- Mobile small (max-width: 480px) --- */
@media (max-width: 480px) {
  :root {
    --font-size-4xl: 1.5rem;
    --font-size-5xl: 1.875rem;
    --font-size-6xl: 2rem;
  }

  .container {
    padding: 0 var(--space-4);
  }

  .hero__phone-mockup {
    width: 180px;
    height: 360px;
    border-radius: 24px;
  }

  .hero__phone-screen {
    border-radius: 18px;
    padding: var(--space-3);
  }

  .section-title {
    font-size: var(--font-size-3xl);
  }

  .pricing-card {
    padding: var(--space-6);
  }

  .feature-card {
    padding: var(--space-6);
  }
}

/* --- Pricing page specific responsive --- */
@media (max-width: 1024px) {
  .pricing-page .pricing-comparison__table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .pricing-page .pricing-comparison__table table {
    min-width: 700px;
  }
}

/* --- Print styles --- */
@media print {
  .nav,
  .nav__toggle,
  .cta,
  .footer {
    display: none;
  }

  body {
    font-size: 12pt;
    color: black;
    background: white;
  }

  .hero {
    background: white;
    min-height: auto;
    padding: 20pt 0;
  }

  .pricing-card {
    break-inside: avoid;
    border: 1px solid #ccc;
  }

  a {
    color: black;
    text-decoration: underline;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero__float-badge {
    animation: none;
  }

  .hero__badge-dot,
  .hero__phone-map-dot {
    animation: none;
  }
}

/* --- High Contrast Mode --- */
@media (prefers-contrast: high) {
  :root {
    --color-border: #333;
    --color-text-light: #333;
  }

  .btn--primary,
  .btn--accent {
    border-width: 3px;
  }

  .feature-card,
  .pricing-card,
  .testimonial-card {
    border-width: 2px;
    border-color: #333;
  }
}
