/* =====================================================================
   CARRITO Y CHECKOUT — Márgenes uniformes + estilos visuales
   Theme: bricks-child
   - Contenedor del sitio (centrado, hasta 1366px, padding lateral responsive).
   - Diseño del carrito: tarjetas, botones, inputs y layout en dos columnas
     coherentes con el diseño general (Montserrat, negro/blanco, uppercase).
   ===================================================================== */

/* ---------- Contenedor (carrito y checkout) ---------- */
body.woocommerce-cart .woocommerce,
body.page-id-17 .woocommerce,
body.woocommerce-checkout .woocommerce,
body.page-id-18 .woocommerce {
	max-width: 1366px;
	margin: 0 auto;
	padding: 3.5rem clamp(1.25rem, 2vw, 1.75rem) 5rem;
	box-sizing: border-box;
}

/* El formulario de checkout no necesita margen propio (el contenedor lo centra) */
body.woocommerce-checkout form.checkout.woocommerce-checkout {
	margin: 0;
}

/* ---------- Ocultar el título heredado "Inicia sesión para comprar" (sobra
     ahora que se puede comprar como invitado y el login está en el checkout) */
body.page-id-17 h1.lp-title-sm,
body.page-id-18 h1.lp-title-sm {
	display: none;
}

/* =====================================================================
   CARRITO (WooCommerce)
   ===================================================================== */

/* Layout: dos columnas en desktop (como el checkout: 1.15fr / 0.85fr) */
@media (min-width: 992px) {
	body.woocommerce-cart .woocommerce:has(form.woocommerce-cart-form) {
		display: grid;
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
		column-gap: 2.75rem;
		row-gap: 1.5rem;
		align-items: start;
	}

	body.woocommerce-cart .woocommerce:has(form.woocommerce-cart-form) > .woocommerce-message,
	body.woocommerce-cart .woocommerce:has(form.woocommerce-cart-form) > .woocommerce-info,
	body.woocommerce-cart .woocommerce:has(form.woocommerce-cart-form) > .woocommerce-error,
	body.woocommerce-cart .woocommerce-notices-wrapper {
		grid-column: 1 / -1;
	}

	body.woocommerce-cart form.woocommerce-cart-form {
		grid-column: 1;
		min-width: 0;
	}

	body.woocommerce-cart .cart-collaterals {
		grid-column: 2;
		min-width: 0;
		position: sticky;
		top: 1.5rem;
	}
}

/* Tabla del carrito en tarjeta */
body.woocommerce-cart table.shop_table.cart {
	width: 100%;
	background: #fff;
	border: 1px solid #eae8e4;
	border-radius: 1.25rem;
	box-shadow: 0 12px 34px rgba(0, 0, 0, 0.04);
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
}

body.woocommerce-cart table.shop_table.cart thead th {
	padding: 1rem 1.25rem;
	background: #faf9f7;
	border-bottom: 1px solid #f0ede8;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8a867e;
}

body.woocommerce-cart table.shop_table.cart tbody td {
	padding: 1.25rem;
	border-bottom: 1px solid #f0ede8;
	vertical-align: middle;
}

body.woocommerce-cart table.shop_table.cart .cart_item:last-child td {
	border-bottom: 0;
}

body.woocommerce-cart table.shop_table.cart .product-thumbnail img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 0.65rem;
}

body.woocommerce-cart table.shop_table.cart .product-name a {
	color: #1a1917;
	font-weight: 600;
	text-decoration: none;
}

body.woocommerce-cart table.shop_table.cart .product-name a:hover {
	text-decoration: underline;
}

body.woocommerce-cart table.shop_table.cart .product-price .amount,
body.woocommerce-cart table.shop_table.cart .product-subtotal .amount {
	color: #1a1917;
	font-weight: 600;
	white-space: nowrap;
}

body.woocommerce-cart table.shop_table.cart .product-subtotal .amount {
	font-weight: 700;
	color: #000;
}

/* Eliminar (×) */
body.woocommerce-cart table.shop_table.cart .product-remove .remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	font-size: 1.4rem;
	line-height: 1;
	color: #8a867e;
	text-decoration: none;
	transition: color 0.15s ease, background 0.15s ease;
}

body.woocommerce-cart table.shop_table.cart .product-remove .remove:hover {
	color: #fff;
	background: #c0392b;
}

