/**
 * Checkout exprés — barra fija de compra en la ficha de producto.
 * Diseño aprobado por Kevin (mockup "Barra de compra Gigapanda" 2026-07-18, patrón Nomad):
 * barra NEGRA, plan en amarillo, "¿Tienes un cupón?" bajo el precio (→ checkout),
 * botón carrito (multi-compra, abre el modal existente) + CTA amarillo "Pagar".
 */

:root {
	--gp-black: #1e1e1e;
	--gp-yellow: #f9ca24;
	--gp-gray-dark: #6e6e6e;
	--gp-gray-mid: #d8d8d8;
	--gp-white: #ffffff;
}

/* Deja aire al final para que la barra no tape el último contenido/footer. */
body.single-product {
	padding-bottom: 96px;
}

.gp-buybar {
	font-family: "Arboria-Book", "Century Gothic", sans-serif;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 900;
	background: var(--gp-black);
	color: var(--gp-white);
	box-shadow: 0 -14px 30px -18px rgba(0, 0, 0, 0.55);
	transform: translateY(110%);
	transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
	padding-bottom: env(safe-area-inset-bottom, 0);
}

.gp-buybar.is-visible {
	transform: translateY(0) !important;
}

.gp-buybar__inner {
	max-width: 1180px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 10px 20px 12px;
	min-height: 84px;
}

/* --- Info: destino · plan / Total precio / cupón --- */
.gp-buybar__info {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
	line-height: 1.25;
	flex: 1 1 auto;
}

.gp-buybar__name {
	font-family: "Arboria-Medium", sans-serif;
	font-size: 14px;
	font-weight: normal;
	color: var(--gp-white);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.gp-buybar__sep {
	margin: 0 5px;
	color: rgba(255, 255, 255, 0.55);
}

.gp-buybar__plan {
	font-family: "Arboria-Bold", sans-serif;
	color: var(--gp-yellow);
	font-weight: normal;
}

.gp-buybar__plan.is-placeholder {
	font-family: "Arboria-Medium", sans-serif;
	color: rgba(255, 255, 255, 0.65);
	font-weight: normal;
}

.gp-buybar__pricerow {
	display: flex;
	align-items: baseline;
	gap: 7px;
}

.gp-buybar__total {
	font-family: "Arboria-Medium", sans-serif;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	color: #9c9a95;
	font-weight: 600;
}

.gp-buybar__price {
	font-family: "Arboria-Black", sans-serif;
	font-size: 21px;
	font-weight: normal;
	color: var(--gp-yellow);
	line-height: 1.1;
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
}

/* Precio anterior tachado (rojo medio, opción C aprobada 2026-07-18) */
.gp-buybar__old {
	font-family: "Arboria-Book", sans-serif;
	font-size: 14px;
	color: #b0574f;
	text-decoration: line-through;
}

.gp-buybar__old .woocommerce-Price-amount {
	color: inherit;
	font-family: inherit;
}

/* Pastilla -X% (abre la línea de precio, como la card de la oferta) */
.gp-buybar__pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #ff383c;
	color: var(--gp-white);
	font-family: "Arboria-Bold", sans-serif;
	font-size: 12px;
	border-radius: 999px;
	padding: 3px 9px;
	line-height: 1;
	align-self: center;
}

.gp-buybar__price .gp-buybar__from-label {
	font-family: "Arboria-Book", sans-serif;
	font-size: 12px;
	font-weight: normal;
	color: #9c9a95;
}

.gp-buybar__price .woocommerce-Price-amount {
	color: inherit;
	font-family: inherit;
}

/* Cupón: botón-texto DEBAJO del precio → lleva al checkout */
.gp-buybar__coupon {
	align-self: flex-start;
	margin-top: 2px;
	padding: 1px 0;
	background: none;
	border: 0;
	cursor: pointer;
	font-family: "Arboria-Book", sans-serif;
	font-size: 12px;
	color: #c9c6bf;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-color: #6a6862;
	transition: color 0.15s ease;
}

.gp-buybar__coupon:hover {
	color: var(--gp-yellow);
	text-decoration-color: var(--gp-yellow);
}

/* --- Acciones: carrito + Pagar --- */
.gp-buybar__actions {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 9px;
}

