/*
 * Carrito y checkout de bloques. Hoja aparte del bundle (ver
 * src/Front/WooCommerce/CartCheckoutStyles.php). Mismo lenguaje que Mi cuenta
 * (assets/css/account.css): tarjetas blancas, radio 12 px, sombra suave,
 * títulos en Bebas.
 */

.wc-block-cart,
.wc-block-checkout {
	--cc-brand: #510395;
	--cc-soft: #f8f1fe;
	--cc-line: #ece4f5;
	--cc-text: #232323;
	--cc-muted: #6d6578;
	--cc-card-shadow: 0 1px 2px rgba(27, 6, 45, .04), 0 10px 30px rgba(81, 3, 149, .07);
}

/* ------------------------------------------------------------------ */
/* Tarjetas                                                             */
/* ------------------------------------------------------------------ */

.wc-block-cart .wc-block-cart__main,
.wc-block-cart .wc-block-cart__sidebar,
.wc-block-checkout .wc-block-checkout__form > fieldset,
.wc-block-checkout .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block {
	padding: 24px 26px !important;
	border: 0 !important;
	border-radius: 12px !important;
	background: #fff;
	box-shadow: var(--cc-card-shadow);
}

.wc-block-cart .wc-block-cart__main { align-self: start; }

/* Misma separación entre columnas en carrito y checkout. WooCommerce la
 * hace con rellenos distintos en cada uno; aquí, un margen fijo. */
@media (min-width: 700px) {
	.wc-block-cart.wc-block-components-sidebar-layout .wc-block-components-main,
	.wc-block-checkout.wc-block-components-sidebar-layout .wc-block-components-main {
		width: calc(65% - 32px) !important;
		margin-right: 32px !important;
	}

	.wc-block-cart.wc-block-components-sidebar-layout .wc-block-components-sidebar,
	.wc-block-checkout.wc-block-components-sidebar-layout .wc-block-components-sidebar {
		width: 35% !important;
	}

	/* En el checkout las columnas no son tarjetas (lo son sus hijos): fuera
	 * los rellenos con que WooCommerce las separa. En el carrito las columnas
	 * son las propias tarjetas y conservan su relleno. */
	.wc-block-checkout.wc-block-components-sidebar-layout .wc-block-components-main { padding-right: 0 !important; }
	.wc-block-checkout.wc-block-components-sidebar-layout .wc-block-components-sidebar { padding-left: 0 !important; }
}

.wc-block-cart .wc-block-cart-items { border-bottom: 0 !important; margin-bottom: 0 !important; }

/* Sidebar: el contenido de WooCommerce trae márgenes/bordes propios */
.wc-block-cart .wc-block-cart__sidebar { align-self: start; }
.wc-block-checkout .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block {
	margin: 0;
	/* WooCommerce ya rellena cada fila del resumen por dentro (16 px arriba y
	 * abajo); el de abajo se compensa para igualar el título de arriba. */
	padding: 10px 10px 23px !important;
}

/* Títulos: Bebas, como los de Mi cuenta */
.wc-block-cart .wc-block-cart__totals-title,
.wc-block-cart .wc-block-cart-items__header,
.wc-block-checkout .wc-block-components-checkout-step__title,
.wc-block-checkout .wc-block-components-checkout-order-summary__title-text {
	color: var(--cc-text) !important;
	font-family: "Bebas Neue", sans-serif !important;
	font-weight: 400 !important;
	letter-spacing: .02em;
	text-transform: none !important;
}

.wc-block-cart .wc-block-cart__totals-title {
	margin: 0 0 6px !important;
	padding: 0 !important;
	font-size: 28px !important;
	line-height: 1 !important;
}

.wc-block-cart .wc-block-cart-items__header th {
	padding-top: 0 !important;
	font-size: 20px;
}

.wc-block-checkout .wc-block-components-checkout-step__title {
	font-size: 26px !important;
	line-height: 1 !important;
}

.wc-block-checkout .wc-block-components-checkout-order-summary__title-text {
	font-size: 28px !important;
	line-height: 1 !important;
}

