/* =============================================
   KiddoShield Landing — Responsive Queries
   ============================================= */

/* ---- Large desktop: 1280px ---- */
@media (max-width: 1280px) {
  .hero-title { font-size: 4.6rem; }
  .section-title { font-size: 3.6rem; }
}

/* ---- Desktop: 1024px ---- */
@media (max-width: 1024px) {
  html { font-size: 56.25%; }

  .hero-inner { grid-template-columns: 1fr; gap: 4rem; }
  .hero-content { text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-trust { justify-content: center; }
  .hero-badge { justify-content: center; }

  .hero-visual { height: 40rem; }
  .float-danger { left: 0; top: 1rem; width: 26rem; }
  .float-ai { right: 0; top: 35%; width: 20rem; }
  .float-info { bottom: 0; left: 10%; width: 24rem; }

  .feat-grid { grid-template-columns: 1fr; gap: 4.8rem; }
  .feat-block-alt .feat-grid { direction: ltr; }

  .feat-cards-grid { grid-template-columns: 1fr 1fr; }

  .problems-grid { grid-template-columns: repeat(2, 1fr); }

  .stories-grid { grid-template-columns: 1fr 1fr; }
  .story-card:last-child { grid-column: span 2; }

  .cta-box { grid-template-columns: 1fr; gap: 4rem; text-align: center; }
  .cta-stats { justify-content: center; }

  .footer-grid { grid-template-columns: 1fr 1fr; row-gap: 3.6rem; }
  .footer-brand { grid-column: span 2; }

  .guarantees-grid { grid-template-columns: repeat(2, 1fr); }

  .pricing-grid { max-width: 96rem; gap: 1.6rem; }
  .price-card { padding: 2.4rem; }
}

/* ---- Tablet: 768px ---- */
@media (max-width: 768px) {
  html { font-size: 56.25%; } /* 1rem = 9px — readable on mobile */

  .section-hero { padding: 6rem 2rem 5rem; min-height: auto; }

  /* Mobile nav */
  .mobile-menu-btn { display: flex; }
  /* Remove backdrop-filter from header on mobile — it creates a stacking context
     that traps position:fixed children (the nav overlay) relative to the header */
  .header { backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; }
  .main-nav {
    display: none;
    position: fixed; top: 7rem; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(12px);
    padding: 2.4rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 99;
  }
  .main-nav.nav-open { display: block; }
  .nav-list { display: block; margin-bottom: 2.4rem; }
  .nav-list li { display: block; width: 100%; }
  .nav-link { display: block; font-size: 1.8rem; padding: 1.2rem 0; width: 100%; border-bottom: 1px solid var(--border); border-radius: 0; }
  .nav-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 1.6rem; width: 100%; }
  .nav-actions .btn { width: 100%; justify-content: center; font-size: 1.8rem; padding: 1.4rem; }
  .lang-menu { width: 100%; }

  .hero-title { font-size: 3.8rem; }
  .hero-subtitle { font-size: 1.6rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { text-align: center; }

  .hero-visual { height: 36rem; }
  .float-card { transform: scale(0.85); transform-origin: top left; }
  .float-ai { transform: scale(0.85); transform-origin: top right; }

  .section-title { font-size: 3.2rem; }
  .feat-title { font-size: 2.8rem; }

  .feat-block { padding: 6.4rem 2rem; }
  .feat-cards-grid { grid-template-columns: 1fr; }

  .stories-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 1.6rem;
    padding: 0.4rem 0.4rem 0.8rem;
  }
  .stories-grid::-webkit-scrollbar { display: none; }
  .story-card { flex: 0 0 85vw; scroll-snap-align: start; }
  .story-card:last-child { grid-column: auto; }
  .stories-dots {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 2rem;
  }
  .stories-dot {
    width: 0.8rem; height: 0.8rem;
    border-radius: 50%;
    border: none;
    background: var(--border);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
  }
  .stories-dot.active { background: var(--primary); transform: scale(1.3); }

  .testimonials-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 1.6rem;
    padding: 0.4rem 0.4rem 0.8rem;
  }
  .testimonials-grid::-webkit-scrollbar { display: none; }
  .tms-card { flex: 0 0 85vw; scroll-snap-align: start; }
  .tms-dots {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 2rem;
  }
  .tms-dot {
    width: 0.8rem; height: 0.8rem;
    border-radius: 50%;
    border: none;
    background: var(--border);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
  }
  .tms-dot.active { background: var(--primary); transform: scale(1.3); }

  /* Break pricing grid out of container so scroll reaches screen edges */
  .section-pricing > .container { overflow: visible; }
  .pricing-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 1.4rem;
    /* left padding = inset for first card; right padding = space after last card */
    padding: 0.8rem 2rem 1.6rem;
    /* break out of container max-width */
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
    box-sizing: border-box;
  }
  .pricing-grid::-webkit-scrollbar { display: none; }
  /* 85vw per card → ~15vw remaining = peek of next card minus gaps */
  .price-card { flex: 0 0 82vw; scroll-snap-align: start; }
  .pricing-dots {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1.6rem;
    margin-bottom: 3.2rem;
  }
  .pricing-dot {
    width: 0.8rem; height: 0.8rem;
    border-radius: 50%;
    border: none;
    background: var(--border);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
  }
  .pricing-dot.active { background: var(--primary); transform: scale(1.3); }

  .how-steps { flex-direction: column; align-items: center; gap: 2.4rem; }
  .how-connector { width: 2px; height: 4rem; flex: none; margin-top: 0; background: linear-gradient(180deg, var(--primary), var(--primary-light)); }
  .how-step p { max-width: 32rem; }

  .cmp-table th, .cmp-table td { padding: 1.2rem 1.4rem; font-size: 1.3rem; }

  .guarantees-grid { grid-template-columns: 1fr; }

  .cta-form-wrap { padding: 2.4rem; }
  .cta-title { font-size: 3rem; }
}