/* Cantidad (stepper) */
body.woocommerce-cart .quantity {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

body.woocommerce-cart .quantity .action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	color: #1a1917;
	background: #f6f4f1;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

body.woocommerce-cart .quantity .action:hover {
	background: #000;
	color: #fff;
}

body.woocommerce-cart .quantity .action svg {
	width: 1rem;
	height: 1rem;
}

/* Fila de acciones (cupón + actualizar) */
body.woocommerce-cart table.shop_table.cart tr td.actions {
	background: #faf9f7;
}

body.woocommerce-cart .coupon {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0;
}

html body.woocommerce-cart table.shop_table.cart .actions .coupon .input-text {
	flex: 1 1 auto;
	min-width: 0;
	height: 3rem !important;
	width: auto !important;
	padding: 0 1rem !important;
	font-family: inherit;
	font-size: 0.95rem;
	color: #1a1917;
	background: #fff !important;
	border: 1px solid #ddd9d2 !important;
	border-radius: 0.65rem !important;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

html body.woocommerce-cart table.shop_table.cart .actions .coupon .input-text:focus {
	outline: none;
	border-color: #000 !important;
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06) !important;
	background: #fff !important;
}

html body.woocommerce-cart table.shop_table.cart .cart_item .quantity .qty {
	flex: 0 0 auto;
	width: 3.5rem !important;
	height: 3rem !important;
	text-align: center;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	color: #1a1917;
	background: #fff !important;
	border: 1px solid #ddd9d2 !important;
	border-radius: 0.65rem !important;
	padding: 0 0.25rem !important;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

html body.woocommerce-cart table.shop_table.cart .cart_item .quantity .qty:focus {
	outline: none;
	border-color: #000 !important;
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06) !important;
	background: #fff !important;
}

body.woocommerce-cart .coupon button,
body.woocommerce-cart button[name="update_cart"] {
	height: 3rem;
	padding: 0 1.5rem;
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	border: 1px solid #000;
	border-radius: 0.65rem;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

body.woocommerce-cart .coupon button {
	background: #000;
	color: #fff;
}

body.woocommerce-cart .coupon button:hover {
	background: #2a2926;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

body.woocommerce-cart button[name="update_cart"] {
	background: transparent;
	color: #000;
}

body.woocommerce-cart button[name="update_cart"]:hover {
	background: #000;
	color: #fff;
}

body.woocommerce-cart button[name="update_cart"]:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

/* Totales del carrito (card) */
body.woocommerce-cart .cart_totals {
	background: #fff;
	border: 1px solid #eae8e4;
	border-radius: 1.25rem;
	padding: 1.75rem;
	box-shadow: 0 12px 34px rgba(0, 0, 0, 0.04);
}

body.woocommerce-cart .cart_totals h2 {
	margin: 0 0 1.25rem;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: clamp(1.05rem, 1.2vw, 1.25rem);
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #000;
}

body.woocommerce-cart .cart_totals h2::before {
	content: "";
	width: 5px;
	height: 1.1em;
	border-radius: 99px;
	background: #000;
	flex: 0 0 auto;
}

body.woocommerce-cart .cart_totals table.shop_table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
}

body.woocommerce-cart .cart_totals table.shop_table th,
body.woocommerce-cart .cart_totals table.shop_table td {
	padding: 0.85rem 0;
	border: 0;
	border-bottom: 1px solid #f0ede8;
}

body.woocommerce-cart .cart_totals table.shop_table th {
	font-weight: 600;
	color: #1a1917;
	font-size: 0.9rem;
}

body.woocommerce-cart .cart_totals table.shop_table td {
	text-align: right;
	color: #5c5a55;
	font-size: 0.9rem;
}

body.woocommerce-cart .cart_totals table.shop_table tr:last-child th,
body.woocommerce-cart .cart_totals table.shop_table tr:last-child td {
	border-bottom: 0;
}

body.woocommerce-cart .cart_totals table.shop_table .order-total .amount {
	font-size: 1.35rem;
	font-weight: 800;
	color: #000;
}

body.woocommerce-cart .cart_totals .includes_tax {
	font-size: 0.78rem;
	color: #8a867e;
	font-weight: 500;
}

body.woocommerce-cart .wc-proceed-to-checkout {
	margin: 1.25rem 0 0;
	padding: 0;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
	display: flex;
	width: 100%;
	height: 3.25rem;
	align-items: center;
	justify-content: center;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #fff !important;
	background: #000;
	border: 1px solid #000;
	border-radius: 1rem;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
	background: #2a2926;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:active {
	transform: translateY(1px);
}

/* Carrito vacío */
body.woocommerce-cart .cart-empty.woocommerce-info {
	max-width: 30rem;
	margin: 0 auto;
	text-align: center;
	color: #1a1917;
	background: #fff;
	border: 1px solid #eae8e4;
	border-radius: 1.25rem;
	padding: 2.5rem 1.75rem;
	box-shadow: 0 12px 34px rgba(0, 0, 0, 0.04);
}

body.woocommerce-cart .return-to-shop {
	text-align: center;
	margin-top: 1.5rem;
}

body.woocommerce-cart .return-to-shop a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 3.25rem;
	padding: 0 2rem;
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #fff;
	background: #000;
	border: 1px solid #000;
	border-radius: 1rem;
	text-decoration: none;
	transition: background 0.2s ease, box-shadow 0.2s ease;
}

body.woocommerce-cart .return-to-shop a:hover {
	background: #2a2926;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* Avisos / mensajes del carrito */
body.woocommerce-cart .woocommerce-message,
body.woocommerce-cart .woocommerce-info,
body.woocommerce-cart .woocommerce-error {
	border-radius: 0.75rem;
	border-left: 4px solid;
	padding: 1rem 1.25rem;
	margin: 0 0 1.5rem;
	font-size: 0.9rem;
	background: #faf9f7;
}

body.woocommerce-cart .woocommerce-message {
	border-left-color: #2e7d32;
	color: #2e7d32;
}

/* ---------- Responsive: una sola columna ---------- */
@media (max-width: 991.98px) {
	body.woocommerce-cart .woocommerce {
		display: block;
	}

	body.woocommerce-cart .cart-collaterals {
		margin-top: 2rem;
		position: static;
	}

	body.woocommerce-cart .coupon {
		flex-wrap: wrap;
	}

	body.woocommerce-cart .coupon .input-text {
		flex: 1 1 100% !important;
		margin-bottom: 0.75rem;
	}

	body.woocommerce-cart .coupon button,
	body.woocommerce-cart button[name="update_cart"] {
		width: 100%;
	}

	body.woocommerce-cart table.shop_table.cart .product-thumbnail img {
		width: 52px;
		height: 52px;
	}
}
