/**
 * LinoCrochet: skin del carrito y el checkout nativos de WooCommerce.
 * Solo se carga en esas dos paginas.
 */

/* ---------- Carrito y checkout de WooCommerce (skin) ---------- */

/* Las páginas /carrito y /finalizar-compra usan los shortcodes nativos de
   WooCommerce (no se reemplaza su markup: de él dependen pasarelas, cupones
   y AJAX). Aquí solo se les da la piel de la marca, delimitando todo con
   las clases del body (.woocommerce-cart / .woocommerce-checkout) para no
   tocar el resto del sitio. */

/* Avisos (cupón aplicado, errores, etc.) en ambas páginas. */

.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-info,
.woocommerce-cart .woocommerce-error,
.woocommerce-checkout .woocommerce-message,
.woocommerce-checkout .woocommerce-info,
.woocommerce-checkout .woocommerce-error {
	background: #fdf8e7;
	border-top-color: #c9a227;
	color: #4f4636;
	border-radius: 0 0 12px 12px;
}

.woocommerce-cart .woocommerce-error,
.woocommerce-checkout .woocommerce-error {
	background: #fbeeea;
	border-top-color: #b35643;
}

/* --- Carrito en dos columnas: productos + resumen sticky --- */

.woocommerce-cart .entry-content .woocommerce {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 28px;
	align-items: start;
}

.woocommerce-cart .entry-content .woocommerce > .woocommerce-notices-wrapper {
	grid-column: 1 / -1;
}

.woocommerce-cart form.woocommerce-cart-form {
	margin: 0;
	min-width: 0;
}

.woocommerce-cart .cart-collaterals {
	position: sticky;
	top: 24px;
	width: 100%;
}

/* Los cross-sells no caben en la columna del resumen; el sitio ya tiene
   sus propios bloques de productos relacionados. */
.woocommerce-cart .cart-collaterals .cross-sells {
	display: none;
}

/* --- Filas del carrito como tarjetas --- */

/* La tabla nativa se convierte en tarjetas con grid: se conservan el form,
   los names y los data-attributes de los que depende el AJAX de Woo. */

.woocommerce-cart .woocommerce table.shop_table.cart {
	display: block;
	background: transparent;
	border: none;
	border-radius: 0;
	box-shadow: none;
	margin: 0;
}

.woocommerce-cart .woocommerce table.shop_table.cart thead {
	display: none;
}

.woocommerce-cart .woocommerce table.shop_table.cart tbody {
	display: block;
}

.woocommerce-cart .woocommerce table.shop_table.cart tr {
	display: block;
}

.woocommerce-cart .woocommerce table.shop_table.cart th,
.woocommerce-cart .woocommerce table.shop_table.cart td {
	display: block;
	border: none;
	padding: 0;
	background: transparent;
	vertical-align: middle;
}

/* Neutraliza las etiquetas "Producto:", "Precio:"... del modo apilado
   nativo (content: attr(data-title)) que ya no hacen falta. */
.woocommerce-cart .woocommerce table.shop_table.cart td::before {
	display: none;
	content: none;
}

.woocommerce-cart .woocommerce table.shop_table.cart tr.cart_item {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr) auto;
	grid-template-areas:
		"imagen nombre precio"
		"imagen cantidad quitar";
	column-gap: 18px;
	row-gap: 6px;
	align-items: center;
	background: #fff;
	border: 1px solid #e5e0d8;
	border-radius: 16px;
	padding: 18px;
	margin-bottom: 16px;
	box-shadow: 0 6px 18px rgba(79, 70, 54, 0.05);
}

