/**
 * WDigitalShop — diseños de la ficha de Free Fire (Arsenal, Booyah, Cofre, HUD).
 */

/* 1. Base común ------------------------------------------------------------ */
.wdsff {
	--ff-fire: #ff7a1a;
	--ff-gold: #ffc94d;
	--ff-ice: #5fd3ff;
	--ff-line: rgba(255, 255, 255, 0.1);
	position: relative;
	max-width: var(--wds-container, 1210px);
	margin: 18px auto 34px;
	padding-inline: var(--wds-gutter, 16px);
	color: var(--wds-text);
}

/* Con el script listo, la cabecera normal de la ficha sobra (el formulario ya está dentro). */
.wds-ff-ready .wds-ff .wdsp-hero {
	display: none;
}

.wds-ff-ready .wdsff-dock table.variations,
.wds-ff-ready .wdsff-dock .reset_variations {
	display: none;
}

.wdsff-eyebrow {
	margin: 0 0 6px;
	color: var(--ff-gold);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.wds-theme .wdsff-title {
	margin: 0;
	color: #fff;
	font-family: var(--wds-font-head);
	font-size: clamp(28px, 3.4vw, 46px);
	font-weight: 800;
	line-height: 1.02;
	text-transform: uppercase;
}

.wdsff-lead {
	max-width: 36em;
	margin: 10px 0 0;
	color: var(--wds-muted);
	font-size: 16px;
	line-height: 1.5;
}

.wdsff-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 24px;
	align-items: start;
	margin-top: 24px;
}

.wdsff-group + .wdsff-group {
	margin-top: 22px;
}

.wds-theme .wdsff-group__title {
	margin: 0 0 10px;
	color: var(--wds-muted);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.wdsff-grid {
	display: grid;
	gap: 12px;
}

/* Tarjeta (todas las variantes comparten la base). */
.wds-theme .wdsff-item {
	position: relative;
	display: grid;
	gap: 6px;
	justify-items: center;
	margin: 0;
	padding: 14px 12px;
	border: 1px solid var(--ff-line);
	border-radius: 16px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)), var(--wds-surface);
	color: var(--wds-text);
	font: inherit;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.2s ease, transform 0.25s var(--wds-ease-out, ease-out), box-shadow 0.25s ease;
}

.wds-theme .wdsff-item:hover:not(:disabled) {
	border-color: rgba(255, 201, 77, 0.55);
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)), var(--wds-surface);
	color: var(--wds-text);
}

.wds-theme .wdsff-item:focus-visible {
	outline: 2px solid var(--ff-gold);
	outline-offset: 2px;
}

.wds-theme .wdsff-item.is-picked {
	border-color: var(--ff-gold);
	box-shadow: 0 0 0 1px var(--ff-gold), 0 12px 34px rgba(255, 140, 0, 0.22);
}

.wds-theme .wdsff-item:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.wdsff-item__art {
	display: block;
	width: 76px;
	height: 64px;
}

.wdsff-gems,
.wdsff-badge-svg {
	width: 100%;
	height: 100%;
	overflow: visible;
}

.wdsff-item__qty {
	display: grid;
	gap: 1px;
	line-height: 1.1;
}

.wdsff-item__qty strong {
	color: #fff;
	font-family: var(--wds-font-head);
	font-size: 22px;
	font-weight: 800;
}

.is-member .wdsff-item__qty strong {
	font-size: 15px;
}

.wdsff-item__qty small {
	color: var(--wds-muted);
	font-size: 12px;
}

.wdsff-item__bonus {
	color: var(--ff-gold);
	font-size: 12px;
	font-style: normal;
	font-weight: 700;
}

.wdsff-item__meter {
	display: none;
}

.wdsff-item__price {
	color: #fff;
	font-size: 14px;
	font-weight: 700;
}

.wdsff-item__price del {
	display: none;
}