/* ---- Small mobile: 480px ---- */
@media (max-width: 480px) {
  html { font-size: 53.125%; } /* 1rem = 8.5px — keep readable, don't shrink too far */

  .container { padding: 0 1.6rem; }
  .header-inner { padding: 0 1.6rem; }
  .section-hero { padding: 5rem 1.6rem 4rem; }

  .hero-title { font-size: 3.4rem; }
  .section-title { font-size: 2.8rem; }
  .feat-title { font-size: 2.4rem; }

  .hero-visual { display: none; }

  .problems-grid { grid-template-columns: 1fr; }

  .feat-block { padding: 5.6rem 1.6rem; }
  .section-comparison { padding: 5.6rem 1.6rem; }
  .section-how { padding: 5.6rem 1.6rem; }
  .section-stories { padding: 5.6rem 1.6rem; }
  .section-testimonials { padding: 5.6rem 1.6rem; }
  .section-pricing { padding: 5.6rem 1.6rem; }
  .section-cta { padding: 5.6rem 1.6rem; }
  .footer { padding: 4.8rem 1.6rem 2.4rem; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }

  .how-download { flex-direction: column; align-items: center; }
}

/* ---- Feature tab switcher — mobile only ---- */
.feat-tabs { display: none; }

@media (max-width: 768px) {
  .feat-tabs {
    display: flex;
    overflow-x: auto;
    gap: 0.8rem;
    padding: 0 1.6rem 2.4rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }
  .feat-tabs::-webkit-scrollbar { display: none; }

  .feat-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    min-width: 7.2rem;
    padding: 1rem 1.2rem;
    border: 2px solid var(--border);
    border-radius: 1.2rem;
    background: var(--bg-white);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-med);
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, color 0.18s;
  }
  .feat-tab .ionicon { width: 2.2rem; height: 2.2rem; }
  .feat-tab--active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
  }

  /* feat-block panels: hide by default, show active */
  .feat-block[data-feat-panel] { display: none !important; }
  .feat-block[data-feat-panel].feat-panel--active { display: block !important; }

  /* feat-cards-section: hide by default, show when a card tab is active */
  .feat-cards-section { display: none !important; }
  .feat-cards-section.feat-panel--active { display: block !important; padding-top: 0; }
  .feat-cards-section.feat-panel--active .feat-cards-grid { display: block; }

  /* Inside active cards section: hide non-active cards */
  .feat-card[data-feat-panel] { display: none !important; }
  .feat-card[data-feat-panel].feat-panel--active { display: block !important; }
}
