/* ==========================================================================
   FAVORITOS DE HECHIZOS — widget hda-productos-tabs (interruptor
   hda_productos_tabs_enabled). Copia del "Hot This Week" de Pebble con la
   marca de Hechizos. Medidas: desarrollo/web/home-pebble.md.
   Especificidad >= (0,2,0) en todo: Astra pinta button/a:hover/:focus, h2 en
   capitalize y .83em, y WooCommerce estiliza .button (gotchas 54, 85, 94).
   ========================================================================== */

.hpt {
	--hpt-brand: #7A0D13;
	--hpt-cream: #FEF3E7;
	--hpt-ink: #2B1520;
	--hpt-rose: #F3DBD7;        /* el rosa de "Comprar Ahora" y "Toque especial" */
	--hpt-sale: #B8143C;        /* el rojo de oferta de la ficha */
	--hpt-display: "Qalogre fit", Georgia, serif;
	--hpt-text: "Founders Grotesk Official", Arial, sans-serif;
	--hpt-bold: "HDA Founders Bold", "Founders Grotesk Official", Arial, sans-serif;
	--hpt-pad: 16px;
	--hpt-gap: 10px;
	--hpt-n: 4;

	display: block;
	background: transparent;
	padding-top: clamp(48px, calc(7.558vw - 9.97px), 100px);
	padding-bottom: 0;
}

.hpt .hpt__wrap { padding-inline: var(--hpt-pad); }

/* En vw y no en %: la variable se usa en el padding del envoltorio (el % se resolvía contra la sección)
   y en el margen negativo de la pista (contra el panel de 1440). Desde ~1540 px no coincidían y la
   pista se cortaba 50 px más allá del contenido: la tarjeta que asoma mostraba 40 px en vez de llegar
   al borde de la ventana como en Pebble (192 px a 1845). */
@media (min-width: 1200px) {
	.hpt { --hpt-pad: max(50px, calc(50vw - 720px)); }
}
.hpt { --hpt-hdr: 136px; }
@media (max-width: 1023.98px) { .hpt { --hpt-hdr: 86px; } }
@media (min-width: 768px) and (max-width: 1199.98px) { .hpt { --hpt-n: 3; } }
@media (max-width: 767.98px) { .hpt { --hpt-gap: 8px; } }

/* ---------- Cabecera ---------- */
.hpt .hpt__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 40px;
}

.hpt .hpt__title {
	margin: 0;
	font-family: var(--hpt-display);
	font-weight: 400;
	font-size: clamp(30px, calc(2.6vw + 10px), 48px);
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	color: var(--hpt-brand);
}

.hpt .hpt__tabs {
	display: flex;
	gap: 8px;
	margin-left: auto;
}

.hpt button.hpt__tab {
	position: relative;
	z-index: 0;
	display: inline-flex;
	align-items: center;
	height: 36px;
	margin: 0;
	padding: 6px 12px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	text-shadow: none;
	color: var(--hpt-brand);
	font-family: var(--hpt-text);
	font-weight: 400;
	font-size: 15px;
	line-height: 24px;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	transition: color .35s;
}

.hpt button.hpt__tab::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	z-index: -1;
	width: 0;
	border-radius: inherit;
	background: var(--hpt-rose);
	transition: width .3s ease;
}

.hpt button.hpt__tab.is-active::before { width: 100%; }
/* La pastilla rosa sola daba 1,2:1 contra el fondo (WCAG 1.4.11 pide 3:1 para el estado): la activa
   lleva además un borde carmesí, y en alto contraste un borde del sistema. */
/* En el ::before (la pastilla), no en el botón: el ::before se pinta encima del fondo del botón. */
.hpt button.hpt__tab.is-active::before { box-shadow: inset 0 0 0 1px var(--hpt-brand); }
@media (forced-colors: active) {
	.hpt button.hpt__tab.is-active { border: 2px solid CanvasText; }
}
.hpt button.hpt__tab:hover,
.hpt button.hpt__tab:focus { background: transparent; color: var(--hpt-brand); }
.hpt button.hpt__tab:focus:not(:focus-visible) { outline: none; }
.hpt button.hpt__tab:focus-visible { outline: 3px solid var(--hpt-brand); outline-offset: 3px; }