/* Separadores interiores más suaves que el gris de WooCommerce */
.wc-block-cart .wc-block-cart-items td,
.wc-block-cart .wc-block-cart-items th,
.wc-block-cart .wc-block-components-totals-wrapper,
.wc-block-checkout .wc-block-components-totals-wrapper,
.wc-block-checkout .wc-block-components-order-summary,
.wc-block-checkout .wc-block-components-checkout-order-summary__content {
	border-color: var(--cc-line) !important;
}

.wc-block-cart .wc-block-cart-items tr:last-child td { border-bottom: 0 !important; }

/* Primera fila de la tarjeta de totales sin raya encima (en móvil el título
 * se oculta y la raya quedaba suelta arriba) */
.wc-block-cart .wc-block-cart__sidebar .wp-block-woocommerce-cart-order-summary-block > .wc-block-components-totals-wrapper:first-of-type,
.wc-block-cart .wc-block-cart__sidebar .wc-block-cart__totals-title + .wc-block-components-totals-wrapper { border-top: 0 !important; }

/* Total: protagonista */
.wc-block-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
.wc-block-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
	font-family: "Bebas Neue", sans-serif;
	font-size: 26px !important;
	font-weight: 400 !important;
	letter-spacing: .02em;
}

.wc-block-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
.wc-block-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
	color: var(--cc-brand);
	font-family: "Bebas Neue", sans-serif;
	font-size: 30px !important;
	font-weight: 400 !important;
}

/* ------------------------------------------------------------------ */
/* Líneas del carrito: misma línea que las de grading                  */
/* ------------------------------------------------------------------ */

.wc-block-cart .wc-block-cart-items__row { position: relative; }

.wc-block-cart .wc-block-components-product-name,
.wc-block-checkout .wc-block-components-product-name {
	color: var(--cc-brand) !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	text-decoration: none !important;
}

.wc-block-cart .wc-block-cart-item__prices,
.wc-block-checkout .wc-block-components-order-summary-item__individual-prices {
	margin-top: 2px !important;
	color: var(--cc-text);
	font-size: 14px !important;
}

/* Atributos (Idioma, Colección…): una línea gris, separada por «·» */
.wc-block-cart .wc-block-components-product-details,
.wc-block-checkout .wc-block-components-product-details {
	margin: 8px 0 0 !important;
	color: var(--cc-muted);
	font-size: 13px !important;
	line-height: 1.5 !important;
}

.wc-block-cart .wc-block-components-product-details:not(:has(.ltw-grc)) > span,
.wc-block-checkout .wc-block-components-product-details:not(:has(.ltw-grc)) > span { display: inline !important; }

