/* Hotspots de colección — Homiture. Mobile-first: bottom sheet; ≥768px: popover. */

.homiture-hs {
	position: relative;
	display: block;
	margin: 0 auto 2rem;
	max-width: 100%;
}

.homiture-hs__render {
	width: 100%;
	height: auto;
	display: block;
	border-radius: var(--wp--custom--radius--md, 10px);
}

/* --- Puntos: cuadro "+" oscuro (estilo referencia) --- */
.homiture-hs__point {
	position: absolute;
	transform: translate(-50%, -50%);
	width: 26px;
	height: 26px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 7px;
	background: #26251f;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
	z-index: 2;
}

.homiture-hs__point::before {
	content: "+";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 600;
	line-height: 1;
}

.homiture-hs__point:focus-visible {
	outline: 3px solid rgba(255, 255, 255, .85);
	outline-offset: 2px;
}

.homiture-hs__point.is-active {
	background: #0f6e56;
	transform: translate(-50%, -50%) scale(1.08);
}

/* Resaltado desde el listado de "What's included": el usuario pasa el cursor
   por un renglón y el punto correspondiente se hace notar. */
.homiture-hs__point.is-linked {
	background: #0f6e56;
	transform: translate(-50%, -50%) scale(1.25);
	box-shadow: 0 0 0 6px rgba(15, 110, 86, .28), 0 2px 8px rgba(0, 0, 0, .35);
}

.homiture-hs__pulse {
	position: absolute;
	inset: -5px;
	border-radius: 9px;
	border: 2px solid #fff;
	opacity: .5;
	animation: homiture-hs-pulse 2.4s infinite;
}

@keyframes homiture-hs-pulse {
	0%   { transform: scale(.82); opacity: .55; }
	70%  { transform: scale(1.5); opacity: 0; }
	100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.homiture-hs__pulse { animation: none; }
}

/* --- Panel (móvil: bottom sheet) --- */
.homiture-hs__sheet {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 96; /* por encima de la barra flotante del detalle (90) */
	max-height: 62vh;
	overflow: auto;
	padding: 1.1rem 1.25rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
	background: #fff;
	color: #222;
	border-radius: 16px 16px 0 0;
	box-shadow: 0 -8px 30px rgba(0, 0, 0, .22);
}

.homiture-hs__close {
	position: absolute;
	right: .6rem;
	top: .4rem;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 0;
	background: none;
	font-size: 1.6rem;
	line-height: 1;
	color: #888;
	cursor: pointer;
}

/* Foto del mueble. Clicable para ver en grande (lightbox). */
.homiture-hs__zoom {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
	border-radius: 10px;
	margin-bottom: .85rem;
}
.homiture-hs__zoom::after {
	content: '⤢';
	position: absolute;
	right: .5rem;
	bottom: .5rem;
	width: 1.7rem;
	height: 1.7rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: rgba(23, 26, 25, .72);
	color: #fff;
	font-size: .95rem;
	line-height: 1;
	opacity: 0;
	transition: opacity .2s ease;
}
.homiture-hs__zoom:hover::after,
.homiture-hs__zoom:focus-visible::after { opacity: 1; }
@media (hover: none) {
	.homiture-hs__zoom::after { opacity: .9; }
}

.homiture-hs__photo {
	width: 100%;
	height: auto;
	max-height: 260px;
	object-fit: cover;
	border-radius: 10px;
	display: block;
}

/* ---- Varias tomas del mismo mueble ----
 * El marco solo aparece cuando el item tiene más de una foto; con una sola,
 * el JS no crea ni flechas ni contador y esto no pinta nada. */