.woocommerce-cart .woocommerce table.shop_table.cart td.product-thumbnail {
	grid-area: imagen;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.product-name {
	grid-area: nombre;
	align-self: end;
	font-size: 1.05rem;
}

/* El subtotal de la línea es el precio grande de la esquina; el precio
   unitario se oculta (con cantidad 1 serían el mismo número repetido). */

.woocommerce-cart .woocommerce table.shop_table.cart td.product-subtotal {
	grid-area: precio;
	align-self: end;
	justify-self: end;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.product-price {
	display: none;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.product-quantity {
	grid-area: cantidad;
	align-self: start;
	justify-self: start;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.product-remove {
	grid-area: quitar;
	align-self: start;
	justify-self: end;
}

/* Quitar (X): circulito discreto que se enciende en rojo cálido. */
.woocommerce-cart .woocommerce table.shop_table.cart a.remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 999px;
	color: #8a7b60;
	background: transparent;
	transition: background 0.15s ease, color 0.15s ease;
}

.woocommerce-cart .woocommerce table.shop_table.cart a.remove:hover,
.woocommerce-cart .woocommerce table.shop_table.cart a.remove:focus {
	background: #fbeeea;
	color: #b35643;
}

.woocommerce-cart .woocommerce table.shop_table.cart a.remove svg {
	width: 16px;
	height: 16px;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.product-thumbnail img {
	width: 96px;
	height: 96px;
	object-fit: cover;
	border-radius: 12px;
	border: 1px solid #f0ebe2;
	display: block;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.product-name a {
	color: #4f4636;
	font-weight: 600;
	text-decoration: none;
	transition: color 0.15s ease;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.product-name a:hover {
	color: #a67b5b;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.product-price,
.woocommerce-cart .woocommerce table.shop_table.cart td.product-subtotal {
	color: #4f4636;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.product-subtotal .amount {
	font-weight: 600;
	font-size: 1.1rem;
	color: #2f2a1e;
}

/* --- Cantidad: píldora con botones − / + (los agrega el JS del plugin) --- */

.woocommerce-cart .woocommerce table.shop_table.cart .quantity {
	display: inline-flex;
	align-items: center;
	border: 1px solid #e5e0d8;
	border-radius: 999px;
	background: #fff;
	overflow: hidden;
}

.woocommerce-cart .woocommerce table.shop_table.cart button.lino-qty-boton {
	width: 34px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: none;
	border-radius: 0;
	color: #8a7b60;
	font-size: 1.05rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.woocommerce-cart .woocommerce table.shop_table.cart button.lino-qty-boton:hover,
.woocommerce-cart .woocommerce table.shop_table.cart button.lino-qty-boton:focus {
	background: #fdf8e7;
	border: none;
	color: #2f2a1e;
	box-shadow: none;
	outline: none;
}

.woocommerce-cart .woocommerce table.shop_table.cart input.qty {
	width: 44px;
	background: #fff;
	border: none;
	border-radius: 0;
	padding: 8px 0;
	text-align: center;
	color: #4f4636;
	font-weight: 600;
	box-shadow: none;
	-moz-appearance: textfield;
	appearance: textfield;
}

.woocommerce-cart .woocommerce table.shop_table.cart input.qty::-webkit-outer-spin-button,
.woocommerce-cart .woocommerce table.shop_table.cart input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.woocommerce-cart .woocommerce table.shop_table.cart input.qty:focus {
	border: none;
	box-shadow: none;
	outline: none;
}

/* --- Fila de acciones como tarjeta aparte (cupón + actualizar) --- */

.woocommerce-cart .woocommerce table.shop_table.cart td.actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 14px;
	background: #faf7f1;
	border: 1px solid #e5e0d8;
	border-radius: 16px;
	padding: 14px 18px;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.actions .coupon {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	float: none;
	margin: 0;
}

.woocommerce-cart .woocommerce table.shop_table.cart input#coupon_code {
	background: #fff;
	border: 1px solid #e5e0d8;
	border-radius: 999px;
	padding: 10px 18px;
	width: 180px;
	color: #4f4636;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.woocommerce-cart .woocommerce table.shop_table.cart input#coupon_code:focus {
	border-color: #c9a227;
	box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
	outline: none;
}

/* Con el stepper activo el carrito se actualiza solo: el botón nativo
   "Actualizar carrito" queda oculto (el JS le añade esta clase al form). */
.woocommerce-cart form.lino-carrito-auto td.actions button.button[name="update_cart"] {
	display: none;
}

/* Botones secundarios (aplicar cupón, actualizar carrito): píldora neutra,
   con cada estado explícito para que Astra no cuele sus colores. */

.woocommerce-cart .woocommerce table.shop_table.cart td.actions button.button {
	background: #fff;
	border: 1px solid #e5e0d8;
	border-radius: 999px;
	padding: 10px 22px;
	color: #4f4636;
	font-weight: 500;
	cursor: pointer;
	box-shadow: none;
	text-transform: none;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.actions button.button:focus {
	background: #fff;
	border-color: #e5e0d8;
	color: #4f4636;
	outline: none;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.actions button.button:hover {
	background: #fdf8e7;
	border-color: #c9a227;
	color: #2f2a1e;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.actions button.button:focus-visible {
	outline: 2px solid #c9a227;
	outline-offset: 2px;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.actions button.button:disabled,
.woocommerce-cart .woocommerce table.shop_table.cart td.actions button.button:disabled:hover {
	background: #fff;
	border-color: #f0ebe2;
	color: #c5bba9;
	cursor: not-allowed;
}

/* --- Totales del carrito como tarjeta --- */

.woocommerce-cart .cart-collaterals .cart_totals {
	/* Woo lo flota a la derecha al 48%; aquí ocupa toda su columna. */
	float: none;
	width: 100%;
	background: #faf7f1;
	border: 1px solid #e5e0d8;
	border-radius: 18px;
	padding: 26px 26px 28px;
}

.woocommerce-cart .cart-collaterals .cart_totals h2 {
	margin: 0 0 16px;
	font-size: 1.2rem;
	color: #2f2a1e;
	padding-bottom: 14px;
	border-bottom: 1px solid #eadfc6;
}

.woocommerce-cart .cart-collaterals .cart_totals table.shop_table {
	background: transparent;
	border: none;
	margin-bottom: 8px;
}

.woocommerce-cart .cart-collaterals .cart_totals table.shop_table th,
.woocommerce-cart .cart-collaterals .cart_totals table.shop_table td {
	border: none;
	border-bottom: 1px solid #eee8db;
	padding: 12px 0;
	background: transparent;
	color: #4f4636;
}

.woocommerce-cart .cart-collaterals .cart_totals table.shop_table th {
	font-weight: 500;
	color: #8a7b60;
}

.woocommerce-cart .cart-collaterals .cart_totals tr.order-total th,
.woocommerce-cart .cart-collaterals .cart_totals tr.order-total td {
	border-bottom: none;
	padding-top: 16px;
	font-size: 1.05rem;
}

.woocommerce-cart .cart-collaterals .cart_totals tr.order-total .amount {
	color: #2f2a1e;
	font-size: 1.25rem;
}

/* Botón principal: dorado, igual que el CTA del hero. */

.woocommerce-cart .wc-proceed-to-checkout {
	padding: 0;
	margin-top: 18px;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
	display: block;
	text-align: center;
	background: #c9a227;
	border: 2px solid #c9a227;
	border-radius: 999px;
	padding: 14px 28px;
	color: #fff;
	font-weight: 600;
	font-size: 1rem;
	text-decoration: none;
	box-shadow: none;
	transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:focus {
	background: #b8931f;
	border-color: #b8931f;
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 8px 18px rgba(201, 162, 39, 0.35);
	outline: none;
}

/* Líneas de confianza bajo el botón (las imprime el plugin vía hook). */

ul.lino-carrito-confianza {
	list-style: none;
	margin: 18px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

ul.lino-carrito-confianza li {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #8a7b60;
	font-size: 0.88rem;
}

ul.lino-carrito-confianza svg {
	width: 18px;
	height: 18px;
	flex: none;
	color: #a67b5b;
}

/* --- Carrito vacío --- */

.woocommerce-cart .wc-empty-cart-message .cart-empty {
	background: transparent;
	border: none;
	text-align: center;
	font-size: 1.15rem;
	color: #8a7b60;
	padding: 40px 0 10px;
}

.woocommerce-cart .return-to-shop {
	text-align: center;
	padding-bottom: 30px;
}

.woocommerce-cart .return-to-shop a.button {
	display: inline-block;
	background: #c9a227;
	border: 2px solid #c9a227;
	border-radius: 999px;
	padding: 12px 28px;
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.woocommerce-cart .return-to-shop a.button:hover,
.woocommerce-cart .return-to-shop a.button:focus {
	background: #b8931f;
	border-color: #b8931f;
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 8px 18px rgba(201, 162, 39, 0.35);
}

/* --- Responsive del carrito --- */

@media (max-width: 960px) {
	/* Una sola columna: el resumen pasa debajo de los productos. */
	.woocommerce-cart .entry-content .woocommerce {
		grid-template-columns: minmax(0, 1fr);
	}

	.woocommerce-cart .cart-collaterals {
		position: static;
	}
}

@media (max-width: 560px) {
	.woocommerce-cart .woocommerce table.shop_table.cart tr.cart_item {
		grid-template-columns: 72px minmax(0, 1fr) auto;
		column-gap: 12px;
		padding: 14px;
	}

	.woocommerce-cart .woocommerce table.shop_table.cart td.product-thumbnail img {
		width: 72px;
		height: 72px;
	}

	.woocommerce-cart .woocommerce table.shop_table.cart td.product-name {
		font-size: 0.98rem;
	}

	.woocommerce-cart .woocommerce table.shop_table.cart td.actions .coupon {
		display: flex;
		flex-wrap: wrap;
		width: 100%;
	}

	.woocommerce-cart .woocommerce table.shop_table.cart input#coupon_code {
		flex: 1;
		width: auto;
	}
}

/* --- Checkout: títulos de sección --- */

/* El id se duplica a propósito: Astra usa selectores con dos ids
   (`form #order_review_heading:not(...#...)`) y hay que superarlos. */

.woocommerce-checkout form.woocommerce-checkout h3,
.woocommerce-checkout form.woocommerce-checkout #order_review_heading#order_review_heading {
	margin: 0 0 20px;
	padding: 0 0 14px;
	border: none;
	border-bottom: 1px solid #eadfc6;
	font-size: 1.2rem;
	color: #2f2a1e;
}

/* --- Checkout: campos del formulario --- */

.woocommerce-checkout form.woocommerce-checkout .form-row label {
	color: #4f4636;
	font-weight: 500;
	font-size: 0.92rem;
}

.woocommerce-checkout form.woocommerce-checkout .form-row .required {
	color: #b35643;
	text-decoration: none;
}

.woocommerce-checkout form.woocommerce-checkout .form-row input.input-text,
.woocommerce-checkout form.woocommerce-checkout .form-row textarea,
.woocommerce-checkout form.woocommerce-checkout .form-row select {
	background: #fff;
	border: 1px solid #e5e0d8;
	border-radius: 10px;
	padding: 10px 14px;
	color: #4f4636;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.woocommerce-checkout form.woocommerce-checkout .form-row input.input-text:focus,
.woocommerce-checkout form.woocommerce-checkout .form-row textarea:focus,
.woocommerce-checkout form.woocommerce-checkout .form-row select:focus {
	border-color: #c9a227;
	box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
	outline: none;
}

/* Select de país/provincia cuando WooCommerce lo convierte en selectWoo. */

.woocommerce-checkout .select2-container--default .select2-selection--single {
	border: 1px solid #e5e0d8;
	border-radius: 10px;
	height: 44px;
	display: flex;
	align-items: center;
}

.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__rendered {
	color: #4f4636;
	line-height: 1.4;
	padding-left: 14px;
}

.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__arrow {
	height: 42px;
}

.woocommerce-checkout .select2-container--default.select2-container--focus .select2-selection--single,
.woocommerce-checkout .select2-container--default.select2-container--open .select2-selection--single {
	border-color: #c9a227;
	box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

/* Radios y checkboxes (envío, términos, métodos de pago) en dorado. */

.woocommerce-checkout form.woocommerce-checkout input[type="radio"],
.woocommerce-checkout form.woocommerce-checkout input[type="checkbox"] {
	accent-color: #c9a227;
}

/* --- Checkout: formulario de cupón plegable --- */

.woocommerce-checkout form.checkout_coupon {
	background: #faf7f1;
	border: 1px solid #e5e0d8;
	border-radius: 18px;
	padding: 20px;
	margin-bottom: 28px;
}

.woocommerce-checkout form.checkout_coupon input#coupon_code {
	background: #fff;
	border: 1px solid #e5e0d8;
	border-radius: 999px;
	padding: 10px 18px;
	color: #4f4636;
	box-shadow: none;
}

.woocommerce-checkout form.checkout_coupon input#coupon_code:focus {
	border-color: #c9a227;
	box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
	outline: none;
}

.woocommerce-checkout form.checkout_coupon button.button {
	background: #fff;
	border: 1px solid #e5e0d8;
	border-radius: 999px;
	padding: 10px 22px;
	color: #4f4636;
	font-weight: 500;
	cursor: pointer;
	box-shadow: none;
	text-transform: none;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.woocommerce-checkout form.checkout_coupon button.button:focus {
	background: #fff;
	border-color: #e5e0d8;
	color: #4f4636;
	outline: none;
}

.woocommerce-checkout form.checkout_coupon button.button:hover {
	background: #fdf8e7;
	border-color: #c9a227;
	color: #2f2a1e;
}

.woocommerce-checkout .woocommerce-form-coupon-toggle a.showcoupon {
	color: #a67b5b;
	font-weight: 600;
	text-decoration: underline;
}

.woocommerce-checkout .woocommerce-form-coupon-toggle a.showcoupon:hover {
	color: #c9a227;
}

/* --- Checkout: resumen del pedido como tarjeta --- */

/* Ids duplicados por la misma razón de arriba (bordes de 2px de Astra). */

.woocommerce-checkout form.woocommerce-checkout #order_review#order_review {
	background: #faf7f1;
	border: 1px solid #e5e0d8;
	border-radius: 18px;
	padding: 26px;
}

.woocommerce-checkout form.woocommerce-checkout #order_review_heading#order_review_heading {
	margin-top: 24px;
}

.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table {
	background: transparent;
	border: none;
	margin-bottom: 18px;
}

.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table th,
.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table td {
	border: none;
	border-bottom: 1px solid #eee8db;
	padding: 12px 0;
	background: transparent;
	color: #4f4636;
}

.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table thead th {
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #8a7b60;
}

.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table .product-quantity {
	color: #8a7b60;
	font-weight: 500;
}

.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr.order-total th,
.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr.order-total td {
	border-bottom: none;
	padding-top: 16px;
	font-size: 1.05rem;
}

.woocommerce-checkout #order_review table.woocommerce-checkout-review-order-table tr.order-total .amount {
	color: #2f2a1e;
	font-size: 1.25rem;
}

/* --- Checkout: métodos de pago --- */

/* WooCommerce pinta #payment con un gris propio; se neutraliza. */

.woocommerce-checkout #payment.woocommerce-checkout-payment {
	background: transparent;
	border-radius: 0;
}

.woocommerce-checkout #payment ul.payment_methods {
	border-bottom: 1px solid #eee8db;
	padding: 0 0 16px;
	margin-bottom: 16px;
}

.woocommerce-checkout #payment ul.payment_methods li {
	color: #4f4636;
}

.woocommerce-checkout #payment ul.payment_methods li .woocommerce-info {
	background: #fdf8e7;
	border-top-color: #c9a227;
	color: #4f4636;
	border-radius: 12px;
}

/* Cajita con la descripción del método de pago seleccionado. */
.woocommerce-checkout #payment div.payment_box {
	background: #f3ecdf;
	color: #4f4636;
	border-radius: 12px;
}

.woocommerce-checkout #payment div.payment_box::before {
	border-bottom-color: #f3ecdf;
}

.woocommerce-checkout #payment .woocommerce-privacy-policy-text p {
	color: #8a7b60;
	font-size: 0.85rem;
	line-height: 1.6;
}

.woocommerce-checkout #payment .woocommerce-privacy-policy-text a {
	color: #a67b5b;
}

/* Botón principal: dorado, igual que el del carrito. */

.woocommerce-checkout #payment button#place_order {
	display: block;
	width: 100%;
	background: #c9a227;
	border: 2px solid #c9a227;
	border-radius: 999px;
	padding: 14px 28px;
	color: #fff;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	box-shadow: none;
	text-transform: none;
	transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.woocommerce-checkout #payment button#place_order:focus {
	background: #c9a227;
	border-color: #c9a227;
	color: #fff;
	outline: none;
}

.woocommerce-checkout #payment button#place_order:hover {
	background: #b8931f;
	border-color: #b8931f;
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 8px 18px rgba(201, 162, 39, 0.35);
}

.woocommerce-checkout #payment button#place_order:focus-visible {
	outline: 2px solid #c9a227;
	outline-offset: 2px;
}

