/* Agente IRT · interfaz basada en el diseño de la Fase 2 (colores y tipografías del sitio de la Corporación). */
:root {
  --navy: #002234; --deep: #17384B; --teal: #0D6876; --blue: #0070BB; --orange: #FE9C1B;
  --green: #90B92C; --mint: #EAF1EE; --paper: #F9FAF9; --line: #E2E9E6; --muted: #5A6E79;
  --white: #fff; --radius: 18px; --shadow: 0 14px 40px rgba(0, 34, 52, .12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--navy); font-family: 'Hanken Grotesk', system-ui, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* ---------- encabezado ---------- */
.site-header { height: 80px; background: #fff; display: flex; align-items: center; gap: 22px; padding: 0 clamp(16px, 5vw, 72px); position: sticky; top: 0; z-index: 30; border-bottom: 1px solid rgba(0,34,52,.08); }
.brand img { display: block; width: 170px; height: auto; }
.proto-tag { font-size: 12px; font-weight: 700; color: var(--teal); background: var(--mint); padding: 6px 10px; border-radius: 999px; }
.affiliate { margin-left: auto; background: var(--navy); color: #fff; border: 0; padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.screen { display: none; }
.screen.active { display: block; }

/* ---------- pantalla 1 ---------- */
.hero { min-height: calc(100vh - 80px); background: linear-gradient(90deg, rgba(0,34,52,.9), rgba(0,34,52,.35)), url('https://corporacionturisticaurabadariencaribe.com/wp-content/uploads/2026/09/MUTATA-1-1024x682.jpeg') center/cover, var(--navy); position: relative; }
.hero-content { max-width: 1240px; margin: 0 auto; padding: 70px 28px 80px; display: grid; grid-template-columns: 1fr 1.12fr; gap: 64px; align-items: center; }
.hero-copy { color: #fff; max-width: 540px; }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; font-weight: 700; font-size: 12px; color: #f7d67e; }
.hero-copy h1 { font-family: 'Sora', sans-serif; font-size: clamp(40px, 5.5vw, 70px); line-height: 1.04; margin: 18px 0; }
.hero-copy h1 span { color: var(--orange); }
.hero-copy p { font-size: 19px; line-height: 1.55; color: rgba(255,255,255,.9); }
.mini-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.mini-tags button { border: 1px solid rgba(255,255,255,.55); color: #fff; padding: 9px 14px; border-radius: 999px; background: rgba(255,255,255,.08); }
.mini-tags button:hover { background: rgba(255,255,255,.2); }
.agent-panel { background: #fff; border-radius: 26px; padding: 28px; box-shadow: 0 25px 60px rgba(0,0,0,.22); }
.panel-head { display: flex; align-items: center; gap: 14px; }
.agent-icon { width: 50px; height: 50px; border-radius: 16px; background: var(--orange); display: grid; place-items: center; color: #fff; font-size: 26px; font-weight: 700; flex: 0 0 50px; }
.panel-head h2 { font-family: 'Sora', sans-serif; margin: 0; font-size: 22px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.online { margin-left: auto; color: #4e6b4d; font-size: 12px; font-weight: 700; white-space: nowrap; }
.online i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c9c9c9; margin-right: 5px; }
.online.ok i { background: #22c55e; }
.online.error { color: #b42318; }
.online.error i { background: #b42318; }
.textarea-wrap { display: block; margin-top: 22px; }
.textarea-wrap textarea { width: 100%; min-height: 112px; resize: vertical; border: 1px solid #cfd9d6; border-radius: 16px; padding: 15px 16px; outline: none; color: var(--navy); }
.textarea-wrap textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(13,104,118,.1); }
.suggestions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.suggestions button { border: 0; background: var(--mint); color: var(--deep); padding: 9px 12px; border-radius: 999px; font-size: 12.5px; text-align: left; }
.suggestions button:hover { background: #d9e8e2; }
.preference-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.preference-grid label { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.preference-grid label span { font-size: 12px; font-weight: 700; color: var(--deep); }
.preference-grid select { border: 1px solid #cfd9d6; border-radius: 12px; padding: 12px 13px; color: var(--navy); background: #fff; min-width: 0; }
.primary-action { width: 100%; border: 0; background: var(--orange); color: #fff; padding: 15px 20px; border-radius: 999px; font-weight: 700; margin-top: 18px; text-decoration: none; display: inline-block; text-align: center; }
.primary-action:hover { filter: brightness(.96); }
.primary-action span { font-size: 18px; margin-left: 8px; }
.form-error { color: #b42318; font-size: 13px; margin: 12px 0 0; }

/* ---------- pantalla 2 ---------- */
.page-wrap { max-width: 1240px; margin: 0 auto; padding: 30px 28px 70px; }
.top-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.back-link { border: 0; background: transparent; color: var(--teal); font-weight: 700; padding: 8px 0; }
.result-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; }
.result-meta select { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.ask-again { display: flex; gap: 10px; margin: 16px 0 0; }
.ask-again input { flex: 1; min-width: 0; border: 1px solid #cfd9d6; border-radius: 999px; padding: 12px 18px; }
.ask-again button { border: 0; background: var(--navy); color: #fff; border-radius: 999px; padding: 12px 20px; font-weight: 700; }
.analysis-box { display: flex; gap: 14px; align-items: flex-start; background: #fff; border-left: 5px solid var(--orange); border-radius: 12px; padding: 18px; margin: 18px 0 26px; box-shadow: 0 6px 20px rgba(0,34,52,.06); }
.analysis-icon { width: 35px; height: 35px; flex: 0 0 35px; border-radius: 10px; background: #fff0df; color: var(--orange); display: grid; place-items: center; font-weight: 800; }
.analysis-body { min-width: 0; flex: 1; }
.analysis-body > p { margin: 4px 0 0; font-size: 16px; line-height: 1.55; }
.detalle-texto { background: var(--paper); border-radius: 12px; padding: 14px 16px; margin-top: 12px; }
.detalle-texto h4 { margin: 0 0 6px; font-family: 'Sora', sans-serif; font-size: 15px; }
.detalle-texto p { margin: 0; white-space: pre-line; color: var(--deep); line-height: 1.6; font-size: 14px; }
.detalle-texto small { display: block; margin-top: 8px; color: var(--muted); }
.notas { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.notas:empty { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chips:empty { display: none; }
.chip { font-size: 12px; border-radius: 999px; padding: 5px 10px; background: var(--mint); color: var(--deep); }
.chip.lugar { background: #e6f1fa; color: #0b4f80; }
.chip.excluido { background: #fdecea; color: #8a1c13; text-decoration: line-through; }
.chip b { font-weight: 700; }

.results-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; }
.results-layout.sin-filtros { grid-template-columns: minmax(0, 1fr); }
.results-layout.sin-filtros .filters { display: none; }
.filters, .result-card, .provider-box, .detail-main, .detail-media { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.filters { padding: 18px; height: max-content; position: sticky; top: 100px; }
.filters h3 { font-family: 'Sora', sans-serif; font-size: 17px; margin: 0 0 6px; }
.filter-group { padding-top: 14px; border-top: 1px solid var(--line); margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.filter-group h4 { margin: 0 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.filter-group label { font-size: 13px; color: var(--deep); display: flex; gap: 8px; align-items: center; }
.legend { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; font-size: 12px; color: var(--muted); }
.legend p { margin: 4px 0; display: flex; align-items: center; gap: 6px; }
.star { color: var(--orange); font-size: 15px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.comp { background: var(--teal); }

.seccion { margin-bottom: 34px; }
.seccion-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.section-title { font-family: 'Sora', sans-serif; font-size: 26px; margin: 0; }
.seccion.secundaria .section-title { font-size: 21px; }
.seccion-total { color: var(--muted); font-size: 13px; white-space: nowrap; }
.seccion-desc { color: var(--muted); margin: 4px 0 14px; font-size: 14px; }
.alerta-alternativa { background: #fff4e7; border-radius: 12px; padding: 10px 14px; font-size: 14px; color: var(--deep); margin: 6px 0 14px; }
.cards-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 14px; }
.vacio { color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 14px; padding: 18px; margin-top: 12px; }
.mas { margin: 16px auto 0; display: block; background: #fff; border: 2px solid var(--teal); color: var(--teal); border-radius: 999px; padding: 10px 20px; font-weight: 700; }

.result-card { overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 10px 28px rgba(0,34,52,.07); position: relative; }
.result-card.destacado { border-color: #ffd39a; }
.card-media { height: 170px; position: relative; background: linear-gradient(135deg, var(--teal), var(--navy)); }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-media .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.92); font-family: 'Sora', sans-serif; font-size: 40px; font-weight: 700; letter-spacing: .02em; }
.card-media.destino { background: linear-gradient(135deg, #0D6876, #0070BB); }
.card-media.evento { background: linear-gradient(135deg, #FE9C1B, #c0561a); }
.card-media.actividad, .card-media.servicio, .card-media.tipo_experiencia { background: linear-gradient(135deg, #90B92C, #0D6876); height: 90px; }
.card-badges { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; color: #fff; font-size: 11px; font-weight: 700; background: var(--deep); }
.badge.afiliado { background: var(--orange); }
.badge.complementaria { background: var(--teal); }
.badge.clase { background: rgba(0,34,52,.75); }
.badge.parcial { background: #fff; color: var(--deep); }
.card-body { padding: 16px; display: flex; flex-direction: column; flex: 1; gap: 6px; }
.card-body h3 { font-family: 'Sora', sans-serif; font-size: 18px; line-height: 1.22; margin: 2px 0 0; }
.card-sub { color: var(--teal); font-weight: 700; font-size: 13px; margin: 0; }
.location { color: var(--muted); font-size: 13px; margin: 0; }
.card-desc { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 4px 0 0; }
.relevancia { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.relevancia .barra { flex: 1; height: 6px; border-radius: 999px; background: var(--mint); overflow: hidden; }
.relevancia .barra i { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.relevancia .valor { font-weight: 700; min-width: 40px; text-align: right; }
.porque { background: #fff7ec; border-radius: 10px; padding: 10px 12px; margin-top: 6px; font-size: 12.5px; color: var(--deep); }
.porque summary { cursor: pointer; font-weight: 700; color: var(--deep); }
.porque ul { margin: 6px 0 0; padding-left: 16px; line-height: 1.5; }
.card-actions { margin-top: auto; padding-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.outline-action, .solid-action { flex: 1; text-align: center; text-decoration: none; border-radius: 999px; padding: 10px 14px; font-weight: 700; font-size: 13.5px; }
.outline-action { background: #fff; border: 2px solid var(--teal); color: var(--teal); }
.solid-action { background: var(--teal); border: 2px solid var(--teal); color: #fff; }
.outline-action:hover { background: var(--mint); }
.provider-box .perfil-prestador { display: block; margin: 8px 0 14px; }

.followups { margin-top: 8px; }
.followups h3 { font-family: 'Sora', sans-serif; font-size: 17px; margin: 0; }
.method { margin-top: 26px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.method summary { cursor: pointer; font-weight: 700; color: var(--deep); }

/* ---------- pantalla 3 ---------- */
.detail-wrap { padding-top: 18px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) 340px; gap: 24px; align-items: start; margin-top: 10px; }
.detail-hero { border-radius: var(--radius); overflow: hidden; height: 300px; position: relative; background: linear-gradient(135deg, var(--teal), var(--navy)); margin-bottom: 18px; }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-hero .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-family: 'Sora', sans-serif; font-size: 64px; font-weight: 700; }
.detail-main { padding: 24px; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-main h2 { font-family: 'Sora', sans-serif; font-size: 32px; line-height: 1.15; margin: 14px 0 6px; }
.detail-location { color: var(--teal); font-weight: 700; margin: 0 0 12px; }
.detail-main p.texto { color: var(--deep); line-height: 1.65; white-space: pre-line; }
.detail-main p.texto.entrada { font-size: 17px; font-weight: 600; color: var(--navy); }
.bloque { margin-top: 20px; }
.bloque h4 { font-family: 'Sora', sans-serif; margin: 0 0 8px; font-size: 16px; }
.bloque p { margin: 0; white-space: pre-line; line-height: 1.6; color: var(--deep); font-size: 14px; }
.lista-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.experiencia-item { background: var(--paper); border-radius: 12px; padding: 14px; margin-top: 10px; }
.experiencia-item h5 { margin: 0 0 4px; font-family: 'Sora', sans-serif; font-size: 15px; }
.experiencia-item p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.provider-box { padding: 20px; position: sticky; top: 100px; }
.provider-box h3 { font-family: 'Sora', sans-serif; font-size: 17px; margin: 0 0 14px; }
.provider-row { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.provider-avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 800; flex: 0 0 46px; }
.provider-row strong, .provider-row span { display: block; }
.provider-row span { font-size: 12px; color: var(--muted); margin-top: 2px; }
.contacto { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13.5px; }
.contacto li { padding: 7px 0; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.contacto li b { min-width: 86px; color: var(--muted); font-weight: 600; }
.contacto a { color: var(--blue); word-break: break-all; }
.fuentes { font-size: 12px; color: var(--muted); margin-top: 18px; line-height: 1.5; }
.fuentes a { color: var(--blue); word-break: break-all; }

.loader { position: fixed; inset: 0; background: rgba(249,250,249,.75); display: grid; place-content: center; justify-items: center; z-index: 50; color: var(--deep); font-weight: 700; }
.loader[hidden] { display: none; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--mint); border-top-color: var(--orange); animation: girar 0.9s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.site-footer { padding: 26px clamp(16px, 5vw, 72px); color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); background: #fff; }

@media (max-width: 1050px) {
  .hero-content { grid-template-columns: 1fr; gap: 32px; }
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout { grid-template-columns: 1fr; }
  .provider-box { position: static; }
}
@media (max-width: 760px) {
  .site-header { height: 68px; padding: 0 16px; gap: 10px; }
  .brand img { width: 130px; }
  .proto-tag { display: none; }
  .hero-content { padding: 40px 16px 56px; }
  .agent-panel { padding: 20px; }
  .preference-grid { grid-template-columns: 1fr; }
  .page-wrap { padding: 20px 16px 50px; }
  .results-layout { grid-template-columns: 1fr; }
  .filters { position: static; order: 2; }
  .cards-grid { grid-template-columns: 1fr; }
  .top-row { flex-wrap: wrap; }
  .section-title { font-size: 22px; }
  .detail-main h2 { font-size: 26px; }
  .detail-hero { height: 220px; }
}

/* Modo incrustado (iframe del shortcode [agente_irt] en WordPress): el sitio ya muestra su propia cabecera,
 * así que la del agente sobra («Nueva consulta» ya está en las pantallas de resultados y detalle). La consulta
 * empieza y termina con el hero, pegada al header y al pie del sitio: el aviso de la ontología va dentro del
 * hero (.hero-nota) y en las demás pantallas queda sobre el mismo fondo, sin franja blanca. */
.incrustado .site-header { display: none; }
/* Dentro del iframe, 100vh es la altura del propio iframe: usarla haría crecer el marco sin fin. */
.incrustado .hero { min-height: 0; }
.incrustado .hero-content { padding-bottom: 44px; }
.hero-nota { display: none; }
.incrustado .hero-nota { display: block; max-width: 1240px; margin: 0 auto; padding: 0 28px 24px; color: rgba(255,255,255,.72); font-size: 12.5px; line-height: 1.5; }
.incrustado[data-pantalla="consulta"] .site-footer { display: none; }
.incrustado .site-footer { background: transparent; border-top: 0; padding-top: 0; }
@media (max-width: 760px) {
  .incrustado .hero-content { padding-bottom: 32px; }
  .incrustado .hero-nota { padding: 0 16px 20px; }
}