.wdsff-item__price ins {
	background: none;
	text-decoration: none;
}

.wdsff-item.is-out .wdsff-item__price {
	color: #fda4af;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* Zona de compra (resumen + formulario real). */
.wdsff-checkout {
	position: sticky;
	top: calc(var(--wdsp-sticky, 0px) + 16px);
	display: grid;
	gap: 14px;
	padding: 18px;
	border: 1px solid var(--ff-line);
	border-radius: 18px;
	background: linear-gradient(160deg, rgba(255, 122, 26, 0.12), rgba(100, 56, 238, 0.12) 60%), var(--wds-surface);
}

.wdsff-summary {
	display: grid;
	gap: 2px;
}

.wdsff-summary__label {
	color: var(--wds-muted);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.wdsff-summary__title {
	color: #fff;
	font-family: var(--wds-font-head);
	font-size: 22px;
}

.wdsff-summary__price {
	color: var(--ff-gold);
	font-size: 20px;
	font-weight: 800;
}

.wdsff-summary__price del {
	display: none;
}

.wdsff-summary__price ins {
	background: none;
	text-decoration: none;
}

.wdsff-out-note {
	margin: 0;
	padding: 10px 12px;
	border-radius: 10px;
	background: rgba(253, 164, 175, 0.1);
	color: #fecdd3;
	font-size: 13px;
	line-height: 1.45;
}

.wdsff-dock .wdsp-buy__form {
	margin: 0;
}

.wdsff-trust {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 12px 0 0;
	border-top: 1px solid var(--ff-line);
	list-style: none;
	color: var(--wds-muted);
	font-size: 13px;
}

.wdsff-trust li::before {
	content: "✓ ";
	color: var(--ff-gold);
	font-weight: 700;
}

/* Gemas: entran escalonadas y brillan. */
.wdsff-gem {
	transform-box: fill-box;
}

@media (prefers-reduced-motion: no-preference) {
	.wdsff-gems .wdsff-gem path:first-child {
		animation: wdsff-twinkle 3.4s ease-in-out infinite;
		animation-delay: var(--d, 0ms);
	}

	.is-picked .wdsff-gems {
		animation: wdsff-bob 1.6s ease-in-out infinite;
	}
}

@keyframes wdsff-twinkle {
	0%, 100% { filter: brightness(1); }
	50% { filter: brightness(1.45) drop-shadow(0 0 3px #9ff3ff); }
}

@keyframes wdsff-bob {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-4px); }
}

/* 2. Arsenal: tarjetas 3D con brillo dorado ------------------------------------ */
.wdsff-head {
	display: flex;
	gap: 20px;
	align-items: center;
	padding: 22px;
	border: 1px solid var(--ff-line);
	border-radius: 22px;
	background: radial-gradient(120% 140% at 0% 0%, rgba(255, 122, 26, 0.32), transparent 55%), radial-gradient(120% 140% at 100% 100%, rgba(100, 56, 238, 0.3), transparent 55%), #0e0d1c;
}

.wdsff-head__img {
	flex: none;
	width: 96px;
	height: auto;
	border-radius: 14px;
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
}

.wdsff-grid--card {
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.wds-theme .wdsff-item--card {
	padding: 18px 12px 14px;
	transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
	transform-style: preserve-3d;
	overflow: hidden;
}

.wdsff-item--card::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(255, 213, 120, 0.22), transparent 55%);
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

.wdsff-item--card:hover::after,
.wdsff-item--card.is-picked::after {
	opacity: 1;
}

.wdsff-item--card .wdsff-item__art {
	width: 92px;
	height: 78px;
	transform: translateZ(30px);
}

@media (prefers-reduced-motion: no-preference) {
	.wdsff--arsenal .wdsff-item--card {
		animation: wdsff-rise 0.5s var(--wds-ease-out, ease-out) both;
	}

	.wdsff--arsenal .wdsff-item--card::before {
		content: "";
		position: absolute;
		top: 0;
		left: -60%;
		width: 40%;
		height: 100%;
		background: linear-gradient(100deg, transparent, rgba(255, 220, 140, 0.18), transparent);
		transform: skewX(-18deg);
		animation: wdsff-sweep 4.5s ease-in-out infinite;
		pointer-events: none;
	}

	.wdsff-item--card.is-pop {
		animation: wdsff-pop 0.45s var(--wds-ease-out, ease-out);
	}
}

@keyframes wdsff-rise {
	from { opacity: 0; transform: translateY(12px); }
}

@keyframes wdsff-sweep {
	0%, 60% { left: -60%; }
	100% { left: 130%; }
}

@keyframes wdsff-pop {
	40% { transform: scale(1.06); }
}

/* 3. Booyah: vídeo, chispas y carrusel ---------------------------------------- */
.wdsff-stage {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: clamp(260px, 32vw, 400px);
	padding: clamp(20px, 3vw, 40px);
	border-radius: 24px;
	background: #120a08;
	overflow: hidden;
	isolation: isolate;
}

.wdsff-video,
.wdsff-embers {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
}

.wdsff-video {
	object-fit: cover;
	opacity: 0.85;
}

.wdsff-stage::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(0deg, rgba(10, 6, 4, 0.92) 8%, rgba(10, 6, 4, 0.2) 60%, rgba(10, 6, 4, 0.5));
}

.wdsff-embers {
	z-index: 0;
	pointer-events: none;
}

.wdsff-stage__copy {
	position: relative;
	z-index: 1;
}

.wds-theme .wdsff-title--fire {
	color: #fff3d1;
	text-shadow: 0 2px 0 var(--ff-fire), 0 6px 26px rgba(255, 110, 20, 0.55);
}

.wdsff-rail-wrap {
	position: relative;
	margin-top: -36px;
	padding: 0 6px;
	z-index: 2;
}

.wdsff-rail {
	display: grid;
	grid-auto-columns: minmax(150px, 170px);
	grid-auto-flow: column;
	gap: 12px;
	padding: 8px 4px 16px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.wdsff-rail::-webkit-scrollbar {
	display: none;
}

.wds-theme .wdsff-item--tile {
	scroll-snap-align: start;
	background: linear-gradient(180deg, rgba(255, 122, 26, 0.16), rgba(20, 12, 10, 0.9) 60%), #140c0a;
	border-color: rgba(255, 140, 50, 0.25);
	backdrop-filter: blur(6px);
}

.wds-theme .wdsff-rail-nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 201, 77, 0.4);
	border-radius: 50%;
	background: rgba(10, 6, 4, 0.85);
	color: var(--ff-gold);
	font-size: 24px;
	line-height: 1;
	transform: translateY(-60%);
	cursor: pointer;
}

