/* Caja de compra del ebook.
   Estructura: cabecera (portada + título + precio + resumen) y, debajo, el
   formulario a todo el ancho. Así el formulario nunca queda aplastado, que es lo
   que ocurría cuando portada y campos compartían fila dentro de una columna
   estrecha de Elementor.

   El ancho se decide por el CONTENEDOR, no por la pantalla: la caja puede vivir en
   una columna de 300 px y en una sección de 900 sin cambiar nada.

   Paleta de marca: tinta #10192D, naranja #FF6B00, papel #F7F8FA. */

.edr-buy {
	--edr-ink: #10192d;
	--edr-accent: #ff6b00;
	--edr-accent-dark: #e35f00;
	--edr-paper: #f7f8fa;
	--edr-line: rgba(16, 25, 45, 0.12);
	--edr-line-strong: rgba(16, 25, 45, 0.22);
	--edr-muted: rgba(16, 25, 45, 0.64);

	container-type: inline-size;
	container-name: edrbuy;

	width: 100%;
	max-width: 100%;
	margin: 1.25rem 0;
	color: var(--edr-ink);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.55;
	text-align: left;
}

.edr-buy *,
.edr-buy *::before,
.edr-buy *::after {
	box-sizing: border-box;
}

.edr-buy__card {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.1rem;
	padding: 1rem;
	background: #fff;
	border: 1px solid var(--edr-line);
	border-radius: 14px;
	box-shadow: 0 20px 50px -32px rgba(16, 25, 45, 0.45);
}

/* Cabecera: portada encima del texto mientras no haya sitio para ponerlas al lado. */
.edr-buy__head {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.9rem;
}

.edr-buy__media {
	justify-self: center;
	width: 100%;
	max-width: 8rem;
	margin: 0;
}

.edr-buy__cover {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
	box-shadow: 0 12px 28px -18px rgba(16, 25, 45, 0.55);
}

.edr-buy__intro,
.edr-buy__panel {
	min-width: 0;
}

.edr-buy__eyebrow {
	margin: 0 0 0.3rem;
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.11em;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--edr-accent);
}

.edr-buy__title {
	margin: 0 0 0.45rem;
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.005em;
	color: var(--edr-ink);
}

.edr-buy__price {
	margin: 0 0 0.6rem;
	font-size: 1.7rem;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--edr-ink);
}

.edr-buy__price .woocommerce-Price-currencySymbol {
	font-size: 1em;
}

.edr-buy__price--compact {
	font-size: 1.35rem;
	margin-bottom: 0.4rem;
}

.edr-buy__vat {
	display: block;
	margin-top: 0.25rem;
	font-size: 0.74rem;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0;
	color: var(--edr-muted);
}

.edr-buy__short {
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.5;
	color: var(--edr-muted);
}

.edr-buy__short p {
	margin: 0 0 0.4rem;
}

.edr-buy__short p:last-child {
	margin-bottom: 0;
}

.edr-buy__short strong {
	font-weight: 600;
	color: var(--edr-ink);
}

/* Formulario: siempre a todo el ancho de la tarjeta. */
.edr-buy__panel {
	padding-top: 1rem;
	border-top: 1px solid var(--edr-line);
}

.edr-buy .edr-buy__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0;
}

.edr-buy .edr-buy__field {
	display: block;
	margin: 0 0 0.7rem;
}

.edr-buy .edr-buy__field > span {
	display: block;
	margin-bottom: 0.25rem;
	font-size: 0.76rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: var(--edr-ink);
}

.edr-buy .edr-buy__field small {
	display: block;
	margin-top: 0.2rem;
	font-size: 0.72rem;
	line-height: 1.4;
	color: var(--edr-muted);
}

.edr-buy .edr-buy__field input {
	display: block;
	width: 100%;
	min-height: 2.75rem;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--edr-line-strong);
	border-radius: 9px;
	background: #fff;
	color: var(--edr-ink);
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.3;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.edr-buy .edr-buy__field input:hover {
	border-color: rgba(16, 25, 45, 0.34);
}

.edr-buy .edr-buy__field input:focus {
	outline: none;
	border-color: var(--edr-accent);
	box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.18);
}

.edr-buy .edr-buy__check {
	display: flex;
	gap: 0.5rem;
	align-items: flex-start;
	margin: 0 0 0.6rem;
	font-size: 0.75rem;
	line-height: 1.45;
	font-weight: 400;
	color: var(--edr-muted);
}

.edr-buy .edr-buy__check input {
	flex: 0 0 auto;
	width: 1rem;
	height: 1rem;
	margin: 0.15rem 0 0;
	accent-color: var(--edr-accent);
}