@media (hover: hover) and (pointer: fine) {
	.hpt button.hpt__tab:hover::before { width: 100%; }
}

@media (max-width: 767.98px) {
	.hpt .hpt__head { flex-direction: column; align-items: flex-start; margin-bottom: 24px; }
	.hpt .hpt__tabs { margin-left: 0; }
}

/* ---------- Carrusel ---------- */
.hpt .hpt__panel {
	container-type: inline-size;  /* 100cqw = ancho del contenido, sin la barra de scroll (no 100vw) */
}

.hpt .hpt__panel[hidden] { display: none; }

.hpt .hpt__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100cqw - (var(--hpt-n) - 1) * var(--hpt-gap)) / var(--hpt-n));
	column-gap: var(--hpt-gap);
	margin: -8px calc(-1 * var(--hpt-pad));
	padding: 8px var(--hpt-pad);   /* aire para el anillo de foco: overflow-x fuerza overflow-y */
	scroll-padding-inline: var(--hpt-pad);
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
}

.hpt .hpt__track::-webkit-scrollbar { display: none; }

@media (max-width: 767.98px) {
	/* Pebble: 76 % de la PANTALLA (296 px a 390). En celular no hay barra de scroll que estorbe al vw. */
	.hpt .hpt__track { grid-auto-columns: 76vw; }
}

.hpt .hpt__card {
	position: relative;
	min-width: 0;
	scroll-snap-align: start;
}

.hpt a.hpt__add,
.hpt a.hpt__name,
.hpt button.hpt__tab,
.hpt button.hpt__arrow { scroll-margin-top: calc(var(--hpt-hdr) + 16px); }

/* ---------- Foto ---------- */
.hpt .hpt__media {
	position: relative;
	aspect-ratio: 3 / 4;
	border-radius: 20px;
	overflow: hidden;
	-webkit-mask-image: radial-gradient(white, black);
	background: rgba(43, 21, 32, .05);
}

.hpt a.hpt__img-link {
	display: block;
	width: 100%;
	height: 100%;
}

.hpt .hpt__media .hpt__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: 50% 50%;
	border-radius: 0;
	transition: scale .5s cubic-bezier(.3, 1, .3, 1);
}

.hpt .hpt__media .hpt__img--2 { opacity: 0; visibility: hidden; }

/* Zoom, segunda foto y botón: al pasar por la FOTO, no por toda la tarjeta (como Pebble). */
@media (hover: hover) and (pointer: fine) {
	.hpt .hpt__media:hover .hpt__img { scale: 1.05; }
	/* Segunda foto: corte, sin fundido (como Pebble). */
	.hpt .hpt__card--2 .hpt__media:hover .hpt__img--1 { opacity: 0; visibility: hidden; }
	.hpt .hpt__card--2 .hpt__media:hover .hpt__img--2 { opacity: 1; visibility: visible; }
}

/* Revelado de la foto al entrar (solo con JS). */
.hpt.hpt--js .hpt__card:not(.is-in) .hpt__media .hpt__img--1 { opacity: 0; transform: scale(1.15); }
.hpt.hpt--js .hpt__media .hpt__img--1 {
	transition: transform 1.3s cubic-bezier(.16, 1, .3, 1), opacity .3s ease-in-out, scale .5s cubic-bezier(.3, 1, .3, 1);
}

/* ---------- Etiquetas ---------- */
.hpt .hpt__badges {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	padding: 10px;
	pointer-events: none;
}

.hpt .hpt__badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 60px;
	font-family: var(--hpt-bold);
	font-weight: 700;
	font-size: 13px;
	line-height: 21px;
	letter-spacing: normal;
	text-transform: none;
	white-space: nowrap;
}

