/* NH Asistente */
.nha {
	--a-blue: var(--nh-blue, #0054A6); --a-ink: var(--nh-ink, #0F1E33); --a-orange: var(--nh-orange, #F26822);
	--a-mist: var(--nh-mist, #F3F5F8); --a-line: var(--nh-line, #E2E8F0); --a-muted: var(--nh-muted, #5B6878);
	--a-gap: var(--nh-float-gap, 20px); --a-bottom: var(--nh-float-bottom, 20px);
	position: fixed; z-index: 9985; bottom: var(--a-bottom);
	font-family: var(--nh-font-body, system-ui, sans-serif); color: var(--a-ink);
}
.nha--left { left: var(--a-gap); }
.nha--right { right: var(--a-gap); bottom: calc(var(--a-bottom) + 70px); }
.nha .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

/* Botón */
.nha-launch {
	display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px 0 8px; border: 0; border-radius: 999px;
	background: linear-gradient(135deg, #0B63BF, var(--a-blue) 55%, #003E7E); color: #fff; font: inherit; font-weight: 700; font-size: 15px;
	box-shadow: 0 14px 30px -12px rgba(0, 54, 120, .55); cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.nha-launch:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -12px rgba(0, 54, 120, .6); }
.nha-launch:focus-visible { outline: 3px solid var(--a-orange); outline-offset: 3px; }
.nha-launch__ico { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.16); display: grid; place-items: center; color: #FFD9C4; }
.nha-launch__ico svg { animation: nha-twinkle 3.2s ease-in-out infinite; }
@keyframes nha-twinkle { 0%, 80%, 100% { transform: scale(1) rotate(0); } 88% { transform: scale(1.18) rotate(18deg); } }
.nha.is-open .nha-launch { opacity: 0; pointer-events: none; transform: scale(.9); }
.nha-launch.has-dot::after { content: ""; position: absolute; top: 4px; left: 36px; width: 11px; height: 11px; border-radius: 50%; background: var(--a-orange); border: 2px solid #fff; }
.nha-launch { position: relative; }

/* Ventana */
.nha-panel {
	position: absolute; bottom: 0; width: min(410px, calc(100vw - 2 * var(--a-gap))); height: min(640px, calc(100vh - 2 * var(--a-bottom) - 20px));
	display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--a-line); border-radius: 22px;
	box-shadow: 0 30px 70px -20px rgba(15, 30, 51, .45); animation: nha-in .22s cubic-bezier(.2, .8, .2, 1);
}
.nha--left .nha-panel { left: 0; transform-origin: bottom left; }
.nha--right .nha-panel { right: 0; transform-origin: bottom right; }
.nha-panel[hidden] { display: none; }
@keyframes nha-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.nha-head { display: flex; align-items: center; gap: 10px; padding: 14px 12px 14px 16px; background: linear-gradient(135deg, #0B63BF, var(--a-blue) 60%, #003E7E); color: #fff; }
.nha-head__ava { flex: none; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.16); display: grid; place-items: center; color: #FFD9C4; }
.nha-head__t { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.nha-head__t b { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nha-head__t small { font-size: 12.5px; opacity: .85; }
.nha-icon { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer; }
.nha-icon:hover { background: rgba(255,255,255,.16); }
.nha-icon:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

/* Mensajes */
.nha-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 12px; background: #FAFBFD; scroll-behavior: smooth; }
.nha-msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.5; word-wrap: break-word; }
.nha-msg p { margin: 0 0 6px; } .nha-msg p:last-child { margin: 0; }
.nha-msg ul { margin: 4px 0; padding-left: 18px; }
.nha-msg a { color: var(--a-blue); font-weight: 600; }
.nha-msg--bot { align-self: flex-start; background: #fff; border: 1px solid var(--a-line); border-bottom-left-radius: 6px; }
.nha-msg--me { align-self: flex-end; background: var(--a-blue); color: #fff; border-bottom-right-radius: 6px; }
.nha-msg--me a { color: #fff; }
.nha-typing { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 18px; background: #fff; border: 1px solid var(--a-line); color: var(--a-muted); font-size: 13px; }
.nha-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--a-blue); animation: nha-dot 1s infinite ease-in-out; }
.nha-typing i:nth-child(2) { animation-delay: .15s; } .nha-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes nha-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* Tarjetas */
.nha-cards { display: grid; grid-auto-flow: column; grid-auto-columns: 152px; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -14px; padding-inline: 14px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.nha-card { scroll-snap-align: start; display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 10px; border: 1px solid var(--a-line); border-radius: 14px; background: #fff; font-size: 12.5px; }
.nha-card__img { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; background: var(--a-mist); overflow: hidden; margin-bottom: 4px; }
.nha-card__img img { width: 100%; height: 100%; object-fit: contain; padding: 8%; box-sizing: border-box; mix-blend-mode: multiply; }
.nha-card__name { color: var(--a-blue); font-weight: 600; font-size: 13px; line-height: 1.3; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.nha-card__name:hover { text-decoration: underline; }
.nha-card__rate { color: #E89A10; font-size: 12px; letter-spacing: .5px; }
.nha-card__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 6px; }
.nha-card__price b { font-size: 15px; }
.nha-card__price s { color: var(--a-muted); font-size: 11.5px; }
.nha-card__off { color: #CC0C39; font-weight: 700; font-size: 12px; }
.nha-card__out { color: #B6440F; font-weight: 700; }
.nha-card__acts { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: auto; padding-top: 4px; }
.nha-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 32px; padding: 0 10px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 12.5px; text-decoration: none; cursor: pointer; border: 1.5px solid var(--a-blue); }
.nha-btn--add { background: var(--a-orange); border-color: var(--a-orange); color: #fff; }
.nha-btn--add:hover { background: var(--nh-orange-dark, #D9571A); border-color: var(--nh-orange-dark, #D9571A); color: #fff; }
.nha-btn--add.is-done { background: #1B8A5A; border-color: #1B8A5A; }
.nha-btn--add[disabled] { opacity: .7; cursor: default; }
.nha-btn--view { background: #fff; color: var(--a-blue); }
.nha-btn--view:hover { background: var(--a-blue); color: #fff; }

/* Sugerencias */
.nha-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nha-chip { padding: 7px 12px; border: 1.5px solid #BFD6EE; border-radius: 999px; background: #fff; color: var(--a-blue); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.nha-chip:hover { background: var(--a-blue); border-color: var(--a-blue); color: #fff; }
.nha-chip:focus-visible { outline: 2px solid var(--a-orange); outline-offset: 2px; }

/* Escribir */
.nha-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--a-line); background: #fff; }
.nha-form textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; padding: 11px 14px; border: 1.5px solid #CBD5E1; border-radius: 22px; font: inherit; font-size: 15px; line-height: 1.35; color: var(--a-ink); background: var(--a-mist); box-sizing: border-box; }
.nha-form textarea:focus { outline: 0; border-color: var(--a-blue); background: #fff; box-shadow: 0 0 0 3px rgba(0, 84, 166, .12); }
.nha-send { flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--a-orange); color: #fff; display: grid; place-items: center; cursor: pointer; }
.nha-send:hover { background: var(--nh-orange-dark, #D9571A); }
.nha-send[disabled] { opacity: .5; cursor: default; }
.nha-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 14px 10px; background: #fff; font-size: 11.5px; color: var(--a-muted); }
.nha-foot a { flex: none; color: #128C4A; font-weight: 700; text-decoration: none; }
.nha-foot a:hover { text-decoration: underline; }

/* Celular: pantalla completa */
@media (max-width: 600px) {
	.nha--left, .nha--right { bottom: calc(var(--a-bottom) + env(safe-area-inset-bottom, 0px)); }
	.nha--right { bottom: calc(var(--a-bottom) + 66px); }
	.nha-launch { height: 50px; padding: 0 6px; }
	.nha-launch__txt { display: none; }
	.nha.is-open { inset: 0; z-index: 99990; }
	.nha-panel { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; border: 0; animation: nha-up .25s ease; }
	@keyframes nha-up { from { transform: translateY(30px); opacity: 0; } }
	.nha-form textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
	.nha-launch__ico svg, .nha-typing i, .nha-panel { animation: none !important; }
}
.nha-card .added_to_cart { display: none !important; }
.nha-log > * { flex-shrink: 0; }
