.hyv-ai-root,
.hyv-ai-root * { box-sizing: border-box; }

.hyv-ai-root {
    --hyv-ai-primary: #171717;
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.hyv-ai-launcher {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--hyv-ai-primary);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(0,0,0,.25);
    transition: transform .2s ease, box-shadow .2s ease;
}
.hyv-ai-launcher:hover { transform: translateY(-2px); box-shadow: 0 15px 36px rgba(0,0,0,.3); }
.hyv-ai-launcher svg { width: 27px; fill: currentColor; }
.hyv-ai-launcher__close { display: none; font-size: 34px; font-weight: 300; line-height: 1; }
.hyv-ai-root.is-open .hyv-ai-launcher svg { display: none; }
.hyv-ai-root.is-open .hyv-ai-launcher__close { display: block; }

.hyv-ai-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(390px, calc(100vw - 28px));
    height: min(620px, calc(100vh - 115px));
    min-height: 430px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 20px;
    box-shadow: 0 24px 65px rgba(0,0,0,.25);
    animation: hyvAiIn .2s ease-out;
}
.hyv-ai-panel:not([hidden]) { display: flex; flex-direction: column; }
@keyframes hyvAiIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.hyv-ai-header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 15px 16px;
    background: var(--hyv-ai-primary);
    color: #fff;
}
.hyv-ai-avatar { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: rgba(255,255,255,.16); font-weight: 800; }
.hyv-ai-header strong { display: block; font-size: 15px; line-height: 1.25; color: inherit; }
.hyv-ai-header span { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12px; opacity: .88; }
.hyv-ai-header span i { width: 7px; height: 7px; border-radius: 50%; background: #56db79; }
.hyv-ai-close { margin-left: auto; padding: 5px 7px; border: 0; background: transparent; color: #fff; cursor: pointer; font-size: 28px; line-height: 1; }

.hyv-ai-messages { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 14px 8px; background: #f6f7f8; }
.hyv-ai-message { display: flex; flex-direction: column; align-items: flex-start; margin: 0 0 13px; }
.hyv-ai-message.is-user { align-items: flex-end; }
.hyv-ai-message > div:first-child,
.hyv-ai-bubble { max-width: 88%; padding: 11px 13px; border-radius: 15px; font-size: 14px; line-height: 1.48; overflow-wrap: anywhere; }
.hyv-ai-message.is-user > div { background: var(--hyv-ai-primary); color: #fff; border-bottom-right-radius: 4px; }
.hyv-ai-message.is-assistant .hyv-ai-bubble { background: #fff; color: #222; border: 1px solid rgba(0,0,0,.07); border-bottom-left-radius: 4px; }
.hyv-ai-bubble p { margin: 0 0 8px; }
.hyv-ai-bubble p:last-child { margin-bottom: 0; }
.hyv-ai-bubble ul { margin: 7px 0 0 18px; }

.hyv-ai-products { width: 100%; display: grid; gap: 9px; margin-top: 9px; }
.hyv-ai-product { display: grid; grid-template-columns: 76px 1fr; min-height: 94px; overflow: hidden; background: #fff; border: 1px solid rgba(0,0,0,.09); border-radius: 13px; color: #202124; text-decoration: none !important; transition: border-color .2s, transform .2s; }
.hyv-ai-product:hover { border-color: var(--hyv-ai-primary); transform: translateY(-1px); }
.hyv-ai-product img { width: 76px; height: 100%; min-height: 94px; object-fit: cover; background: #eee; }
.hyv-ai-product__body { display: flex; flex-direction: column; align-items: flex-start; padding: 9px 11px; }
.hyv-ai-product__body strong { display: -webkit-box; overflow: hidden; font-size: 13px; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.hyv-ai-product__price { margin-top: 4px; color: #111; font-size: 13px; font-weight: 700; }
.hyv-ai-product__status { margin-top: 4px; padding: 2px 7px; border-radius: 999px; background: #e9f7ed; color: #19723a; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.hyv-ai-product__status.is-out_of_stock { background: #f5e9e9; color: #a12626; }
.hyv-ai-product__status.is-preorder { background: #fff1d5; color: #8a5700; }
.hyv-ai-product__body em { margin-top: auto; padding-top: 5px; color: var(--hyv-ai-primary); font-size: 11px; font-style: normal; font-weight: 700; }

.hyv-ai-whatsapp { display: inline-flex; align-items: center; justify-content: center; margin-top: 9px; padding: 10px 14px; border-radius: 10px; background: #25d366; color: #fff !important; font-size: 13px; font-weight: 700; text-decoration: none !important; }

.hyv-ai-typing { display: flex; align-items: center; gap: 4px; padding: 8px 16px; background: #f6f7f8; color: #6d7075; font-size: 11px; }
.hyv-ai-typing span { width: 6px; height: 6px; border-radius: 50%; background: #92969d; animation: hyvAiDot 1.2s infinite; }
.hyv-ai-typing span:nth-child(2) { animation-delay: .15s; }
.hyv-ai-typing span:nth-child(3) { animation-delay: .3s; }
.hyv-ai-typing em { margin-left: 4px; font-style: normal; }
@keyframes hyvAiDot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-3px); opacity: 1; } }

.hyv-ai-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 11px 7px; border-top: 1px solid rgba(0,0,0,.08); background: #fff; }
.hyv-ai-form textarea { flex: 1; min-height: 42px; max-height: 110px; padding: 10px 12px; resize: none; border: 1px solid #d9dce1; border-radius: 12px; outline: none; background: #fff; color: #222; font: inherit; font-size: 14px; line-height: 1.4; }
.hyv-ai-form textarea:focus { border-color: var(--hyv-ai-primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--hyv-ai-primary) 15%, transparent); }
.hyv-ai-form button { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border: 0; border-radius: 12px; background: var(--hyv-ai-primary); color: #fff; cursor: pointer; }
.hyv-ai-form button:disabled { opacity: .55; cursor: wait; }
.hyv-ai-form button svg { width: 20px; fill: currentColor; }
.hyv-ai-privacy { display: block; padding: 0 12px 9px; background: #fff; color: #8a8d91; text-align: center; font-size: 9px; }
.hyv-ai-honeypot { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

@media (max-width: 600px) {
    .hyv-ai-root { right: 14px; bottom: 14px; }
    .hyv-ai-panel { position: fixed; inset: 0; width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0; }
    .hyv-ai-root.is-open .hyv-ai-launcher { display: none; }
    .hyv-ai-header { padding-top: max(14px, env(safe-area-inset-top)); }
    .hyv-ai-form { padding-bottom: max(7px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
    .hyv-ai-panel, .hyv-ai-launcher, .hyv-ai-product, .hyv-ai-typing span { animation: none; transition: none; }
}

/* Controles conversacionales añadidos en v1.2.0 */
.hyv-ai-header__identity { min-width: 0; }
.hyv-ai-menu {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    margin-left: auto;
    padding: 7px;
    border: 0;
    border-radius: 9px;
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
}
.hyv-ai-menu:hover { background: rgba(255,255,255,.2); }
.hyv-ai-menu:disabled { opacity: .5; cursor: wait; }
.hyv-ai-menu svg { width: 18px; fill: currentColor; }
.hyv-ai-close { margin-left: 0; }

.hyv-ai-suggestions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 9px;
}
.hyv-ai-suggestions button {
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid #d7dbe0;
    border-color: color-mix(in srgb, var(--hyv-ai-primary) 35%, #d7dbe0);
    border-radius: 999px;
    background: #fff;
    color: var(--hyv-ai-primary);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    transition: background .18s, color .18s, transform .18s;
}
.hyv-ai-suggestions button:hover {
    transform: translateY(-1px);
    background: var(--hyv-ai-primary);
    color: #fff;
}
.hyv-ai-suggestions button:disabled {
    opacity: .45;
    cursor: default;
    transform: none;
}