.hpt .hpt__badge--top { background: var(--hpt-brand); color: var(--hpt-cream); }
.hpt .hpt__badge--sale { background: var(--hpt-sale); color: #fff; }

/* ---------- Botón "Agregar al carrito" ---------- */
.hpt a.hpt__add {
	position: absolute;
	left: 20px;
	right: 20px;
	bottom: 20px;
	z-index: 2;
	display: flex;
	align-items: center;
	box-sizing: border-box;
	min-height: 50px;
	margin: 0;
	padding: 10px 48px 10px 24px;
	border: 1px solid var(--hpt-cream);
	border-radius: 60px;
	background: var(--hpt-cream);
	color: var(--hpt-brand);
	font-family: var(--hpt-bold);
	font-weight: 700;
	font-size: 15px;
	line-height: 24px;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	box-shadow: none;
	white-space: nowrap;
	opacity: 0;
	transform: translateY(15px);
	transition: opacity .25s cubic-bezier(.3, 1, .3, 1), transform .25s cubic-bezier(.3, 1, .3, 1);
}

.hpt a.hpt__add:hover,
.hpt a.hpt__add:focus { background: var(--hpt-cream); color: var(--hpt-brand); text-decoration: none; }
.hpt a.hpt__add:focus:not(:focus-visible) { outline: none; }
.hpt a.hpt__add:focus-visible {
	opacity: 1;
	transform: none;
	transition: none; /* sin el desfase de 15 px de la entrada, que confundía el scroll al enfocar */
	outline: 3px solid var(--hpt-brand);
	outline-offset: 2px;
	box-shadow: 0 0 0 7px var(--hpt-cream); /* anillo de dos tonos: se ve sobre partes oscuras de la foto */
}

/* Dentro del borde (inset 0), como el .btn de Pebble: con -1px la capa tapaba el borde (mismo
   arreglo que en "El detalle ideal para…" y en el combo, escépticos del 14-oct). */
.hpt .hpt__add-inv {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	padding: 10px 48px 10px 24px;
	border-radius: inherit;
	background: var(--hpt-brand);
	color: var(--hpt-cream);
	clip-path: circle(15px at calc(100% - 25px) 50%);
	transition: clip-path .6s cubic-bezier(.4, 0, .2, 1);
	pointer-events: none;
}

.hpt .hpt__add-icw {
	position: absolute;
	top: 50%;
	right: 10px;
	width: 30px;
	height: 30px;
	margin-top: -15px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	overflow: hidden;
}

.hpt .hpt__add-ic { display: block; }

.hpt .hpt__add-cart { display: none; }

/* WooCommerce agrega "Ver carrito" al lado del botón: el carrito del header ya se abre solo. */
.hpt a.added_to_cart { display: none !important; }
.hpt a.hpt__add.loading { opacity: 1; transform: none; cursor: progress; }
.hpt a.hpt__add.loading::after { display: none; }

@media (hover: hover) and (pointer: fine) {
	.hpt .hpt__media:hover a.hpt__add { opacity: 1; transform: none; }
	.hpt a.hpt__add:hover .hpt__add-inv { clip-path: circle(150% at calc(100% - 25px) 50%); }
	.hpt a.hpt__add:hover .hpt__add-ic { animation: hpt-mas 1s ease infinite; }
}

/* slideInOut de Pebble: sale por la derecha recortado por el círculo y entra por la izquierda, sin fundido. */
@keyframes hpt-mas {
	0%      { transform: translateX(0); }
	50%     { transform: translateX(20px); }
	50.001% { transform: translateX(-20px); }
	100%    { transform: translateX(0); }
}

/* Táctil: círculo con el carrito siempre visible, abajo a la derecha (Pebble). */
@media (hover: none), (pointer: coarse) {
	.hpt a.hpt__add {
		left: auto;
		right: 10px;
		bottom: 10px;
		width: 38px;
		min-height: 38px;
		height: 38px;
		padding: 0;
		justify-content: center;
		border-radius: 50%;
		opacity: 1;
		transform: none;
	}
	.hpt .hpt__add > .hpt__add-t,
	.hpt .hpt__add-inv { display: none; }
	.hpt .hpt__add-cart { display: block; }
}

/* ---------- Nombre y precio ---------- */
.hpt .hpt__info {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding-top: 16px;
}

/* El enlace del nombre cubre toda la info (precio y huecos incluidos), como la tarjeta-enlace de
   Pebble: antes tocar el precio no hacía nada. */
.hpt a.hpt__name::after {
	content: "";
	position: absolute;
	inset: 0;
}

.hpt a.hpt__name {
	align-self: flex-start;
	color: var(--hpt-ink);
	font-family: var(--hpt-bold);
	font-weight: 700;
	font-size: 15px;
	line-height: 24px;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	background-image: linear-gradient(currentColor, currentColor);
	background-repeat: no-repeat;
	background-position: 100% 100%;
	background-size: 0 1px;
	transition: background-size .35s cubic-bezier(.3, 1, .3, 1);
}

.hpt a.hpt__name:hover,
.hpt a.hpt__name:focus { color: var(--hpt-ink); text-decoration: none; }
.hpt a.hpt__name:focus:not(:focus-visible) { outline: none; }
.hpt a.hpt__name:focus-visible { outline: 3px solid var(--hpt-brand); outline-offset: 3px; }

@media (hover: hover) and (pointer: fine) {
	.hpt .hpt__info:hover a.hpt__name { background-position: 0 100%; background-size: 100% 1px; }
}

.hpt .hpt__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 4px;
	margin: 0;
	color: var(--hpt-ink);
	font-family: var(--hpt-bold);
	font-weight: 700;
	font-size: 15px;
	line-height: 24px;
}