.wdsff-rail-nav.is-prev {
	left: -8px;
}

.wdsff-rail-nav.is-next {
	right: -8px;
}

.wdsff--booyah .wdsff-checkout {
	position: static;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
	align-items: start;
	margin-top: 8px;
}

.wdsff--booyah .wdsff-trust {
	grid-column: 1 / -1;
}

@media (prefers-reduced-motion: no-preference) {
	.wdsff--booyah .wdsff-item--tile.is-picked .wdsff-item__art {
		animation: wdsff-flame 1.2s ease-in-out infinite;
	}
}

@keyframes wdsff-flame {
	0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 140, 0, 0.6)); }
	50% { filter: drop-shadow(0 0 14px rgba(255, 140, 0, 0.95)); }
}

/* 4. Cofre: el cofre se abre y lanza diamantes --------------------------------- */
.wdsff-chest-zone {
	position: relative;
	display: grid;
	grid-template-columns: 240px minmax(0, 1fr);
	gap: 24px;
	align-items: center;
	padding: 24px;
	border: 1px solid var(--ff-line);
	border-radius: 24px;
	background: radial-gradient(80% 120% at 15% 60%, rgba(95, 211, 255, 0.18), transparent 60%), radial-gradient(80% 120% at 100% 0%, rgba(255, 201, 77, 0.16), transparent 60%), #0d0f1d;
	overflow: hidden;
}