.homiture-hs__stage { position: relative; }
.homiture-hs__shotnav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.8rem;
	height: 1.8rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: #222826;
	font-size: 1.15rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 1px 6px rgba(0, 0, 0, .22);
	opacity: .55;
	transition: opacity .2s ease, background .2s ease;
}
.homiture-hs__shotnav--prev { left: .35rem; }
.homiture-hs__shotnav--next { right: .35rem; }
.homiture-hs__stage:hover .homiture-hs__shotnav,
.homiture-hs__shotnav:focus-visible { opacity: 1; }
.homiture-hs__shotnav:hover { background: #fff; }
@media (hover: none) {
	.homiture-hs__shotnav { opacity: .92; }
}
/* A la IZQUIERDA: la esquina derecha ya la ocupa el icono de ampliar (⤢). */
.homiture-hs__shotcount {
	position: absolute;
	left: .5rem;
	bottom: .5rem;
	z-index: 2;
	padding: .05rem .4rem;
	border-radius: 999px;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: .68rem;
	font-weight: 600;
	line-height: 1.5;
	pointer-events: none;
}

/* --- Lightbox de la foto del mueble --- */
.homiture-hs__lightbox {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	background: rgba(18, 20, 19, .82);
}
.homiture-hs__lightbox[hidden] { display: none; }
/* 80% del viewport, no 92%: en móvil la ficha del mueble llegaba casi al borde
   y se "rompía" contra el botón de cerrar y el borde de la pantalla. Dejar el
   20% de aire alrededor permite ver la imagen completa y da dónde tocar para
   cerrar. `object-fit: contain` evita que un render muy vertical se recorte. */
.homiture-hs__lightbox img {
	max-width: min(900px, 80vw);
	max-height: 80vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
.homiture-hs__lightbox-close {
	position: absolute;
	top: 1rem;
	right: 1.25rem;
	width: 2.5rem;
	height: 2.5rem;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	font-size: 1.8rem;
	line-height: 1;
	cursor: pointer;
}
.homiture-hs__lightbox-close:hover { background: rgba(255, 255, 255, .26); }
body.homiture-hs-zoom { overflow: hidden; }

.homiture-hs__meta {
	display: flex;
	align-items: center;
	gap: .5rem;
	margin-bottom: .35rem;
}

.homiture-hs__qty {
	font-size: .72rem;
	font-weight: 600;
	line-height: 1;
	color: #0f6e56;
	background: #e1f5ee;
	border-radius: 20px;
	padding: .28rem .55rem;
}

.homiture-hs__inc {
	display: inline-flex;
	align-items: center;
	gap: .25rem;
	font-size: .78rem;
	color: #0f6e56;
}

.homiture-hs__title {
	margin: .15rem 0 0;
	font-weight: 600;
}

.homiture-hs__note {
	margin: .35rem 0 0;
	color: #666;
	font-size: .95rem;
}

/* --- Desktop: popover anclado al punto ---
 * Puede salirse del marco del render (el visor ya no recorta): lo que importa
 * es que quepa en el viewport y que no tape la barra flotante de total. */
@media (min-width: 768px) {
	.homiture-hs__sheet--popover {
		position: absolute;
		right: auto;
		bottom: auto;
		width: 300px;
		max-width: min(340px, calc(100vw - 2rem));
		max-height: none;
		border-radius: 14px;
		padding: 0.9rem 1rem 1rem;
		transform: translate(18px, -50%);
		box-shadow: 0 8px 30px rgba(0, 0, 0, .22);
		z-index: 60; /* sobre la escena; la barra flotante (90) se oculta sola */
	}

	/* Punto en la mitad derecha: el popover se abre hacia la izquierda. */
	.homiture-hs__sheet--flip {
		transform: translate(calc(-100% - 18px), -50%);
	}

	/* Ajuste vertical cuando el punto está muy arriba / muy abajo. */
	.homiture-hs__sheet--top { transform: translate(18px, 0); }
	.homiture-hs__sheet--top.homiture-hs__sheet--flip { transform: translate(calc(-100% - 18px), 0); }
	.homiture-hs__sheet--bottom { transform: translate(18px, -100%); }
	.homiture-hs__sheet--bottom.homiture-hs__sheet--flip { transform: translate(calc(-100% - 18px), -100%); }

	.homiture-hs__sheet--popover .homiture-hs__photo {
		max-height: 180px;
	}

	.homiture-hs__sheet--popover .homiture-hs__note {
		font-size: .85rem;
	}
}

/* Mientras un popover está abierto, la barra de total se aparta: nunca debe
 * tapar la ficha del mueble que el usuario acaba de abrir. */
body.homiture-hs-open .estilo-bar {
	transform: translate(-50%, calc(100% + 24px)) !important;
	pointer-events: none;
}
