/* ============================================================
   SONOMA CONSULTING — RESPONSIVE
   Breakpoints: 320 | 576 | 768 | 1024 | 1280 | 1920
   ============================================================ */

/* ── Extra Large (1920px+) ────────────────────────────────── */
@media (min-width: 1920px) {
  .hero h1 { font-size: 4.25rem; }
  .hero-subtitle { font-size: 1.25rem; }
}

/* ── Large (1280px+) ──────────────────────────────────────── */
@media (min-width: 1280px) {
  .proceso-timeline::before { display: block; }
}

/* ── Tablet & Below (1024px-) ─────────────────────────────── */
@media (max-width: 1024px) {
  :root { --space-section: 4rem; }

  .portal-layout { grid-template-columns: 220px 1fr; }
  .portal-sidebar { position: relative; height: auto; }

  .proceso-timeline::before { display: none; }
  .proceso-step,
  .proceso-step:nth-child(even) { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .proceso-step-card { width: 100%; }

  .hero { min-height: 90vh; }
  .hero-visual { display: none; }
}

/* ── Tablet (768px) ───────────────────────────────────────── */
@media (max-width: 768px) {
  .stat3-bar { flex-direction: column; }
  :root {
    --space-section: 3rem;
    --fs-h1: 2rem;
    --fs-h2: 1.625rem;
    --fs-h3: 1.25rem;
  }

  /* Navbar */
  .navbar-sonoma { padding: 0.75rem 0; }
  .navbar-sonoma.scrolled { padding: 0.5rem 0; }

  .navbar-collapse {
    background: var(--white);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-modal);
    padding: 1rem 0;
    margin-top: 0.5rem;
  }

  .nav-link { color: var(--gray-800) !important; padding: 0.75rem 1.5rem !important; }
  .nav-link::after { left: 1.5rem; right: 1.5rem; }
  .navbar-cta { margin: 0.75rem 1.5rem; display: block; text-align: center; }

  /* Hero */
  .hero {
    min-height: 100vh;
    background: linear-gradient(150deg, rgba(0,102,204,0.95) 0%, rgba(0,30,80,0.92) 100%),
                url('https://images.unsplash.com/photo-1497366216548-37526070297c?w=800&q=85&auto=format&fit=crop') center/cover no-repeat;
  }

  .hero-content { text-align: center; }
  .hero-eyebrow { justify-content: center; }
  .hero-subtitle { margin: 0 auto var(--space-2xl); text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-trust { justify-content: center; }
  .hero-trust-item { font-size: 0.75rem; }

  /* Sections */
  .section-wrapper { padding: 3rem 0; }

  /* Stat divider */
  .stat-divider { display: none; }

  /* Blog list card */
  .blog-list-card { flex-direction: column; }
  .blog-list-img { width: 100%; height: 200px; }

  /* Portal */
  .portal-layout { grid-template-columns: 1fr; }

  .portal-sidebar {
    height: auto;
    position: relative;
  }

  .portal-nav { display: flex; overflow-x: auto; padding: 0.5rem; gap: 0.25rem; }
  .portal-nav-item { flex-shrink: 0; border-left: none; border-bottom: 3px solid transparent; padding: 0.625rem 1rem; border-radius: var(--radius-md); }
  .portal-nav-item.active { border-bottom-color: var(--color-primary); border-left: none; }

  .ticket-row { grid-template-columns: 1fr auto; }
  .ticket-row .ticket-id,
  .ticket-row .ticket-fecha { display: none; }

  /* Footer */
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-social { justify-content: center; }

  .step-connector { width: 40px; }
}

/* ── Mobile (576px) ───────────────────────────────────────── */
@media (max-width: 576px) {
  :root { --fs-h1: 1.75rem; }

  .hero h1 { font-size: 2rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .btn-sonoma { width: 100%; justify-content: center; }

  .hero-trust { gap: var(--space-md); }
  .hero-trust-item span:last-child { display: none; }

  .hero-card .d-flex { flex-direction: column; }
  .hero-divider { display: none; }

  .form-container { padding: var(--space-xl); }

  .wizard-progress { gap: 0; overflow-x: auto; }
  .step-connector { width: 24px; }

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

  .portal-content { padding: var(--space-md); }

  .caso-metrics { grid-template-columns: repeat(3, 1fr); }
  .caso-metric-number { font-size: 1.25rem; }

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

  .footer-legal { flex-wrap: wrap; justify-content: center; gap: var(--space-md); }

  /* "SAP Business One" no se separa (nbsp en los títulos): reducimos el tamaño
     del título del hero en móvil para que el nombre completo quepa en una sola
     línea sin provocar scroll horizontal. */
  .hero-mk-title,
  .hero-inner-mk-title { font-size: clamp(2rem, 9vw, 2.75rem); }
}

/* ── Extra Small (375px) ──────────────────────────────────── */
@media (max-width: 375px) {
  .hero h1 { font-size: 1.625rem; }
  .service-checkbox-card { padding: var(--space-md); }
  .wizard-progress { justify-content: flex-start; padding: 0 var(--space-md); }
  .step-label { display: none; }
  .calendar-day { font-size: 0.75rem; }
}

/* ── Print ────────────────────────────────────────────────── */
/* =====================================================================
   PROPUESTA — correcciones móviles de sonoma.mx (diagnóstico 2026-11-11)
   NO APLICADO. Pegar al final de css/responsive.css, ANTES de @media print.
   Cada bloque lleva la clave del diagnóstico (C1, C2…).
   ===================================================================== */

/* C1 · Desborde horizontal de 12px: el gutter de .g-5 (3rem) no cabe en el
   padding de 12px del .container en celular. */
@media (max-width: 575.98px) {
  .row.g-5 { --bs-gutter-x: 1.5rem; }
}

/* C2 · Animaciones AOS fade-left / fade-right: antes de animar desplazan la
   columna 100px a los lados y ensanchan la página (el menú queda fuera).
   En celular y tableta se animan hacia arriba. */
@media (max-width: 991.98px) {
  [data-aos="fade-left"]:not(.aos-animate),
  [data-aos="fade-right"]:not(.aos-animate) { transform: translate3d(0, 40px, 0); }
}

/* C4 · Botón flotante de WhatsApp tapa "Términos y Condiciones" al final. */
@media (max-width: 767.98px) {
  .whatsapp-float { width: 48px; height: 48px; right: 16px; bottom: 16px; font-size: 1.375rem; }
  .footer-bottom { padding-bottom: 72px; }
}

/* C5 · Pie: iconos sociales centrados mientras todo lo demás va a la izquierda.
   (Sustituye la regla .footer-social { justify-content: center; } existente
   dentro de @media (max-width: 768px), línea ~101.) */
@media (max-width: 768px) {
  .footer-social { justify-content: flex-start; }
}

/* C7 · Objetivos táctiles chicos (pie, breadcrumb, "Visitar sitio web", "O llámanos"). */
@media (max-width: 768px) {
  .footer-link { display: inline-block; padding: 0.4rem 0; }
  .footer-legal a { display: inline-block; padding: 0.5rem 0.25rem; }
  .footer-social-btn { width: 44px; height: 44px; }
  .breadcrumb-mk a { display: inline-block; padding: 0.5rem 0; }
  .service-card .service-link,
  .cta-mk-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0.5rem 0; }
}

/* C8 · Letra de 10–11px (eyebrows, etiquetas de la barra de clientes, badges). */
@media (max-width: 575.98px) {
  .card > .eyebrow, .tb1-label, .trust-bar-label, .badge-pill { font-size: 0.75rem; }
}

/* C9 · Títulos del CTA final con <br> fijo: quedan palabras sueltas en un renglón. */
@media (max-width: 575.98px) {
  .cta-mk-title br { display: none; }
  .cta-mk-title { font-size: clamp(1.75rem, 8vw, 2.25rem); text-wrap: balance; }
}

/* C10 · Tarjetas que giran solo con el mouse ("Pasa el mouse" / "Voltea"):
   en pantallas táctiles se muestran frente y reverso apilados, sin giro. */
@media (hover: none), (max-width: 768px) {
  .s4-wrapper { height: auto !important; perspective: none; }
  .s4-inner, .s4-wrapper:hover .s4-inner { transform: none !important; height: auto; display: flex; flex-direction: column; }
  .s4-front, .s4-back { position: relative; height: auto; transform: none; backface-visibility: visible; -webkit-backface-visibility: visible; }
  .s4-front { border-radius: 14px 14px 0 0; padding: 1.25rem 1rem 0.75rem; }
  .s4-front small { display: none; }
  .s4-back { border-radius: 0 0 14px 14px; padding: 1rem 1rem 1.25rem; }
}

/* C11 · Tabla comparativa (servidores-cloud-sap): la columna "Cloud Sonoma" queda cortada. */
@media (max-width: 575.98px) {
  .table-responsive > .table th,
  .table-responsive > .table td { padding: 0.75rem 0.5rem !important; font-size: 0.8125rem; vertical-align: middle; }
  .table-responsive > .table th:first-child { width: 34% !important; }
}

/* C12 · index: propuestas de valor repetidas en el hero (fila gris + lista amarilla). */
@media (max-width: 991.98px) {
  .hero-mk-content .hero-mk-trust { display: none; }
}

/* C13 · index: los dos botones del hero quedan desparejos. */
@media (max-width: 575.98px) {
  .hero-mk-actions { flex-direction: column; gap: 0.75rem; }
  .hero-mk-actions .btn-mk-primary,
  .hero-mk-actions .btn-mk-ghost { display: block; width: 100%; text-align: center; padding: 0.9rem 1.25rem; }
}

/* C14 · index (tableta): paso 5 solo y garantías a una columna. Va con selector
   más específico porque el <style id="sn-bloques"> de index.html se carga después. */
@media (min-width: 601px) and (max-width: 900px) {
  .sn-steps .sn-step:last-child { grid-column: 1 / -1; max-width: 50%; margin: 0 auto; }
  div.sn-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* C15 · sap-que-es: "On-premise & Cloud" se parte en 3 renglones en la tarjeta de cifras. */
@media (max-width: 414px) {
  .section-wrapper--gray .row.g-3 > .col-6 > .card.border-0.p-4 { padding: 1.25rem 0.75rem !important; }
}

/* C16 · Barra de cifras (.stat3-bar) apilada en una columna muy alta en tableta. */
@media (max-width: 768px) {
  .stat3-bar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; padding: 1.75rem 1.25rem; }
  .stat3-bar .num { font-size: 1.75rem; line-height: 1.15; }
}
@media (max-width: 375px) {
  .stat3-bar .num { font-size: 1.5rem; }
}

/* C17 · contacto: el formulario no aparece al cargar (scroll-reveal con columna muy alta). */
@media (max-width: 991.98px) {
  .scroll-reveal { opacity: 1; transform: none; }
}

/* C18 · contacto: tarjeta de datos con padding de escritorio (3rem) en celular. */
@media (max-width: 576px) {
  .contact-info-card { padding: var(--space-lg, 1.5rem); }
  .contact-info-card .contact-item { gap: 0.75rem; }
}

/* C19 · soporte (y páginas con el mismo bloque): h2 pegado al párrafo. */
.section-wrapper .col-lg-6 > h2 { margin-bottom: var(--space-md); }

/* C20 · aviso-privacidad / terminos: ~112px en blanco arriba y ~144px abajo. */
@media (max-width: 768px) {
  .legal-content { padding: 0.5rem 0 1.5rem; }
  .legal-content h2 { margin-top: 2.25rem; }
}

/* C21 · clientes: franja gris bajo la foto del hero (la imagen trae blanco abajo).
   Lo correcto es recortar el 7% inferior de hero-clientes-*; mientras tanto: */
.hero-mk-bg { overflow: hidden; }
.hero-mk-bg img[src*="hero-clientes"] { height: calc(100% / 0.92); object-position: center top; }


@media print {
  .navbar-sonoma,
  .whatsapp-float,
  .scroll-progress,
  .footer { display: none !important; }

  body { font-size: 12pt; }
  h1, h2, h3 { page-break-after: avoid; }
  .hero { min-height: auto; background: none; color: black; padding: 1rem 0; }
  .hero h1, .hero-subtitle { color: black; }
}

/* Barra de cifras con número impar de datos (Nosotros e Implementación tienen 3): el último ocupa todo el ancho en tableta. */
@media (max-width: 768px) {
  .stat3-bar .item:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