.wdsff-burst {
	position: absolute;
	inset: 0;
	width: 240px;
	height: 100%;
	left: 24px;
	pointer-events: none;
	z-index: 2;
}

.wdsff-chest__svg {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.wdsff-chest__lid,
.wdsff-chest__glow {
	transform-box: fill-box;
}

.wdsff-chest__lid {
	transform-origin: 50% 100%;
	transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wdsff-chest__glow {
	transform-origin: 50% 50%;
	opacity: 0;
	transform: scale(0.6);
	transition: opacity 0.4s ease, transform 0.5s ease;
}

.wdsff-chest.is-open .wdsff-chest__lid {
	transform: translateY(-14px) rotate(-16deg);
}

.wdsff-chest.is-open .wdsff-chest__glow {
	opacity: 1;
	transform: scale(1.15);
}

@media (prefers-reduced-motion: no-preference) {
	.wdsff-chest:not(.is-open) {
		animation: wdsff-wiggle 4s ease-in-out infinite;
	}
}

@keyframes wdsff-wiggle {
	0%, 82%, 100% { transform: rotate(0); }
	86% { transform: rotate(-3deg); }
	90% { transform: rotate(3deg); }
	94% { transform: rotate(-2deg); }
}

.wdsff-grid--row {
	grid-template-columns: 1fr;
	gap: 8px;
}

.wds-theme .wdsff-item--row {
	grid-template-columns: 56px minmax(0, 1fr) 120px auto;
	align-items: center;
	justify-items: start;
	gap: 14px;
	padding: 10px 16px;
	text-align: left;
}

.wdsff-item--row .wdsff-item__art {
	width: 56px;
	height: 46px;
}

.wdsff-item--row .wdsff-item__qty {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 6px;
}

.wdsff-item--row .wdsff-item__bonus {
	flex-basis: 100%;
	order: 3;
	white-space: nowrap;
}

.wdsff-item--row .wdsff-item__qty strong {
	font-size: 20px;
}

.wdsff-item--row .wdsff-item__meter {
	display: block;
	width: 100%;
	height: 6px;
	border-radius: 99px;
	background: rgba(255, 255, 255, 0.08);
	overflow: hidden;
}

.wdsff-item--row .wdsff-item__meter i {
	display: block;
	width: var(--p, 0%);
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--ff-ice), #8b6cff);
}

.wdsff-item--row .wdsff-item__price {
	justify-self: end;
}

.wdsff-item--row.is-member {
	grid-template-columns: 56px minmax(0, 1fr) auto;
}

/* 5. HUD de juego --------------------------------------------------------------- */
.wdsff-hud__screen {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 16px 24px;
	align-items: end;
	padding: 24px 26px;
	border: 1px solid rgba(95, 211, 255, 0.35);
	border-radius: 6px 26px 6px 26px;
	background: linear-gradient(rgba(95, 211, 255, 0.06) 1px, transparent 1px) 0 0 / 100% 4px, radial-gradient(90% 140% at 0% 0%, rgba(95, 211, 255, 0.16), transparent 60%), #071019;
	box-shadow: inset 0 0 40px rgba(95, 211, 255, 0.08), 0 0 0 1px rgba(95, 211, 255, 0.08);
	overflow: hidden;
	font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.wdsff-hud__scan {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent, rgba(95, 211, 255, 0.12), transparent);
	height: 30%;
	pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
	.wdsff-hud__scan {
		animation: wdsff-scan 3.6s linear infinite;
	}
}

@keyframes wdsff-scan {
	from { transform: translateY(-100%); }
	to { transform: translateY(400%); }
}

.wdsff--hud .wdsff-eyebrow {
	color: var(--ff-ice);
}

.wdsff-hud__meter {
	display: grid;
	justify-items: end;
	min-width: 220px;
}

.wdsff-hud__count {
	color: #fff;
	font-size: clamp(36px, 4vw, 56px);
	font-weight: 800;
	line-height: 1;
	text-shadow: 0 0 18px rgba(95, 211, 255, 0.6);
	font-variant-numeric: tabular-nums;
}

.wdsff-hud__unit {
	color: var(--ff-ice);
	font-size: 12px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.wdsff-hud__bar {
	display: block;
	width: 100%;
	height: 6px;
	margin-top: 8px;
	background: rgba(95, 211, 255, 0.15);
	clip-path: polygon(0 0, 100% 0, 97% 100%, 0 100%);
}

.wdsff-hud__bar i {
	display: block;
	width: 0;
	height: 100%;
	background: linear-gradient(90deg, var(--ff-ice), var(--ff-gold));
	transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.wds-theme .wdsff-hud__steps {
	display: flex;
	grid-column: 1 / -1;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wdsff-hud__steps li {
	padding: 6px 12px;
	border: 1px solid rgba(95, 211, 255, 0.25);
	clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
	color: var(--wds-muted);
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.wdsff-hud__steps li.is-on {
	background: rgba(95, 211, 255, 0.18);
	color: #fff;
}

.wdsff-hud__steps li.is-done {
	color: var(--ff-ice);
}

.wdsff-layout--hud {
	grid-template-columns: 360px minmax(0, 1fr);
}

.wdsff--hud .wdsff-checkout {
	border-color: rgba(95, 211, 255, 0.3);
	border-radius: 6px 20px 6px 20px;
	background: #08131d;
}

.wdsff-grid--chip {
	grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
	gap: 8px;
}

.wds-theme .wdsff-item--chip {
	padding: 10px 8px;
	border-color: rgba(95, 211, 255, 0.2);
	border-radius: 4px 14px 4px 14px;
	background: #08131d;
}

.wdsff-item--chip .wdsff-item__art {
	width: 50px;
	height: 42px;
}

.wds-theme .wdsff-item--chip.is-picked {
	border-color: var(--ff-ice);
	box-shadow: 0 0 0 1px var(--ff-ice), 0 0 22px rgba(95, 211, 255, 0.3);
}

/* 6. Móvil ------------------------------------------------------------------------- */
@media (max-width: 900px) {
	.wdsff-layout,
	.wdsff-layout--hud {
		grid-template-columns: 1fr;
	}

	.wdsff-checkout {
		position: static;
	}

	.wdsff--booyah .wdsff-checkout {
		grid-template-columns: 1fr;
	}

	.wdsff-chest-zone {
		grid-template-columns: 1fr;
		justify-items: center;
		text-align: center;
	}

	.wdsff-chest {
		width: 180px;
	}

	.wdsff-burst {
		left: 0;
		width: 100%;
	}

	.wdsff-hud__screen {
		grid-template-columns: 1fr;
	}

	.wdsff-hud__meter {
		justify-items: start;
	}
}

@media (max-width: 560px) {
	.wdsff-head {
		flex-direction: column;
		align-items: flex-start;
		padding: 18px;
	}

	.wdsff-head__img {
		width: 72px;
	}

	.wdsff-grid--card {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wds-theme .wdsff-item--row {
		grid-template-columns: 44px minmax(0, 1fr) auto;
	}

	.wdsff-item--row .wdsff-item__meter {
		grid-column: 2 / -1;
		grid-row: 2;
	}

	.wdsff-rail-nav {
		display: none;
	}

	.wdsff-rail-wrap {
		margin-top: 12px;
	}

	.wdsff-stage {
		min-height: 230px;
	}

	.wdsff-grid--chip {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
