/* ===== ITENCEL – IA ===== */

.itc-ai-modal{position:fixed;inset:0;display:none;z-index:9999;}
.itc-ai-modal.is-open{display:flex;align-items:flex-start;justify-content:center;}
.itc-ai-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.45)}
.itc-ai-dialog{
  position:relative; margin: var(--itc-top-gap,84px) 12px 18px;
  max-width:980px; width:clamp(320px,96vw,980px);
  background:#fff;border-radius:16px;box-shadow:0 10px 40px rgba(0,0,0,.28);
  padding:18px 18px 64px; /* espacio para botón cerrar inferior */
  display:flex;flex-direction:column;
  max-height:calc(100vh - var(--itc-top-gap,84px) - 24px); overflow:hidden;
}
.itc-ai-title{margin:2px 0 4px;font-size:18px;font-weight:700}
.itc-ai-sub{margin:0 0 10px;color:#6b7280}

.itc-ai-close{position:absolute;top:10px;right:10px;border:none;background:#f2f3f5;color:#111;
  border-radius:999px;width:32px;height:32px;font-size:16px;cursor:pointer}
.itc-ai-close-bottom{
  position:absolute;right:14px;bottom:14px;border:none;border-radius:999px;
  width:38px;height:38px;background:#111;color:#fff;opacity:.9;cursor:pointer
}
.itc-ai-close:hover,.itc-ai-close-bottom:hover{filter:brightness(.95)}

.itc-ai-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:10px}
.itc-ai-opt{
  display:flex;align-items:center;gap:8px;padding:10px 12px;border:1px solid #e5e7eb;
  border-radius:10px;background:#fafafa;font-weight:600;cursor:pointer;transition:.15s
}
.itc-ai-opt:hover{background:#f5f5ff;border-color:#dfe7ff}
.itc-ai-opt[disabled]{opacity:.5;cursor:not-allowed}
.itc-ai-ico{font-size:16px;line-height:1}

.itc-ai-feedback{
  position:relative;overflow:auto;flex:1 1 auto;border:1px dashed #eef0f4;
  border-radius:10px;padding:12px;background:#fff
}

.itc-ana-card{border:1px solid #e7e9ee;border-radius:10px;padding:14px;background:#fafbfe;margin:0 0 10px}
.itc-ana-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.itc-ana-badge{display:inline-block;padding:4px 8px;border-radius:999px;font-weight:700}
.itc-ana-ok{background:#e9f8ef;color:#167c36}
.itc-ana-mid{background:#fff6e6;color:#a76a00}
.itc-ana-bad{background:#ffe9ea;color:#b02a37}
@media (max-width:700px){
  .itc-ana-grid{grid-template-columns:1fr}
}

.itc-alt-list{margin:0 0 14px 18px}
.itc-alt-title{font-weight:700;color:#c00;text-decoration:none}
.itc-alt-title:hover{text-decoration:underline}
.itc-alt-price{color:#111;margin:3px 0 6px}
.itc-alt-conclusion{border-top:1px dashed #eaeaea;padding-top:10px}

.itc-ai-price-slot .itc-ai-btn,
.itc-ai-btn{
  margin:6px 0 10px;display:inline-flex;align-items:center;gap:6px;background:#eef3ff;color:#2434ff;
  border:1px solid #dfe7ff;padding:6px 10px;font-weight:600;border-radius:8px;cursor:pointer
}
.itc-ai-btn svg{width:16px;height:16px}

/* Cabecera sticky en móvil para dejar espacio al contenido */
@media (max-width:640px){
  .itc-ai-grid{position:sticky;top:0;background:#fff;border-bottom:1px solid #f1f1f3;padding-bottom:8px;z-index:1}
  .itc-ai-dialog{padding:12px 12px 60px}
}

/* Avisos (gate / no-identificado) */
.itc-gate{text-align:center}
.itc-gate .itc-btn{display:inline-block;margin:6px 6px 0;padding:10px 14px;border-radius:10px;border:1px solid #e5e7eb;background:#fafafa;color:#111;text-decoration:none;font-weight:700}
.itc-gate .itc-btn-primary{background:#111;color:#fff;border-color:#111}
.itc-gate small{display:block;margin-top:6px;color:#6b7280}




/* == Overrides UI – evitar solape con el header == */
:root{
  /* Ajusta a tu gusto: 90px–140px según la altura de tu header */
  --itc-ai-header-offset: 120px;
}

/* Baja el modal y calcula alturas máximas en función del offset */
.itc-ai-modal .itc-ai-dialog{
  margin-top: var(--itc-ai-header-offset) !important;
}
@supports (height: 100dvh){
  .itc-ai-modal .itc-ai-dialog{
    max-height: calc(100dvh - var(--itc-ai-header-offset) - 60px) !important;
  }
  .itc-ai-modal .itc-ai-feedback{
    /* deja aire para título, botones y margen */
    max-height: calc(100dvh - var(--itc-ai-header-offset) - 160px) !important;
  }
}

/* En móvil deja un pelín más de hueco arriba */
@media (max-width: 640px){
  .itc-ai-modal .itc-ai-dialog{
    margin-top: calc(var(--itc-ai-header-offset) + 4px) !important;
  }
  .itc-ai-modal .itc-ai-feedback{
    max-height: calc(100dvh - var(--itc-ai-header-offset) - 150px) !important;
  }
}





/* == Botonera compacta en móvil == */
@media (max-width: 640px){
  .itc-ai-grid{
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 8px !important;
    /* sticky para que los botones queden a la vista mientras haces scroll del contenido */
    position: sticky;
    top: 0; /* respeta el padding superior del dialog calculado antes */
    background: #fff;
    padding: 6px 6px 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
    z-index: 2;
  }
  .itc-ai-opt{
    padding: 10px 12px !important;
    font-size: 15px !important;
    line-height: 1.15 !important;
    border-radius: 10px !important;
  }
  .itc-ai-ico{ font-size: 16px !important; }
  .itc-ai-title{ font-size: 16px !important; margin: 0 0 4px !important; }
  .itc-ai-sub{ font-size: 13px !important; margin: 0 0 6px !important; }
}


