/* =========================================================
   HULTEC — Chatbot
   Usa las variables de hultec.css (--hx-navy, --hx-red, etc.)
   ========================================================= */
.hxc { position: fixed; right: 24px; bottom: 24px; z-index: 2500; font-family: var(--ff-body); }

/* Botón flotante: solo icono. Bloque rojo con contorno blanco
   para que destaque igual sobre secciones blancas, azules o rojas. */
.hxc-fab {
    position: relative; display: flex; margin-left: auto; padding: 0; cursor: pointer;
    width: 60px; height: 60px; align-items: center; justify-content: center;
    background: var(--hx-red); color: #fff; border: 2px solid #fff;
    box-shadow: 0 12px 28px rgba(14, 11, 63, .35);
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.hxc-fab:hover { background: var(--hx-red-dark); transform: translateY(-3px); box-shadow: 0 18px 36px rgba(14, 11, 63, .4); }
.hxc-fab:focus-visible { outline: 3px solid var(--hx-navy); outline-offset: 3px; }
.hxc-fab-icon { display: flex; align-items: center; justify-content: center; }
.hxc-fab-icon svg { display: block; }
.hxc-fab .hxc-ico-close { display: none; }
.hxc.is-open .hxc-fab .hxc-ico-chat { display: none; }
.hxc.is-open .hxc-fab .hxc-ico-close { display: block; }
.hxc-dot { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; border-radius: 50%; background: var(--hx-navy); border: 2px solid #fff; }

/* Panel */
.hxc-panel {
    position: absolute; right: 0; bottom: 74px; width: 380px; height: min(620px, calc(100vh - 120px));
    background: #fff; display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 24px 60px rgba(14, 11, 63, .28); border: 1px solid var(--hx-line);
    animation: hxc-in .25s ease;
}
.hxc-panel[hidden] { display: none; }
@keyframes hxc-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.hxc-head { background: var(--hx-navy); color: #fff; display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; flex: none; }
.hxc-avatar { width: 40px; height: 40px; flex: none; background: var(--hx-red); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--ff-display); font-weight: 700; font-size: 22px; }
.hxc-head-txt { flex: 1; min-width: 0; }
.hxc-head h2 { margin: 0; font-family: var(--ff-display); font-weight: 700; font-size: 20px; letter-spacing: .04em; text-transform: uppercase; line-height: 1.1; color: #fff; }
.hxc-status { display: block; font-family: var(--ff-mono); font-size: 11px; color: var(--hx-on-navy-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hxc-status.is-on::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; margin-right: 6px; vertical-align: 1px; }
.hxc-head button { width: 40px; height: 40px; flex: none; border: 0; background: transparent; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: .85; }
.hxc-head button:hover { opacity: 1; background: rgba(255, 255, 255, .1); }

/* Mensajes */
.hxc-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; background: var(--hx-paper); display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; overscroll-behavior: contain; }
.hxc-msg { max-width: 88%; padding: 11px 14px; font-size: 14.5px; line-height: 1.5; word-wrap: break-word; }
.hxc-msg ul { margin: 8px 0 0; padding-left: 18px; }
.hxc-msg li { margin-bottom: 3px; }
.hxc-msg li::marker { color: var(--hx-red); }
.hxc-msg a { color: var(--hx-navy); font-weight: 500; }
.hxc-msg small { color: var(--hx-muted-2); }
.hxc-bot { align-self: flex-start; background: #fff; color: var(--hx-text); border: 1px solid var(--hx-line); }
.hxc-user { align-self: flex-end; background: var(--hx-navy); color: #fff; }

.hxc-links { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.hxc-link {
    display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px;
    background: var(--hx-red); color: #fff !important; text-decoration: none;
    font-family: var(--ff-display); font-weight: 600 !important; font-size: 15px; letter-spacing: .06em; text-transform: uppercase;
}
.hxc-link:hover { background: var(--hx-red-dark); }

.hxc-typing { display: flex; gap: 5px; padding: 14px 16px; }
.hxc-typing span { width: 7px; height: 7px; border-radius: 50%; background: #a9a7c4; animation: hxc-dot 1s infinite ease-in-out; }
.hxc-typing span:nth-child(2) { animation-delay: .15s; }
.hxc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes hxc-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }

/* Sugerencias */
.hxc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; background: var(--hx-paper); flex: none; }
.hxc-chips:empty { display: none; }
.hxc-chip {
    border: 1px solid var(--hx-navy); background: #fff; color: var(--hx-navy); padding: 7px 12px; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: background-color .15s, color .15s; line-height: 1.2;
}
.hxc-chip:hover { background: var(--hx-navy); color: #fff; }

/* Entrada */
.hxc-form { display: flex; border-top: 1px solid var(--hx-line); flex: none; }
.hxc-form input { flex: 1; min-width: 0; border: 0; padding: 0 16px; height: 54px; font: inherit; font-size: 15px; color: var(--hx-ink); background: #fff; }
.hxc-form input:focus { outline: none; box-shadow: inset 0 -2px 0 var(--hx-navy); }
.hxc-form button { width: 56px; border: 0; background: var(--hx-red); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.hxc-form button:hover { background: var(--hx-red-dark); }
.hxc-foot { margin: 0; padding: 7px 16px 9px; font-size: 11px; color: var(--hx-muted-2); background: #fff; text-align: center; flex: none; }

/* Teléfono: panel a pantalla completa */
@media (max-width: 575.98px) {
    .hxc { right: 16px; bottom: 16px; }
    .hxc-fab { width: 56px; height: 56px; }
    .hxc-panel { position: fixed; inset: 0; width: auto; height: auto; border: 0; animation: none; }
    .hxc.is-open .hxc-fab { display: none; }
    .hxc-form input { font-size: 16px; } /* evita el zoom automático en iOS */
}

@media (prefers-reduced-motion: reduce) {
    .hxc-panel { animation: none; }
    .hxc-typing span { animation: none; opacity: .7; }
}
@media print { .hxc { display: none; } }

/* Miniaturas de producto dentro del chat */
.hxc-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.hxc-thumbs a { display: block; background: var(--hx-photo); aspect-ratio: 7 / 5; overflow: hidden; }
.hxc-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.hxc-thumbs a:hover img { transform: scale(1.06); }
.hxc-found { list-style: none; padding: 0 !important; margin: 8px 0 0; }
.hxc-found li { padding: 6px 0; border-bottom: 1px solid #eeece6; }
.hxc-found li:last-child { border-bottom: 0; }
.hxc-found li::marker { content: ''; }
.hxc-found small { display: block; font-family: var(--ff-mono); font-size: 11px; color: var(--hx-red); }