/* Oferta: primero el precio actual en rojo, después el anterior tachado (Pebble). */
.hpt .hpt__price ins { order: 0; color: var(--hpt-sale); text-decoration: none; background: none; font-weight: 700; }
.hpt .hpt__price del { order: 1; color: var(--hpt-ink); opacity: .66; font-weight: 700; } /* .6 daba 4,39:1 */

/* ---------- Barra y flechas ---------- */
.hpt .hpt__controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 32px;
	min-height: 44px;
}

.hpt .hpt__bar {
	position: relative;
	width: 250px;
	height: 2px;
	background: rgba(122, 13, 19, .14);
	overflow: hidden;
}

.hpt .hpt__fill {
	position: absolute;
	inset: 0;
	background: var(--hpt-brand);
	transform-origin: 0 50%;
	transform: scaleX(.2);
	transition: transform .3s ease;
}

.hpt .hpt__arrows { display: flex; gap: 8px; }

.hpt button.hpt__arrow {
	position: relative;
	z-index: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(122, 13, 19, .2);
	border-radius: 50%;
	overflow: hidden;
	background: transparent;
	color: var(--hpt-brand);
	box-shadow: none;
	text-shadow: none;
	cursor: pointer;
	transition: color .35s, border-color .35s, opacity .35s;
}

.hpt button.hpt__arrow::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	z-index: -1;
	width: 0;
	background: var(--hpt-brand);
	transition: width .3s ease;
}

.hpt button.hpt__arrow:hover,
.hpt button.hpt__arrow:focus { background: transparent; }
.hpt button.hpt__arrow:focus:not(:focus-visible) { outline: none; }
.hpt button.hpt__arrow:focus-visible { outline: 3px solid var(--hpt-brand); outline-offset: 3px; }
.hpt button.hpt__arrow[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

@media (hover: hover) and (pointer: fine) {
	.hpt button.hpt__arrow:not([aria-disabled="true"]):hover { color: var(--hpt-cream); border-color: var(--hpt-brand); }
	.hpt button.hpt__arrow:not([aria-disabled="true"]):hover::before { width: 100%; }
}

@media (max-width: 767.98px) {
	.hpt .hpt__controls { display: none; }
}

/* ---------- Entrada del título (solo con JS) ---------- */
.hpt.hpt--js .hpt__head { opacity: 0; transform: translateY(25px); transition: opacity 1.5s cubic-bezier(.16, 1, .3, 1) .05s, transform 1.5s cubic-bezier(.16, 1, .3, 1) .05s; }
.hpt.hpt--js.is-in .hpt__head { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	.hpt.hpt--js .hpt__head,
	.hpt.hpt--js .hpt__card .hpt__media .hpt__img--1 { opacity: 1 !important; transform: none !important; transition: none !important; }
	.hpt .hpt__track { scroll-behavior: auto; }
	.hpt .hpt__media:hover .hpt__img { scale: 1; }
	.hpt a.hpt__add:hover .hpt__add-ic { animation: none !important; }
	/* La guarda de Elementor (html * { transition-duration: 0s }) no alcanza a los pseudo-elementos. */
	.hpt button.hpt__tab::before,
	.hpt button.hpt__arrow::before { transition: none !important; }
}
