/* Sección "Vivo en el exterior" · Alejandro Isla
   Capa aparte: usa los tokens y componentes de styles.css / secciones.css / page-motion.css.
   No modifica nada de lo existente. */

/* ---------- Botón del encabezado ---------- */
.topbar-main .ext-nav {
  min-height: 44px;
  padding: 0 16px 0 13px;
  gap: 8px;
  border-color: color-mix(in srgb, var(--accent-2) 70%, rgba(255, 255, 255, 0.3));
  background: color-mix(in srgb, var(--accent-2) 18%, rgba(255, 255, 255, 0.1));
  color: #fff;
  font: 800 0.86rem/1 var(--body-font);
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 24px rgba(0, 0, 0, 0.14);
}
.topbar-main .ext-nav svg { width: 18px; height: 18px; color: var(--accent-2); stroke-width: 2.1; }
.topbar-main .ext-nav:hover,
.topbar-main .ext-nav:focus-visible { background: color-mix(in srgb, var(--accent-2) 30%, rgba(255, 255, 255, 0.12)); }

/* ---------- Bloque router en las páginas actuales ---------- */
.ext-router {
  order: 4;
  width: min(1180px, calc(100% - 44px));
  margin-inline: auto;
  padding: 18px 0 30px;
}
.ext-router .value-landscape-group { margin-top: 4px; }
.ext-router .value-group-heading p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 28ch;
}
.ext-router .value-card ul,
.ext-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.ext-router .value-card ul li,
.ext-list li {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.ext-router .value-card ul li::before,
.ext-list li::before {
  content: "";
  flex: 0 0 7px;
  height: 7px;
  margin-top: 0.5em;
  border-radius: 50%;
  background: var(--accent-2);
}

/* ---------- Landings /exterior/ ---------- */
body.ext-page .hero-lede { max-width: 60ch; }
body.ext-page .neighborhoods::before { content: none; }
body.ext-page .neighborhoods .chip { cursor: default; gap: 7px; }
body.ext-page .neighborhoods .chip svg { width: 16px; height: 16px; color: var(--accent-2); }
body.ext-page h1 .ext-pill {
  display: inline-block;
  padding: 0 0.16em;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  font-style: normal;
}

/* Orden de secciones en las landings */
.ext-section {
  width: min(1180px, calc(100% - 44px));
  margin-inline: auto;
  padding: 58px 0 6px;
}
.ext-section.ext-tight { padding-top: 34px; }
body.ext-page .proof-strip { order: 2; }
body.ext-page .ext-section,
body.ext-page .advisor-banner,
body.ext-page .authority-section { order: 3; }

.ext-section .value-report-grid { margin-top: 6px; }
.ext-section .value-report-card p { margin: 0; }

/* Formulario del hero: teléfono internacional */
.ext-phone {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 8px;
}
.ext-phone select { min-width: 0; }
.ext-consent {
  display: flex !important;
  flex-direction: row !important;
  gap: 9px;
  align-items: flex-start;
  font-size: 0.76rem !important;
  font-weight: 500 !important;
  line-height: 1.45;
  color: var(--muted);
}
.ext-consent input { width: 16px !important; min-height: 16px !important; height: 16px; margin-top: 2px; accent-color: var(--accent); flex: 0 0 16px; }
.ext-consent a { color: var(--accent); }
.ext-form-error { display: none; margin: 4px 0 0; color: #a3342b; font-size: 0.8rem; font-weight: 700; }
.ext-form-error.is-on { display: block; }

/* Aviso de transparencia */
.ext-notice {
  margin-top: 22px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 20px 22px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-2);
  box-shadow: 0 14px 34px rgba(23, 32, 42, 0.06);
}
.ext-notice svg { width: 26px; height: 26px; color: var(--accent-2); }
.ext-notice p { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.6; }
.ext-notice strong { color: var(--ink); }

/* Checklist (mismo componente visual que "Trabajo en equipo") */
.ext-check .sx-team { margin-top: 4px; }
.ext-check-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.ext-check-actions .value-button { width: auto; min-height: 44px; padding: 0 16px; }
.ext-check-group { margin: 14px 0 6px; font: 850 0.74rem/1 var(--body-font); text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-2); }

/* Preguntas frecuentes */
.ext-faq-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.ext-faq-tabs .chip { color: var(--accent); background: #fff; border: 1px solid var(--line); backdrop-filter: none; }
.ext-faq-tabs .chip.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.ext-faq { display: grid; gap: 10px; }
.ext-faq details {
  background: linear-gradient(135deg, #ffffff, color-mix(in srgb, var(--barrio-color) 4%, #fff));
  border: 1px solid color-mix(in srgb, var(--barrio-color) 14%, var(--line));
  border-radius: 8px;
  padding: 0 20px;
  transition: box-shadow 200ms ease, border-color 200ms ease;
}
.ext-faq details[open] { border-color: color-mix(in srgb, var(--accent-2) 55%, var(--line)); box-shadow: 0 14px 34px rgba(23, 32, 42, 0.07); }
.ext-faq summary {
  cursor: pointer;
  list-style: none;
  position: relative;
  padding: 17px 34px 17px 0;
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1.35;
}
.ext-faq summary::-webkit-details-marker { display: none; }
.ext-faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-52%);
  font: 400 1.6rem/1 var(--display-font);
  color: var(--accent-2);
  transition: transform 220ms ease;
}
.ext-faq details[open] summary::after { transform: translateY(-52%) rotate(45deg); }
.ext-faq details p { margin: 0 0 18px; color: var(--muted); font-size: 0.95rem; line-height: 1.65; }
.ext-faq [hidden] { display: none !important; }
.ext-faq-cat { margin: 18px 0 4px; font: 850 0.74rem/1 var(--body-font); text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }

/* Guías PDF */
.ext-guides { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ext-guide {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: 170px auto;
  border-radius: 10px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--accent-2) 45%, var(--line));
  box-shadow: 0 18px 44px rgba(23, 32, 42, 0.08);
  text-decoration: none;
  color: var(--ink);
}
.ext-guide-cover { position: relative; background: #141a20 var(--img) center/cover no-repeat; }
.ext-guide-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15, 20, 26, 0.1), rgba(15, 20, 26, 0.72)); }
.ext-guide-cover span { position: absolute; left: 16px; bottom: 14px; z-index: 1; color: #fff; font: 600 1.35rem/1.05 var(--display-font); }
.ext-guide-body { padding: 16px 18px 18px; display: grid; gap: 10px; }
.ext-guide-body p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.ext-guide-body .value-button { justify-self: start; width: auto; padding: 0 16px; min-height: 42px; }

/* Barra fija de WhatsApp en celular */
.ext-mobile-bar { display: none; }
@media (max-width: 760px) {
  .ext-mobile-bar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    gap: 8px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(251, 248, 244, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .ext-mobile-bar a {
    flex: 1;
    min-height: 46px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: 900 0.88rem/1 var(--body-font);
    text-decoration: none;
    color: #fff;
  }
  .ext-mobile-bar .is-wa { background: linear-gradient(135deg, #25d366, #128c7e); }
  .ext-mobile-bar .is-form { background: linear-gradient(135deg, #3c5775, #3f5f7f); }
  .ext-mobile-bar img { width: 18px; height: 18px; }
  body.ext-page .floating-whatsapp { display: none; }
  body.ext-page .site-shell { padding-bottom: 96px; }
  .ext-guides { grid-template-columns: 1fr; }
}
@media (max-width: 980px) and (min-width: 761px) {
  .ext-guides { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .topbar-main .ext-nav { min-height: 36px; padding: 0 11px 0 9px; font-size: 0.76rem; }
  .topbar-main .ext-nav svg { width: 15px; height: 15px; }
  .ext-router, .ext-section { width: min(1180px, calc(100% - 32px)); }
  .ext-section { padding-top: 44px; }
  .ext-phone { grid-template-columns: 96px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .ext-faq summary::after { transition: none; }
}

/* Detalles de las landings */
.value-report-card .ext-small { margin-top: 4px; font-size: 0.84rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; }
.value-report-card .ext-small b { color: var(--ink); font-weight: 800; }
.ext-legal { margin-top: 16px !important; font-size: 0.8rem !important; line-height: 1.5 !important; }
.ext-legal a { color: var(--accent); }
.ext-guide.is-main { border-color: var(--accent-2); box-shadow: 0 22px 54px color-mix(in srgb, var(--accent-2) 22%, transparent); }
body.ext-page .value-report-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
body.ext-page .hero-image-a { opacity: 1; }
body.ext-page .ext-points { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
body.ext-page .ext-points .chip { cursor: default; gap: 7px; }
body.ext-page .ext-points .chip svg { width: 16px; height: 16px; color: var(--accent-2); }
.value-report-card .ext-small { grid-column: 1 / -1; }

/* Preguntas agrupadas por tema (acordeón) */
.ext-fgs { display: grid; gap: 10px; }
.ext-fg { background: #fff; border: 1px solid color-mix(in srgb, var(--barrio-color) 14%, var(--line)); border-radius: 10px; overflow: hidden; transition: border-color .25s ease, box-shadow .25s ease; }
.ext-fg.is-open { border-color: color-mix(in srgb, var(--accent-2) 55%, var(--line)); box-shadow: 0 16px 40px rgba(18, 18, 18, .08); }
.ext-fg-head { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 18px; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.ext-fg-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: #fff; transition: background .25s ease; }
.ext-fg.is-open .ext-fg-ic { background: var(--accent-2); }
.ext-fg-ic svg { width: 20px; height: 20px; }
.ext-fg-t b { display: block; font-size: 1.02rem; font-weight: 800; }
.ext-fg-t small { color: var(--muted); font-size: .82rem; font-weight: 600; }
.ext-fg-chev { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); position: relative; transition: transform .3s ease, background .25s ease; }
.ext-fg-chev::before { content: ""; position: absolute; left: 50%; top: 45%; width: 8px; height: 8px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translate(-50%, -50%) rotate(45deg); }
.ext-fg.is-open .ext-fg-chev { transform: rotate(180deg); background: color-mix(in srgb, var(--accent-2) 10%, #fff); }
.ext-fg-body { padding: 0 18px 16px; overflow: hidden; }
.ext-fg-body .ext-faq details { background: var(--paper); }
@media (max-width: 640px) { .ext-fg-head { padding: 12px 14px; gap: 10px; } .ext-fg-ic { width: 36px; height: 36px; } .ext-fg-body { padding: 0 12px 12px; } }

/* Botonera fija: "Exterior" siempre a la vista y destacado */
.bn a[href="#exterior"]:not(.bn-act) { color: #ff4d5e !important; }
.bn a[href="#exterior"]:not(.bn-act) svg { color: #ff4d5e; }
/* En celular la botonera se desliza: "Exterior" queda fijo a la vista */
@media (max-width: 760px) {
  .bn a[href="#exterior"] { position: sticky; left: 0; right: 0; z-index: 4; background: rgba(18, 18, 20, .96); }
}
