/* HW - Promoción por Packs — Barra fija de compra */
.pqs-sticky-bar {
	--pqs-sticky-accent: #1846be;
	--pqs-sticky-radius: 13px;
	font-family: "Red Hat Display", sans-serif;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9990;
	padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
	background: #fff;
	border-radius: 18px 18px 0 0;
	box-shadow: 0 -1px 0 rgba(17, 24, 39, .06), 0 -10px 30px rgba(17, 24, 39, .14);
	transform: translateY(115%);
	visibility: hidden;
	transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .3s;
	box-sizing: border-box;
}

.pqs-sticky-bar,
.pqs-sticky-bar * {
	font-family: "Red Hat Display", sans-serif !important;
}

.pqs-sticky-bar *,
.pqs-sticky-bar *::before,
.pqs-sticky-bar *::after {
	box-sizing: border-box;
}

.pqs-sticky-bar.pqs-visible {
	transform: translateY(0);
	visibility: visible;
	transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Escritorio: una sola fila ---------- */
.pqs-sticky-inner {
	display: flex;
	align-items: center;
	gap: 16px;
	max-width: 1100px;
	margin: 0 auto;
}

.pqs-sticky-img {
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	padding: 3px;
	object-fit: contain;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	background: #fff;
}

.pqs-sticky-title {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: #111827;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pqs-sticky-price {
	flex: 0 0 auto;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -.01em;
	color: #111827;
	white-space: nowrap;
}

.pqs-sticky-price *,
.pqs-sticky-price .woocommerce-Price-amount,
.pqs-sticky-price bdi {
	color: inherit;
	font-weight: inherit;
	text-decoration: none;
}

.pqs-sticky-price del {
	display: none;
}

.pqs-sticky-qty {
	flex: 0 0 auto;
	padding: 6px 12px;
	border: 1.5px solid var(--pqs-sticky-accent);
	border-radius: 999px;
	background: #f3f6ff;
	background: color-mix(in srgb, var(--pqs-sticky-accent) 8%, #fff);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--pqs-sticky-accent);
	white-space: nowrap;
}

.pqs-sticky-btn {
	flex: 0 0 auto;
	min-width: 190px;
	padding: 14px 28px;
	border: 0 !important;
	border-radius: var(--pqs-sticky-radius);
	background: var(--pqs-sticky-accent) !important;
	background-image: none !important;
	box-shadow: none !important;
	color: #fff !important;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-transform: none;
	letter-spacing: 0;
	white-space: nowrap;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
	transition: filter .15s ease, transform .1s ease;
	position: relative;
	overflow: hidden;
	white-space: nowrap;
}

/* Estado "agregando": rebote al tocar + barrido de luz; bloqueado contra spam */
.pqs-sticky-btn.pqs-busy {
	pointer-events: none;
	cursor: progress;
	animation: pqs-pop .4s cubic-bezier(.2, .9, .3, 1.4);
	will-change: transform;
}

.pqs-sticky-btn.pqs-busy::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 50%;
	background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .4) 50%, rgba(255, 255, 255, 0) 100%);
	transform: translateX(-120%) skewX(-20deg);
	will-change: transform;
	animation: pqs-sweep .75s ease-in-out 1 forwards;
}

.pqs-sticky-btn.pqs-done {
	pointer-events: none;
	cursor: default;
}

.pqs-sticky-btn .pqs-check {
	display: inline-block;
	margin-right: 6px;
	animation: pqs-check .4s cubic-bezier(.2, .9, .3, 1.6);
}

@keyframes pqs-pop {
	0%   { transform: scale(1); }
	35%  { transform: scale(.97); }
	70%  { transform: scale(1.015); }
	100% { transform: scale(1); }
}

@keyframes pqs-sweep {
	0%   { transform: translateX(-120%) skewX(-20deg); }
	100% { transform: translateX(300%) skewX(-20deg); }
}

@keyframes pqs-check {
	0%   { transform: scale(0) rotate(-40deg); opacity: 0; }
	100% { transform: scale(1) rotate(0); opacity: 1; }
}

.pqs-sticky-btn:hover,
.pqs-sticky-btn:focus-visible {
	filter: brightness(1.1);
	color: #fff !important;
	background: var(--pqs-sticky-accent) !important;
}

.pqs-sticky-btn:active {
	transform: scale(.98);
}

/* Deja espacio al final de la página para que la barra no tape el footer */
body.pqs-sticky-active {
	padding-bottom: 92px;
}

/* ---------- Móvil: tarjeta compacta en 2 filas ----------
   Fila 1: imagen | título (arriba) + precio y cantidad (abajo)
   Fila 2: botón a todo el ancho                                   */
@media (max-width: 640px) {
	.pqs-sticky-bar {
		padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
		border-radius: 16px 16px 0 0;
	}

	.pqs-sticky-inner {
		display: grid;
		grid-template-columns: 52px minmax(0, 1fr) auto;
		grid-template-areas:
			"img title title"
			"img price qty"
			"btn btn btn";
		column-gap: 12px;
		row-gap: 4px;
		align-items: center;
	}

	.pqs-sticky-img {
		grid-area: img;
		width: 52px;
		height: 52px;
		align-self: center;
	}

	.pqs-sticky-title {
		grid-area: title;
		font-size: 13px;
		-webkit-line-clamp: 1;
	}

	.pqs-sticky-price {
		grid-area: price;
		font-size: 18px;
	}

	.pqs-sticky-qty {
		grid-area: qty;
		justify-self: end;
		padding: 4px 11px;
		font-size: 12px;
	}

	.pqs-sticky-btn {
		grid-area: btn;
		width: 100%;
		min-width: 0;
		margin-top: 6px;
		padding: 13px 16px;
		font-size: 16px;
	}

	body.pqs-sticky-active {
		padding-bottom: 128px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pqs-sticky-bar,
	.pqs-sticky-bar.pqs-visible,
	.pqs-sticky-btn {
		transition: none;
	}

	.pqs-sticky-btn.pqs-busy,
	.pqs-sticky-btn.pqs-busy::after,
	.pqs-sticky-btn .pqs-check {
		animation: none;
	}
}
