/* ==========================================================================
   CarnetVital — Responsive
   Mobile-first approach with progressive enhancement
   Breakpoints: 375px, 430px, 768px, 1024px, 1440px
   ========================================================================== */

/* ---------- Base (Mobile First — 375px+) ---------- */
@media (max-width: 767px) {
  /* Hide desktop nav, show hamburger */
  .main-nav,
  .header-cta .btn {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  /* Hero */
  .hero {
    padding: calc(var(--header-height) + var(--space-6)) 0 var(--space-7);
  }

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

  .hero-home {
    min-height: auto;
    padding: calc(var(--header-height) + var(--space-5)) 0 var(--space-6);
  }

  .hero-home::before {
    background: linear-gradient(180deg, rgba(247, 252, 254, 0.86) 0%, rgba(247, 252, 254, 0.68) 56%, rgba(247, 252, 254, 0.42) 100%);
  }

  .hero-bg-image {
    object-position: 58% center;
    opacity: 0.76;
  }

  .logo-image-link,
  .brand-logo {
    width: 52px;
    height: 52px;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-copy h1,
  .hero-content h1 {
    font-size: 2.1rem;
  }

  .hero-copy .hero-subtitle,
  .hero-content .hero-subtitle {
    margin: 0 auto var(--space-4);
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-proof {
    justify-content: center;
  }

  .hero-trust {
    flex-direction: column;
    gap: var(--space-2);
    align-items: center;
  }

  /* Phone mockup */
  .phone-mockup {
    width: 260px;
  }

  .phone-frame {
    width: 260px;
    height: 540px;
  }

  /* Section headers */
  .section-header h2 {
    font-size: 1.75rem;
  }

  .section {
    padding: var(--space-7) 0;
  }

  /* Cards grids → single column */
  .cards-grid,
  .cards-grid.two-cols,
  .cards-grid.four-cols {
    grid-template-columns: 1fr;
  }

  .continuity-grid,
  .problem-grid,
  .innovation-layout,
  .journey,
  .patient-doctor-grid,
  .share-panel {
    grid-template-columns: 1fr;
  }

  .innovation-lead h2,
  .patient-doctor-grid h2 {
    font-size: 1.75rem;
  }

  .innovation-card {
    grid-template-columns: 1fr;
  }

  .innovation-card h3,
  .innovation-card p {
    grid-column: auto;
  }

  .innovation-card .card-icon {
    grid-row: auto;
    margin-bottom: var(--space-2);
  }

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

  /* Flow diagram */
  .flow-diagram {
    flex-direction: column;
  }

  .flow-arrow {
    transform: rotate(90deg);
  }

  /* Audience */
  .audience-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Security */
  .security-grid {
    grid-template-columns: 1fr;
  }

  /* Values */
  .values-grid {
    grid-template-columns: 1fr;
  }

  /* Dashboard */
  .dashboard-mockup {
    padding: var(--space-3);
  max-width: 100%;
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

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

  /* CTA */
  .cta-section h2 {
    font-size: 1.75rem;
  }

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

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

  /* Page hero */
  .page-hero h1 {
    font-size: 2.25rem;
  }

  /* App buttons */
  .app-buttons {
    flex-direction: column;
  }

  .app-button {
    width: 100%;
    max-width: 240px;
  }

  /* Container */
  .container {
    padding: 0 var(--space-2);
  overflow: hidden;
  }
}

/* ---------- Small mobile (375px and below) ---------- */
@media (max-width: 374px) {
  .hero-content h1 {
    font-size: 1.875rem;
  }

  .hero-copy h1 {
    font-size: 1.875rem;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }

  .page-hero h1 {
    font-size: 1.875rem;
  }

  .phone-mockup {
    width: 240px;
  }

  .phone-frame {
    width: 240px;
    height: 500px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Phablet (430px - 767px) ---------- */
@media (min-width: 430px) and (max-width: 767px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-copy h1 {
    font-size: 2.25rem;
  }

  .cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Tablet (768px - 1023px) ---------- */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-7);
  }

  .hero-copy {
    margin: 0 auto;
    text-align: center;
  }

  .hero-copy .hero-subtitle,
  .hero-content .hero-subtitle {
    margin: 0 auto var(--space-4);
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-proof {
    justify-content: center;
  }

  .problem-grid,
  .innovation-layout,
  .journey,
  .patient-doctor-grid {
    grid-template-columns: 1fr 1fr;
  }

  .innovation-lead,
  .patient-doctor-grid > div:first-child {
    grid-column: 1 / -1;
  }

  .share-panel {
    grid-column: 1 / -1;
  }

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

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

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Desktop (1024px - 1439px) ---------- */
@media (min-width: 1024px) and (max-width: 1439px) {
  .hero-content h1 {
    font-size: 3rem;
  }

  .hero-copy h1 {
    font-size: 2.875rem;
  }
}

/* ---------- Large desktop (1440px+) ---------- */
@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }

  .hero-content h1 {
    font-size: 3.75rem;
  }

  .hero-copy h1 {
    font-size: 3.35rem;
  }
}

/* ---------- Print ---------- */
@media print {
  .site-header,
  .mobile-nav,
  .hamburger,
  .cta-section,
  .site-footer,
  .hero-actions,
  .phone-mockup {
    display: none !important;
  }

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

  body {
    color: #000;
    background: #fff;
  }
}
