/* Botón para subir, WhatsApp flotante y popup */

:root { --nh-float-gap: 20px; --nh-float-bottom: 20px; }

/* --- WhatsApp ----------------------------------------------------------- */
.nh-wa { position: fixed; z-index: 9980; bottom: var(--nh-float-bottom); display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.nh-wa > * { pointer-events: auto; }
.nh-float--right.nh-wa { right: var(--nh-float-gap); align-items: flex-end; }
.nh-float--left.nh-wa { left: var(--nh-float-gap); align-items: flex-start; }
.nh-wa__btn {
	display: inline-flex; align-items: center; gap: 10px; height: 58px; min-width: 58px; box-sizing: border-box;
	padding: 0 14px; border-radius: 999px; background: #25D366; color: #fff; text-decoration: none;
	box-shadow: 0 14px 30px -10px rgba(18, 140, 70, .6); transition: transform .2s, box-shadow .2s;
}
.nh-wa__btn:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -10px rgba(18, 140, 70, .7); color: #fff; }
.nh-wa__btn svg { flex: none; }
.nh-wa__label { font-weight: 700; font-size: 15px; padding-right: 6px; white-space: nowrap; }
.nh-wa__btn::after { /* pulso suave */
	content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
	box-shadow: 0 0 0 0 rgba(37, 211, 102, .5); animation: nh-wa-pulse 2.6s ease-out 3;
}
.nh-wa__btn { position: relative; }
@keyframes nh-wa-pulse { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .55); } 70%, 100% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); } }

.nh-wa__bubble {
	position: relative; max-width: 270px; padding: 14px 34px 14px 16px; border-radius: 18px;
	background: #fff; color: var(--nh-ink); box-shadow: 0 18px 40px -14px rgba(15, 30, 51, .35); border: 1px solid var(--nh-line);
	font-size: 14.5px; line-height: 1.4; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s;
}
.nh-wa__bubble.is-on { opacity: 1; transform: none; }
.nh-wa__bubble p { margin: 0; }
.nh-float--right .nh-wa__bubble { border-bottom-right-radius: 6px; }
.nh-float--left .nh-wa__bubble { border-bottom-left-radius: 6px; }
.nh-wa__bubble-close { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--nh-mist); color: var(--nh-muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 0; }

/* --- Volver arriba ------------------------------------------------------ */
.nh-top {
	position: fixed; z-index: 9979; bottom: var(--nh-float-bottom); width: 50px; height: 50px; border-radius: 50%; padding: 0;
	border: 1px solid var(--nh-line); background: #fff; color: var(--nh-ink); cursor: pointer;
	display: grid; place-items: center; box-shadow: 0 12px 28px -12px rgba(15, 30, 51, .4);
	opacity: 0; transform: translateY(12px) scale(.9); transition: opacity .25s, transform .25s, background .15s, color .15s;
}
.nh-top[hidden] { display: none; }
.nh-top.is-on { opacity: 1; transform: none; }
.nh-top:hover { background: var(--nh-blue); color: #fff; border-color: var(--nh-blue); }
.nh-top:focus-visible { outline: 3px solid var(--nh-teal); outline-offset: 3px; }
.nh-top > svg:not(.nh-top__ring) { transform: rotate(-90deg); }
.nh-float--right.nh-top { right: var(--nh-float-gap); }
.nh-float--left.nh-top { left: var(--nh-float-gap); }
.nh-top--inline { position: relative; bottom: auto; margin: 0 4px; }
.nh-top__ring { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); transform: rotate(-90deg); pointer-events: none; }
.nh-top__ring circle { fill: none; stroke: var(--nh-orange); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .1s linear; }

/* En la ficha de producto, en celular, el botón de agregar va fijo abajo: subimos los flotantes. */
@media (max-width: 767px) {
	:root { --nh-float-gap: 14px; --nh-float-bottom: 16px; }
	.single-product { --nh-float-bottom: 96px; }
	.nh-wa__label { display: none; }
	.nh-wa__btn { width: 56px; height: 56px; min-width: 0; padding: 0; justify-content: center; }
	.nh-top { width: 46px; height: 46px; }
	.nh-hide-mobile { display: none !important; }
	.nh-wa__bubble { max-width: min(270px, calc(100vw - 40px)); }
}