.gp-buybar__cart {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	height: 48px;
	padding: 0 13px;
	border-radius: 12px;
	background: #2c2c31;
	border: 1px solid #47474e;
	color: var(--gp-white);
	font-family: "Arboria-Medium", sans-serif;
	font-size: 14px;
	font-weight: normal;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.gp-buybar__cart:hover {
	background: #37373d;
	border-color: #5a5a62;
}

.gp-buybar__cart-label {
	display: none;
}

.gp-buybar__cart-count {
	font-family: "Arboria-Bold", sans-serif;
	position: absolute;
	top: -6px;
	right: -6px;
	background: var(--gp-yellow);
	color: var(--gp-black);
	font-size: 11px;
	font-weight: 800;
	min-width: 18px;
	height: 18px;
	border-radius: 9px;
	display: grid;
	place-items: center;
	padding: 0 4px;
	font-style: normal;
}

.gp-buybar__cta {
	flex: 0 0 auto;
	/* Ancho mínimo: "Pay" (EN) es muy corto y el botón quedaba enano (Kevin 2026-07-19). */
	min-width: 150px;
	appearance: none;
	border: 0;
	cursor: pointer;
	background: var(--gp-yellow);
	color: var(--gp-black);
	font-family: "Arboria-Bold", sans-serif;
	font-size: 16px;
	font-weight: normal;
	letter-spacing: 0.2px;
	padding: 0 26px;
	height: 48px;
	border-radius: 12px;
	transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.15s ease, opacity 0.2s ease;
	box-shadow: 0 6px 18px -6px rgba(249, 202, 36, 0.65);
	white-space: nowrap;
}

.gp-buybar__cta:hover:not(:disabled) {
	background: #ffd647;
	transform: translateY(-1px);
}

.gp-buybar__cta:active:not(:disabled) {
	transform: translateY(0);
}

.gp-buybar__cta:disabled {
	background: #47474e;
	color: #9c9a95;
	box-shadow: none;
	cursor: not-allowed;
}

.gp-buybar__cta.is-loading {
	opacity: 0.85;
	cursor: progress;
}

/* --- Desktop --- */
@media (min-width: 641px) {
	.gp-buybar__inner {
		padding: 12px 30px;
		min-height: 88px;
		gap: 20px;
	}

	.gp-buybar__name {
		font-size: 15px;
	}

	.gp-buybar__price {
		font-size: 25px;
	}

	.gp-buybar__cart-label {
		display: inline;
	}

	.gp-buybar__cta {
		font-size: 17px;
		padding: 0 34px;
	}
}

/* --- Móvil --- */
@media (max-width: 640px) {
	.gp-buybar__inner {
		gap: 10px;
		padding: 9px 14px 11px;
		min-height: 80px;
	}

	.gp-buybar__name {
		font-size: 13px;
	}

	.gp-buybar__price {
		font-size: 19px;
	}

	.gp-buybar__old {
		font-size: 12.5px;
	}

	.gp-buybar__pill {
		font-size: 11px;
		padding: 2px 7px;
	}

	.gp-buybar__cta {
		font-size: 15px;
		padding: 0 20px;
	}

	body.single-product {
		padding-bottom: 92px;
	}
}

/* Pantallas muy angostas: la info cede espacio a las acciones. */
@media (max-width: 380px) {
	.gp-buybar__cta {
		padding: 0 16px;
	}

	.gp-buybar__cart {
		padding: 0 11px;
	}
}

/*
 * Widgets flotantes: en la ficha de producto aterrizan SOBRE la barra de compra
 * en vez de taparla. --gp-buybar-offset lo calcula el JS con la altura real de
 * la barra (varía por idioma/rebaja) + un margen; fallback 100px.
 * - #gp-btn / #gp-frame: chat del panda (snippet → gigapanda.net/chat.php)
 * - .wpconsent-*: icono y banner flotante de cookies (WPConsent)
 */
/* Chat del panda: borde inferior PEGADO a la barra (sin hueco) → usa la altura
 * exacta de la barra, no el offset con aire. */
.single-product #gp-btn {
	bottom: var(--gp-buybar-h, 88px) !important;
}

.single-product #gp-frame {
	bottom: var(--gp-buybar-h, 88px) !important;
}

/* Icono flotante de cookies (WPConsent): elevado sobre la barra, igual que el
 * chat (decisión Kevin 2026-07-18). El icono vive DENTRO de un Shadow DOM
 * (host #wpconsent-container) → los selectores normales NO lo alcanzan; el
 * botón se expone con part="wpconsent-settings-button", así que se estiliza
 * desde fuera con ::part(). El JS hace el mismo trabajo como refuerzo. NO
 * tocamos el banner de primera visita ni el modal de preferencias. */
.single-product #wpconsent-container::part(wpconsent-settings-button) {
	bottom: var(--gp-buybar-offset, 100px) !important;
}