.edr-buy .edr-buy__check a {
	color: var(--edr-ink);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.edr-buy .edr-buy__check a:hover {
	color: var(--edr-accent);
}

.edr-buy .edr-buy__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.edr-buy .edr-buy__button {
	display: block;
	width: 100%;
	min-height: 3rem;
	margin: 0.5rem 0 0;
	padding: 0.8rem 0.9rem;
	border: 0;
	border-radius: 9px;
	background: var(--edr-accent);
	color: #fff;
	font-family: inherit;
	font-size: 0.98rem;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0.01em;
	text-align: center;
	white-space: normal;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.05s ease;
}

.edr-buy .edr-buy__button:hover {
	background: var(--edr-accent-dark);
	color: #fff;
}

.edr-buy .edr-buy__button:active {
	transform: translateY(1px);
}

.edr-buy .edr-buy__button:focus-visible {
	outline: 3px solid rgba(255, 107, 0, 0.4);
	outline-offset: 2px;
}

.edr-buy .edr-buy__button:disabled {
	opacity: 0.65;
	cursor: progress;
	background: var(--edr-accent);
}

.edr-buy .edr-buy__back {
	display: block;
	width: 100%;
	margin: 0.4rem 0 0;
	padding: 0.45rem;
	border: 0;
	background: none;
	color: var(--edr-muted);
	font-family: inherit;
	font-size: 0.76rem;
	text-decoration: underline;
	cursor: pointer;
}

.edr-buy .edr-buy__status {
	margin: 0.7rem 0 0;
	padding: 0.65rem 0.75rem;
	border-radius: 9px;
	background: var(--edr-paper);
	font-size: 0.8rem;
	line-height: 1.45;
	color: var(--edr-ink);
}

.edr-buy .edr-buy__status.is-error {
	background: #fdecea;
	color: #8a1c12;
	box-shadow: inset 0 0 0 1px rgba(138, 28, 18, 0.15);
}

.edr-buy .edr-buy__element {
	margin: 0.45rem 0 0;
}

.edr-buy__trust {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.35rem;
	margin: 0.9rem 0 0;
	padding: 0.8rem 0 0;
	border-top: 1px solid var(--edr-line);
	list-style: none;
	font-size: 0.74rem;
	line-height: 1.4;
	color: var(--edr-muted);
}

.edr-buy__trust li {
	display: flex;
	align-items: flex-start;
	gap: 0.4rem;
	margin: 0;
	padding: 0;
}

/* Marca de verificación, no un anillo: un círculo hueco se lee como botón de radio. */
.edr-buy__trust li::before {
	content: "\2713";
	flex: 0 0 auto;
	margin: 0;
	color: var(--edr-accent);
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1.35;
}

.edr-buy__methods {
	margin: 0.6rem 0 0;
	font-size: 0.7rem;
	line-height: 1.45;
	letter-spacing: 0.01em;
	color: var(--edr-muted);
	text-align: left;
}

/* En pantallas grandes la caja acompaña al lector mientras recorre el texto de la
   columna de al lado, en vez de quedarse arriba y dejar un hueco vacío.
   `position: sticky` en la propia caja no sirve: su contenedor —el widget de
   Elementor— mide exactamente lo que ella, así que no tiene recorrido. Por eso se
   pega el widget, que sí tiene como contenedor la columna entera. */
@media (min-width: 1100px) {
	.elementor-widget:has(.edr-buy) {
		position: sticky;
		top: 5rem;
	}

	.edr-buy {
		margin-bottom: 0;
	}
}

/* ------------------------- Adaptación al contenedor ------------------------- */

/* 22rem (352 px): los dos campos cortos pueden ir en fila. */
@container edrbuy (min-width: 22rem) {
	.edr-buy .edr-buy__row {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 0 0.7rem;
	}
}

/* 26rem (416 px): tipografía de escritorio y garantías en dos columnas. */
@container edrbuy (min-width: 26rem) {
	.edr-buy__card {
		padding: 1.25rem;
	}

	.edr-buy__title {
		font-size: 1.2rem;
	}

	.edr-buy__price {
		font-size: 1.95rem;
	}

	.edr-buy__short {
		font-size: 0.88rem;
	}

	.edr-buy .edr-buy__check {
		font-size: 0.78rem;
	}

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

/* 34rem (544 px): portada al lado del texto, que ya tiene sitio para respirar. */
@container edrbuy (min-width: 34rem) {
	.edr-buy__card {
		padding: 1.6rem;
		gap: 1.25rem;
	}

	.edr-buy__head--media {
		grid-template-columns: minmax(0, 10rem) minmax(0, 1fr);
		gap: 1.5rem;
		align-items: start;
	}

	.edr-buy__media {
		justify-self: stretch;
		max-width: none;
	}

	.edr-buy__title {
		font-size: 1.35rem;
	}

	.edr-buy__price {
		font-size: 2.1rem;
	}

	.edr-buy .edr-buy__button {
		min-height: 3.25rem;
		font-size: 1rem;
	}
}
