/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */

/* Accordion chevron: hidden by default — only shown on mobile (≤580px) */
.card-chevron { display: none; }

/* Pilares nav arrows — desktop: hidden */
.pilares-nav { display: none; }

/* ── Navbar: selector de idioma antes de Contacto (mobile + tablet vertical) ── */
@media (max-width: 1024px) {
  .nav-cta { order: 1; }
}

/* ── Tablet vertical (≤ 900px) ─────────── */
@media (max-width: 900px) {
  :root { --pad: 32px; }

  .nav-links {
    gap: 15px;
}

  /* Navbar: hide middle links, keep logo + CTA */
  .nav-links a:not(.nav-cta) { display: none; }

  /* All slides: clear navbar (≈64px) */
  #s0 { padding-bottom: 36px; }

  /* Servicios / Software cards: 2 cols grid */
  .modules-grid { grid-template-columns: repeat(2,1fr); }

  /* S2 Proceso: keep 3 cols on tablet — only collapses on mobile */

  /* S4 Pilares: vertical layout on tablet */
  #s4 { flex-direction: column; align-items: stretch; overflow-y: auto; overflow-x: hidden; }

  .mc-left {
    width: 100%; padding: 80px var(--pad) 20px;
    flex-direction: column; min-height: auto;
    position: relative;
  }
  /* heading flows normally when columns stack */
  .mc-head { position: static; left: auto; right: auto; top: auto; padding-bottom: 16px;}
  
  /* Orb: centered between meta and (hidden) list */
  .mc-center {
    width: 100%; height: 200px;
    flex-shrink: 0;
  }
  /* Hide the right list — active meta already shows current item */
  .mc-right { display: none; }
  .mc-active-meta { margin-top: 0px; }
  .mc-active-desc { max-width: 100%; }
  /* fix slide counter overlapping */
  .slide-counter { left: 14px; }

  /* Dot nav: hide on small screens */
  .dot-nav { display: none; }

  /* S4 Pilares: hide dots, show arrow nav */
  .mc-dots { display: none; }
  .pilares-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 1.25rem;
    margin: 28px 0;
  }
  .pilares-nav__btn {
    background: transparent;
    border: 1.5px solid var(--amber);
    border-radius: 50%;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--amber);
    transition: background 0.2s;
  }
  .pilares-nav__btn:hover,
  .pilares-nav__btn:active { background: rgba(255,140,0,.12); }
  .pilares-nav__btn:disabled { opacity: 0.3; cursor: not-allowed; }
  .pilares-nav__counter {
    font-size: 0.85rem; color: var(--amber);
    font-family: var(--mono); font-variant-numeric: tabular-nums;
  }

  /* S5 Contacto: stack columns in DOM order (wrap → form → quick) */
  .cta-grid {
    grid-template-columns: 1fr;
    grid-template-areas: none;
    gap: 32px;
  }
  .cta-wrap, .cta-form, .cta-quick { grid-area: auto; }
}

/* ── Mobile (≤ 580px) ──────────────────── */
@media (max-width: 580px) {
  :root { --pad: 20px; }

  /* Navbar logo: slightly smaller on mobile */
  .logo-img { height: 26px; }

  /* Navbar clearance: top-aligned content slides */
  .cw { padding-top: 76px; }

  /* Slides: allow scroll when content exceeds viewport */
  .slide { overflow-y: auto; height: 100vh; }

  /* Hero */
  .hero-title-v2 { font-size: clamp(60px, 18vw, 90px); padding: 0 var(--pad); }
  .hero-bottom { padding-left: var(--pad); padding-right: var(--pad); }
  .hero-tagline { font-size: 14px; max-width: 100%; }
  .hero-actions { flex-direction: column; width: 100%; }
  .btn-hero { width: 100%; justify-content: center; }
  /* Hero: more bottom clearance so ghost button isn't cut off */
  #s0 { padding-bottom: 60px; }

  /* Servicios / Software cards: 1 col, compacted */
  .modules-grid { grid-template-columns: 1fr; gap: 0; margin-top: 20px; }
  .module-card { padding: 20px 16px; }
  .slide-title { font-size: clamp(28px, 8vw, 42px); }
  .slide-sub { margin-bottom: 28px; }

  /* Proceso mobile: timeline vertical */
  .steps {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 28px;
    position: relative;
  }

  /* Línea vertical — override del display:none del bloque anterior */
  .steps::before {
    display: block;
    position: absolute;
    left: 14px;
    top: 30px;
    bottom: 30px;
    width: 1px;
    height: auto;
    background: rgba(255,140,0,.2);
  }

  /* Cada step: grid de 2 cols (círculo | texto) */
  .step {
    display: grid;
    grid-template-columns: 30px 1fr;
    grid-template-rows: auto auto;
    column-gap: 14px;
    padding: 0;
    position: relative;
  }

  /* Círculo con número — ocupa ambas filas */
  .step-num {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: start;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,140,0,.5);
    background: rgba(255,140,0,.06);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Título alineado a la altura del círculo */
  .step-title {
    grid-column: 2;
    grid-row: 1;
    line-height: 30px;
  }

  /* Descripción debajo del título */
  .step-desc {
    grid-column: 2;
    grid-row: 2;
    margin-top: 4px;
  }

  /* Hide giant decorative "04" number in background */
  #s3 > div[style*="200px"] { display: none; }

  /* S3 Pilares */
  .mc-left { padding-top: 72px; padding-bottom: 12px; }
  .mc-center { height: 260px; }
  .mc-active-name { font-size: 22px; }
  .mc-active-desc { font-size: 13px; }

  /* S5 Contacto */
  #s5 { padding-top: 76px; padding-bottom: 32px; }
  .cta-grid { gap: 16px; }
  .cta-title { font-size: clamp(32px, 9vw, 52px); }
  .cta-row { flex-direction: column; }
  .cta-sub { font-size: 14px; }
  #s5 .cta-form textarea { height: 100px; min-height: 70px; resize: none; }
  .cta-badge, .slide-label{    margin-bottom: 5px;}

  /* Counter/progress */
  .slide-counter { display: none; }
  .progress-bar { width: 1px; }

  /* ── Mobile accordion: module cards (#s1 / #s2) ── */
  /* collapsed */
  .module-card { cursor: pointer; }
  .card-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .35s ease, opacity .2s ease;
  }
  /* expanded */
  .module-card.open .card-body {
    max-height: 350px;
    opacity: 1;
  }
  /* chevron button */
  .card-chevron {
    display: block;
    position: absolute;
    top: 20px;
    right: 16px;
    background: none;
    border: none;
    padding: 4px;
    color: rgba(255,255,255,.3);
    cursor: pointer;
    transition: transform .35s ease, color .2s ease;
    z-index: 1;
    line-height: 0;
  }
  .module-card.open .card-chevron {
    transform: rotate(180deg);
    color: var(--amber);
  }
}

/* ── Phone (< 500px) ───────────────────── */
@media (max-width: 499px) {
  /* Pilares: shrink orb to free vertical space */
  .mc-center     { height: 180px; }
  .mc-float-wrap { width: 160px; height: 160px; }

  /* Pilares: flow nav arrows as normal block — no overlap */
  .pilares-nav {
    position: static;
    margin-top: 20px;
    margin-bottom: 12px;
    z-index: auto;
  }

  /* Pilares: flow CONTACTANOS button below arrows — no absolute overlap */
  .mc-skip {
    display: none;
    /* position: static;
    transform: none;
    align-self: center;
    margin-top: 8px; */
  }
}