.wc-block-components-product-details:not(:has(.ltw-grc)) > span > span[aria-hidden="true"] { font-size: 0; }
.wc-block-components-product-details:not(:has(.ltw-grc)) > span > span[aria-hidden="true"]::before { content: " · "; font-size: 13px; color: #c4b8d3; }

.wc-block-components-product-details:not(:has(.ltw-grc)) .wc-block-components-product-details__name {
	color: #3c3448;
	font-weight: 600 !important;
}

/* Descripción corta (Idioma, Colección…): igual, una línea gris con «·» */
.wc-block-cart .wc-block-components-product-metadata__description,
.wc-block-checkout .wc-block-components-product-metadata__description {
	margin: 8px 0 0 !important;
	color: var(--cc-muted);
	font-size: 13px !important;
	line-height: 1.5 !important;
}

.wc-block-components-product-metadata__description p { display: inline; margin: 0 !important; }
.wc-block-components-product-metadata__description p + p::before { content: " · "; color: #c4b8d3; }
.wc-block-components-product-metadata__description strong { color: #3c3448; font-weight: 600; }

/* «Ahorra 5,00 €»: pastilla, como las etiquetas de grading */
.wc-block-cart .wc-block-components-sale-badge,
.wc-block-checkout .wc-block-components-sale-badge {
	padding: 2px 10px !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: #fcf3cf !important;
	color: #6b4e00 !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	line-height: 1.5 !important;
}

/* Cantidad: el selector, compacto y debajo de los datos */
.wc-block-cart .wc-block-cart-item__quantity { margin-top: 10px !important; }

.wc-block-cart .wc-block-components-quantity-selector {
	width: 104px !important;
	min-width: 0 !important;
	height: 34px !important;
	margin: 0 !important;
	border-radius: 999px !important;
}

.wc-block-cart .wc-block-components-quantity-selector input,
.wc-block-cart .wc-block-components-quantity-selector button {
	height: 32px !important;
	min-height: 0 !important;
	font-size: 14px !important;
}

/* La papelera es un «Quitar» pequeño a la derecha, bajo el total */
.wc-block-cart .wc-block-cart-item__remove-link {
	position: absolute;
	top: 52px;
	right: 16px;
	display: inline-flex !important;
	align-items: center;
	gap: 4px;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	color: var(--cc-muted) !important;
	font-size: 13px !important;
	font-weight: 500;
	line-height: 1.4 !important;
	text-decoration: none !important;
	transition: color .15s;
}

.wc-block-cart .wc-block-cart-item__remove-link svg { width: 15px !important; height: 15px !important; fill: currentColor; }

.wc-block-cart .wc-block-cart-item__remove-link::after {
	content: "Quitar";
	text-decoration: underline;
	text-underline-offset: 3px;
}

.wc-block-cart .wc-block-cart-item__remove-link:hover { color: #a1261d !important; }

/* Con «Ahorra…» bajo el total, «Quitar» baja un poco más */
.wc-block-cart .wc-block-cart-items__row:has(.wc-block-cart-item__total .wc-block-components-sale-badge) .wc-block-cart-item__remove-link { top: 84px; }

/* Móvil: el total va debajo, así que «Quitar» va junto a la cantidad */
.wc-block-cart:is(.is-mobile, .is-small) .wc-block-cart-item__remove-link {
	position: static;
	margin-left: 14px !important;
}

/* Botón de finalizar a todo el ancho de la tarjeta */
.wc-block-cart .wc-block-cart__submit { margin: 16px 0 0 !important; }
.wc-block-cart .wc-block-cart__submit-container { padding: 0 !important; }

/* ------------------------------------------------------------------ */
/* Checkout                                                             */
/* ------------------------------------------------------------------ */

.wc-block-checkout .wc-block-checkout__form > fieldset { margin: 0 0 20px !important; }

.wc-block-checkout .wc-block-components-checkout-step__heading { margin: 0 0 14px !important; }

/* Mismo aire arriba que abajo en cada paso: WooCommerce deja margen inferior
 * en el último elemento y, a veces, bloques vacíos detrás (los de Correos). */
.wc-block-checkout .wc-block-components-checkout-step__content > :empty:not(.wc-block-components-notices) { display: none !important; }
.wc-block-checkout .wc-block-components-checkout-step__content > :nth-last-child(1 of :not(:empty):not(.wc-block-components-notices):not(.wc-block-components-notices__snackbar)) { margin-bottom: 0 !important; }
.wc-block-checkout .wc-block-components-checkout-step__container,
.wc-block-checkout .wc-block-components-checkout-step__content { margin-bottom: 0 !important; padding-bottom: 0 !important; }
.wc-block-checkout .wc-block-components-checkout-step__container::after { display: none !important; }

/* Bloques sin tarjeta propia (nota, condiciones, botón): sin márgenes raros */
.wc-block-checkout .wc-block-checkout__order-notes,
.wc-block-checkout .wc-block-checkout__terms,
.wc-block-checkout .wc-block-checkout__actions {
	margin: 0 0 16px !important;
	padding: 0 4px !important;
}

.wc-block-checkout .wc-block-checkout__order-notes { margin-top: 4px !important; }
.wc-block-checkout .wc-block-checkout__actions { margin-bottom: 0 !important; }

.wc-block-checkout .wc-block-checkout__terms { border-top: 0 !important; }

/* Opciones (envío, pago): radio 8 como los campos del tema */
.wc-block-checkout .wc-block-components-radio-control--highlight-checked,
.wc-block-checkout .wc-block-components-radio-control__option,
.wc-block-checkout .wc-block-components-radio-control-accordion-option,
.wc-block-checkout .wc-block-components-address-card {
	border-radius: 8px !important;
}

.wc-block-checkout .wc-block-components-radio-control--highlight-checked::after { border-radius: 8px !important; }

/* Móvil: WooCommerce repite el resumen completo antes del botón de pagar
 * (.checkout-order-summary-block-fill, con borde gris) y deja arriba uno
 * plegado. Los dos como tarjeta, sin rayas sueltas. */
.wc-block-checkout .checkout-order-summary-block-fill {
	padding: 6px 10px !important;
	border: 0 !important;
	border-radius: 12px !important;
	background: #fff;
	box-shadow: var(--cc-card-shadow);
}

.wc-block-checkout .wc-block-components-checkout-order-summary__title {
	border: 0 !important;
}

/* ------------------------------------------------------------------ */
/* Móvil                                                                */
/* ------------------------------------------------------------------ */

@media (max-width: 699px) {
	.wc-block-cart .wc-block-cart__main,
	.wc-block-cart .wc-block-cart__sidebar,
	.wc-block-checkout .wc-block-checkout__form > fieldset,
	.wc-block-checkout .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block {
		padding: 18px 16px !important;
	}

	.wc-block-cart .wc-block-cart__sidebar { margin-top: 20px; }
}

/* ------------------------------------------------------------------ */
/* Pedido recibido (views/woocommerce/checkout/thankyou.php)            */
/* ------------------------------------------------------------------ */

.ltw-thankyou-page {
	--cc-brand: #510395;
	--cc-soft: #f8f1fe;
	--cc-line: #ece4f5;
	--cc-text: #232323;
	--cc-muted: #6d6578;
	--cc-card-shadow: 0 1px 2px rgba(27, 6, 45, .04), 0 10px 30px rgba(81, 3, 149, .07);
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 24px;
	align-items: start;
	color: var(--cc-text);
}

@media (min-width: 900px) {
	/* Detalle a la izquierda; FrikiCoins y direcciones a la derecha */
	/* dense: el detalle (2 filas) sube junto a la tarjeta de FrikiCoins */
	.ltw-thankyou-page { grid-template-columns: minmax(0, 65fr) minmax(0, 35fr); grid-auto-flow: row dense; column-gap: 32px; }
	.ltw-thankyou-page > * { grid-column: 1 / -1; }
	.ltw-thankyou-page > .woocommerce-order-details { grid-column: 1; grid-row: span 2; }
	.ltw-thankyou-page > .ltw-fc-thankyou,
	.ltw-thankyou-page > .woocommerce-customer-details { grid-column: 2; }
}

/* Tarjetas */
.ltw-thankyou,
.ltw-thankyou-page > .woocommerce-order-details,
.ltw-thankyou-page > .woocommerce-customer-details,
.ltw-thankyou-page > .woocommerce-bacs-bank-details,
.ltw-thankyou-page > section.woocommerce-bacs-bank-details {
	max-width: none !important;
	margin: 0 !important;
	padding: 24px 26px !important;
	border-radius: 12px;
	background: #fff;
	box-shadow: var(--cc-card-shadow);
}

/* 5 px menos abajo: el título en Bebas trae menos aire arriba que el
 * interlineado de la última línea de texto abajo */
.ltw-thankyou-page > .woocommerce-order-details,
.ltw-thankyou-page > .woocommerce-customer-details { padding-bottom: 19px !important; }

/* Cabecera de agradecimiento */
.ltw-thankyou {
	display: grid;
	justify-items: center;
	gap: 10px;
	padding: 36px 28px !important;
	text-align: center;
}

.ltw-thankyou__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #e6f6ea;
	color: #17663a;
	box-shadow: 0 0 0 8px #f3fbf5;
}

.ltw-thankyou .ltw-thankyou__title {
	margin: 8px 0 0 !important;
	font-size: clamp(32px, 4vw, 44px) !important;
	line-height: 1 !important;
}

.ltw-thankyou__text {
	max-width: 620px;
	margin: 0 !important;
	color: var(--cc-muted);
	font-size: 16px;
}

.ltw-thankyou__text strong { color: var(--cc-text); }

.ltw-thankyou__overview {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	width: 100%;
	max-width: 780px;
	margin: 14px 0 6px !important;
	padding: 0 !important;
	overflow: hidden;
	border: 1px solid var(--cc-line);
	border-radius: 10px;
	list-style: none;
}

.ltw-thankyou__overview::before,
.ltw-thankyou__overview::after { content: none !important; display: none !important; }

.ltw-thankyou__overview li {
	display: grid;
	gap: 2px;
	margin: 0 !important;
	padding: 12px 16px !important;
	border: 0 !important;
	background: var(--cc-soft);
	text-align: left;
}

.ltw-thankyou__overview li + li { box-shadow: inset 1px 0 0 var(--cc-line); }

.ltw-thankyou__overview span {
	color: var(--cc-muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.ltw-thankyou__overview strong,
.ltw-thankyou__overview strong .woocommerce-Price-amount,
.ltw-thankyou__overview strong .woocommerce-Price-amount * {
	color: var(--cc-text) !important;
	font-size: 15px !important;
	font-weight: 700;
	word-break: break-word;
}

.ltw-thankyou__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-top: 6px;
}

/* Títulos de sección en Bebas, como Mi cuenta */
.ltw-thankyou-page h2.woocommerce-order-details__title,
.ltw-thankyou-page h2.woocommerce-column__title,
.ltw-thankyou-page .woocommerce-bacs-bank-details h2,
.ltw-thankyou-page .woocommerce-bacs-bank-details h3 {
	margin: 0 0 14px !important;
	font-family: "Bebas Neue", sans-serif;
	font-size: 28px !important;
	font-weight: 400;
	line-height: 1 !important;
}

/* Tabla del pedido */
.ltw-thankyou-page table.order_details {
	width: 100%;
	margin: 0 !important;
	border: 0 !important;
	border-collapse: collapse;
	font-size: 15px;
}

.ltw-thankyou-page table.order_details th,
.ltw-thankyou-page table.order_details td {
	padding: 12px 0 !important;
	border: 0 !important;
	border-bottom: 1px solid var(--cc-line) !important;
	background: none !important;
	color: var(--cc-text) !important;
	text-align: left;
	vertical-align: top;
}

.ltw-thankyou-page table.order_details thead th {
	padding-top: 0 !important;
	color: var(--cc-muted) !important;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.ltw-thankyou-page table.order_details th:last-child,
.ltw-thankyou-page table.order_details td:last-child { text-align: right; }

.ltw-thankyou-page table.order_details tfoot th { font-weight: 500; }
.ltw-thankyou-page table.order_details tfoot tr:last-child > * { border-bottom: 0 !important; padding-bottom: 0 !important; }

/* Total: por contenido, no por posición (FrikiCoins añade filas detrás) */
.ltw-thankyou-page table.order_details tfoot tr:has(.includes_tax) > * {
	color: var(--cc-brand) !important;
	font-size: 17px;
	font-weight: 700;
}

.ltw-thankyou-page table.order_details .product-name a { color: var(--cc-brand); font-weight: 600; text-decoration: none; }
.ltw-thankyou-page table.order_details .wc-item-meta { margin: 6px 0 0; padding: 0; list-style: none; color: var(--cc-muted); font-size: 13px; }

/* Direcciones: apiladas en la columna derecha */
.ltw-thankyou-page .woocommerce-customer-details .col2-set {
	display: grid;
	gap: 18px;
}

.ltw-thankyou-page .woocommerce-customer-details .col2-set::before,
.ltw-thankyou-page .woocommerce-customer-details .col2-set::after { content: none; }

.ltw-thankyou-page .woocommerce-customer-details .col-1,
.ltw-thankyou-page .woocommerce-customer-details .col-2 {
	float: none !important;
	width: auto !important;
	max-width: none !important;
}

.ltw-thankyou-page .woocommerce-customer-details address {
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	color: var(--cc-muted);
	font-size: 15px;
	font-style: normal;
	line-height: 1.6;
}

.ltw-thankyou-page .woocommerce-customer-details address p { font-size: 15px; }

.ltw-thankyou-page .woocommerce-customer-details h2.woocommerce-column__title { font-size: 22px !important; margin-bottom: 8px !important; }

@media (max-width: 699px) {
	.ltw-thankyou,
	.ltw-thankyou-page > .woocommerce-order-details,
	.ltw-thankyou-page > .woocommerce-customer-details { padding: 20px 16px !important; }
	.ltw-thankyou__overview li + li { box-shadow: inset 0 1px 0 var(--cc-line); }
	.ltw-thankyou__actions > * { flex: 1 1 100%; }
}