/* --- Popup -------------------------------------------------------------- */
.nh-pop { position: fixed; inset: 0; z-index: 9992; display: grid; place-items: center; padding: 20px; }
.nh-pop[hidden] { display: none; }
.nh-pop__overlay { position: absolute; inset: 0; background: rgba(15, 30, 51, .55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .25s; }
.nh-pop__box {
	position: relative; width: min(820px, 100%); max-height: calc(100vh - 40px); overflow: auto; outline: none;
	display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	background: #fff; color: var(--nh-ink); border-radius: 28px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .5);
	opacity: 0; transform: translateY(16px) scale(.97); transition: opacity .25s, transform .3s cubic-bezier(.2, .8, .2, 1);
}
.nh-pop.is-open .nh-pop__overlay { opacity: 1; }
.nh-pop.is-open .nh-pop__box { opacity: 1; transform: none; }
.nh-pop__close {
	position: absolute; z-index: 2; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
	background: rgba(255, 255, 255, .92); color: var(--nh-ink); display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.nh-pop__close:hover { background: #fff; }
.nh-pop__media { display: block; min-height: 100%; background: var(--nh-sky); }
.nh-pop__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nh-pop__body { padding: 44px 40px 34px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; justify-content: center; }
.nh-pop__eyebrow { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--nh-peach); color: var(--nh-orange-dark); font-size: 13px; font-weight: 700; }
.nh-pop__title { margin: 0; font-size: clamp(26px, 3vw, 36px); line-height: 1.08; color: inherit; }
.nh-pop__text { margin: 0; color: var(--nh-muted); font-size: 16px; line-height: 1.5; }
.nh-pop__coupon {
	display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; padding: 12px 16px; cursor: pointer;
	border: 2px dashed var(--nh-orange); border-radius: 14px; background: #FFF7F2; color: var(--nh-ink); font: inherit; text-align: left;
}
.nh-pop__coupon span { font-size: 12.5px; color: var(--nh-muted); }
.nh-pop__coupon b { flex: 1; font-family: var(--nh-font-display); font-size: 22px; letter-spacing: .06em; }
.nh-pop__coupon em { font-style: normal; font-weight: 700; font-size: 13.5px; color: var(--nh-orange-dark); }
.nh-pop__coupon.is-copied { border-style: solid; border-color: var(--nh-green); background: var(--nh-green-soft); }
.nh-pop__coupon.is-copied em { color: var(--nh-green); }
.nh-pop__btn { width: 100%; box-sizing: border-box; min-height: 52px; font-size: 16px; margin-top: 4px; }
.nh-pop__never { align-self: center; border: 0; background: none; padding: 4px; color: var(--nh-muted); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Variantes */
.nh-pop--noimg .nh-pop__box, .nh-pop--top .nh-pop__box { grid-template-columns: 1fr; width: min(500px, 100%); }
.nh-pop--top .nh-pop__media { aspect-ratio: 16 / 9; min-height: 0; }
.nh-pop--image .nh-pop__box { grid-template-columns: 1fr; width: min(640px, 100%); background: transparent; }
.nh-pop--image .nh-pop__media { background: none; }
.nh-pop--image .nh-pop__media img { height: auto; max-height: calc(100vh - 60px); object-fit: contain; border-radius: 28px; }
.nh-pop--blue .nh-pop__box { background: var(--nh-blue); color: #fff; }
.nh-pop--orange .nh-pop__box { background: var(--nh-orange); color: #fff; }
.nh-pop--ink .nh-pop__box { background: var(--nh-ink); color: #fff; }
.nh-pop--blue .nh-pop__text, .nh-pop--ink .nh-pop__text { color: #C9DBF0; }
.nh-pop--orange .nh-pop__text { color: #FFE3D3; }
.nh-pop--blue .nh-pop__never, .nh-pop--orange .nh-pop__never, .nh-pop--ink .nh-pop__never { color: rgba(255, 255, 255, .75); }
.nh-pop--blue .nh-pop__eyebrow, .nh-pop--orange .nh-pop__eyebrow, .nh-pop--ink .nh-pop__eyebrow { background: rgba(255, 255, 255, .16); color: #fff; }
.nh-pop--orange .nh-pop__btn { background: #fff; color: var(--nh-orange-dark); }
.nh-pop--blue .nh-pop__coupon, .nh-pop--orange .nh-pop__coupon, .nh-pop--ink .nh-pop__coupon { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .6); color: #fff; }
.nh-pop--blue .nh-pop__coupon span, .nh-pop--orange .nh-pop__coupon span, .nh-pop--ink .nh-pop__coupon span,
.nh-pop--blue .nh-pop__coupon em, .nh-pop--orange .nh-pop__coupon em, .nh-pop--ink .nh-pop__coupon em { color: #fff; }

@media (max-width: 767px) {
	.nh-pop { padding: 14px; align-items: end; }
	.nh-pop__box { grid-template-columns: 1fr; border-radius: 24px; max-height: calc(100vh - 28px); }
	.nh-pop--split .nh-pop__media { aspect-ratio: 16 / 9; min-height: 0; }
	.nh-pop__body { padding: 26px 22px 22px; }
	.nh-pop--image { align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
	.nh-wa__btn::after { animation: none; }
	.nh-pop__box, .nh-pop__overlay, .nh-top, .nh-wa__bubble { transition: none; }
}
