/**
 * Responsive Styles
 * Mobile-first media queries
 */

/* =========================================================================
   BREAKPOINTS
   - Mobile: < 640px
   - Tablet: 640px - 1023px
   - Desktop: >= 1024px
   - Large: >= 1280px
   ========================================================================= */

/* =========================================================================
   MOBILE (Default styles above, these are overrides)
   ========================================================================= */

@media (max-width: 639px) {
  /* Grids inline - Force single column on mobile */
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: 1fr !important;
  }

  /* Ensure buttons stack on mobile */
  [style*="display: flex"][style*="gap"] a,
  [style*="display:flex"][style*="gap"] a {
    width: 100%;
    justify-content: center;
  }

  /* Typography */
  h1 {
    font-size: var(--text-4xl);
  }

  h2 {
    font-size: var(--text-3xl);
  }

  h3 {
    font-size: var(--text-2xl);
  }

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

  .lead {
    font-size: var(--text-lg);
  }

  /* Hero */
  .fp-hero {
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: calc(var(--header-height) + var(--space-8));
  }

  .fp-hero__title {
    font-size: var(--text-4xl);
  }

  .fp-hero__subtitle {
    font-size: var(--text-base);
  }

  .fp-hero__buttons {
    flex-direction: column;
  }

  .fp-hero__buttons .btn {
    width: 100%;
    justify-content: center;
  }

  /* Stats */
  .fp-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }

  .fp-stat__number {
    font-size: var(--text-4xl);
  }

  /* Steps */
  .fp-steps {
    grid-template-columns: 1fr;
  }

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

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

  /* Buttons */
  .btn--lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
  }

  /* Header */
  .site-header__nav {
    display: none;
  }

  .site-header__mobile-toggle {
    display: flex;
  }

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

  /* Urgency banner */
  .fp-urgency-banner {
    font-size: var(--text-sm);
  }

  .fp-urgency-banner__countdown {
    display: none;
  }

  /* FAQ */
  .fp-faq__question {
    padding: var(--space-4);
    font-size: var(--text-base);
  }

  .fp-faq__answer-content {
    padding: 0 var(--space-4) var(--space-4);
  }

  /* Partners */
  .fp-partners {
    gap: var(--space-4);
  }

  .fp-partners__logo {
    max-width: 100px;
  }

  /* Guarantees */
  .fp-guarantees {
    grid-template-columns: 1fr;
  }

  /* Contact form with hero */
  .fp-hero-form {
    flex-direction: column;
  }

  .fp-hero-form__content,
  .fp-hero-form__form {
    width: 100%;
  }
}

/* =========================================================================
   TABLET (640px - 1023px)
   ========================================================================= */

@media (min-width: 640px) and (max-width: 1023px) {
  /* Stats */
  .fp-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Steps */
  .fp-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Header */
  .site-header__nav {
    display: none;
  }

  .site-header__mobile-toggle {
    display: flex;
  }

  /* Hero */
  .fp-hero__title {
    font-size: var(--text-5xl);
  }

  /* Footer */
  .site-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Partners */
  .fp-partners__logo {
    max-width: 120px;
  }

  /* Guarantees */
  .fp-guarantees {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================================================================
   DESKTOP (>= 1024px)
   ========================================================================= */

@media (min-width: 1024px) {
  /* Header */
  .site-header__mobile-toggle {
    display: none;
  }

  .site-header__nav {
    display: flex;
  }

  /* Stats */
  .fp-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Steps */
  .fp-steps {
    grid-template-columns: repeat(4, 1fr);
  }

  .fp-steps--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Guarantees */
  .fp-guarantees {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Footer */
  .site-footer__grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  /* Hero with form */
  .fp-hero-form {
    display: flex;
    align-items: center;
    gap: var(--space-12);
  }

  .fp-hero-form__content {
    flex: 1;
  }

  .fp-hero-form__form {
    flex: 0 0 450px;
  }
}

/* =========================================================================
   LARGE SCREENS (>= 1280px)
   ========================================================================= */

@media (min-width: 1280px) {
  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }

  /* Hero */
  .fp-hero__content {
    max-width: 800px;
  }

  .fp-hero__title {
    font-size: var(--text-7xl);
  }

  /* Stats */
  .fp-stat__number {
    font-size: var(--text-7xl);
  }
}

/* =========================================================================
   EXTRA LARGE SCREENS (>= 1536px)
   ========================================================================= */

@media (min-width: 1536px) {
  .container--wide {
    max-width: 1600px;
  }
}

/* =========================================================================
   HEIGHT BASED (for hero sections)
   ========================================================================= */

@media (max-height: 700px) {
  .fp-hero {
    min-height: auto;
    padding-top: calc(var(--header-height) + var(--space-12));
    padding-bottom: var(--space-12);
  }
}

/* =========================================================================
   PRINT
   ========================================================================= */

@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre,
  blockquote {
    border: 1px solid var(--color-gray);
    page-break-inside: avoid;
  }

  thead {
    display: table-header-group;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  img {
    max-width: 100% !important;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }

  .site-header,
  .site-footer,
  .fp-whatsapp-float,
  .fp-urgency-banner {
    display: none !important;
  }
}

/* =========================================================================
   TOUCH DEVICES
   ========================================================================= */

@media (hover: none) {
  .hover-lift:hover,
  .hover-scale:hover,
  .hover-glow:hover {
    transform: none;
    box-shadow: inherit;
  }

  .btn:hover {
    transform: none;
  }
}

/* =========================================================================
   HIGH CONTRAST MODE
   ========================================================================= */

@media (prefers-contrast: high) {
  :root {
    --color-primary: #FFD700;
    --color-text: #000000;
    --color-bg: #FFFFFF;
    --shadow-gold: none;
  }

  .btn {
    border-width: 3px;
  }

  a:focus,
  button:focus {
    outline: 3px solid currentColor;
  }
}

/* =========================================================================
   DARK MODE PREFERENCE
   ========================================================================= */

@media (prefers-color-scheme: dark) {
  /* Only apply if not explicitly set to light */
  :root:not([data-theme="light"]) {
    /* Could enable dark mode here if desired */
  }
}
