/**
 * Mr. Mate — Carrito premium "estilo Stanley 1913".
 *
 * Solo se carga en /carrito/ y /checkout/ (ver inc/mrmate-carrito-premium.php,
 * mrmate_encolar_estilos_carrito_premium()) — no afecta el peso de ninguna
 * otra página del sitio.
 *
 * Paleta: se reutilizan intencionalmente los mismos valores hexadecimales
 * que ya usan mrmate-envio-temprano.php y mrmate-conversion.php (#111 texto
 * fuerte, #f6f6f6 fondo suave, #ddd bordes, #888/#666 texto secundario,
 * #c0392b alerta) — mismo sistema visual en toda la ficha de producto y el
 * carrito, nada inventado nuevo.
 *
 * La mayoría de los selectores acá abajo apuntan a clases NUEVAS que
 * agregan woocommerce/cart/cart.php y woocommerce/cart/cart-totals.php
 * (.mrmate-carrito-tabla, .mrmate-resumen-compra, etc.) — eso evita pelear
 * por especificidad contra assets/css/main/cart-checkout.css del theme
 * padre en casi todos los casos. Donde sí se reestilan clases del padre
 * directamente (ej. .quantity-nav, .quantity-button, que las imprime
 * shoptimizer_cart_item_quantity_markup() en el theme padre), se hace
 * dentro del scope ".mrmate-carrito-tabla" para no afectar esas mismas
 * clases en otras páginas (ficha de producto, mini-carrito).
 */

:root {
	--mrmate-negro: #111111;
	--mrmate-gris-suave: #f6f6f6;
	--mrmate-gris-borde: #e2e2e2;
	--mrmate-gris-texto: #666666;
	--mrmate-gris-texto-suave: #888888;
	--mrmate-alerta: #c0392b;
}

body.woocommerce-cart .shoptimizer-cart-wrapper {
	margin-top: 8px;
}

@media (min-width: 993px) {
	body.woocommerce-cart .shoptimizer-cart-wrapper {
		display: flex;
		align-items: flex-start;
		gap: 56px;
	}

	body.woocommerce-cart .woocommerce-cart-form {
		float: none;
		width: auto;
		flex: 1 1 auto;
		min-width: 0;
	}

	body.woocommerce-cart .cart-collaterals {
		float: none;
		width: auto;
		flex: 0 0 380px;
	}
}

.mrmate-resumen-compra {
	position: sticky;
	top: 24px;
}

table.cart.mrmate-carrito-tabla {
	border-collapse: separate;
	border-spacing: 0;
	margin-bottom: 2.5rem;
}

table.cart.mrmate-carrito-tabla tr.woocommerce-cart-form__cart-item td {
	border-bottom: 1px solid var(--mrmate-gris-borde);
	padding-top: 28px;
	padding-bottom: 28px;
	vertical-align: top;
}

table.cart.mrmate-carrito-tabla tr.mrmate-carrito-fila--personalizado td {
	background-color: #fbfbfb;
}

table.cart.mrmate-carrito-tabla td.product-thumbnail {
	width: 160px;
	padding-right: 20px;
}

table.cart.mrmate-carrito-tabla .product-thumbnail img,
table.cart.mrmate-carrito-tabla .mrmate-carrito-foto img {
	max-width: 148px;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 10px;
	background-color: var(--mrmate-gris-suave);
	transition: transform 0.2s ease;
}

table.cart.mrmate-carrito-tabla .mrmate-carrito-foto:hover img {
	transform: scale(1.02);
}

table.cart.mrmate-carrito-tabla td.product-name {
	padding-right: 24px;
}

table.cart.mrmate-carrito-tabla .mrmate-carrito-nombre,
table.cart.mrmate-carrito-tabla td.product-name > a {
	font-size: 18px;
	font-weight: 700;
	color: var(--mrmate-negro);
	line-height: 1.35;
	letter-spacing: -0.01em;
}

table.cart.mrmate-carrito-tabla .mrmate-carrito-nombre:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

table.cart.mrmate-carrito-tabla .mrmate-carrito-variacion {
	margin-top: 8px;
	font-size: 13px;
	color: var(--mrmate-gris-texto);
}

table.cart.mrmate-carrito-tabla .mrmate-carrito-variacion .wc-item-meta {
	margin: 0;
	padding: 0;
	list-style: none;
}

table.cart.mrmate-carrito-tabla .mrmate-carrito-personalizacion {
	margin-top: 14px;
	padding: 14px 16px;
	background-color: #fff;
	border: 1px solid var(--mrmate-gris-borde);
	border-left: 3px solid var(--mrmate-negro);
	border-radius: 6px;
	max-width: 480px;
}

table.cart.mrmate-carrito-tabla .mrmate-carrito-personalizacion__titulo {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 0 0 8px;
	font-size: 12.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--mrmate-negro);
}

table.cart.mrmate-carrito-tabla .mrmate-carrito-personalizacion__titulo svg {
	flex-shrink: 0;
}

table.cart.mrmate-carrito-tabla .mrmate-carrito-personalizacion .wc-item-meta {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

table.cart.mrmate-carrito-tabla .mrmate-carrito-personalizacion .wc-item-meta li,
table.cart.mrmate-carrito-tabla .mrmate-carrito-personalizacion .wc-item-meta p,
table.cart.mrmate-carrito-tabla .mrmate-carrito-personalizacion .wc-item-meta dt,
table.cart.mrmate-carrito-tabla .mrmate-carrito-personalizacion .wc-item-meta dd {
	font-size: 13.5px;
	line-height: 1.5;
	color: #222;
	margin: 0;
}

table.cart.mrmate-carrito-tabla .mrmate-carrito-personalizacion .wc-item-meta-label,
table.cart.mrmate-carrito-tabla .mrmate-carrito-personalizacion strong {
	font-weight: 600;
	color: var(--mrmate-negro);
}

table.cart.mrmate-carrito-tabla .mrmate-carrito-personalizacion a {
	color: var(--mrmate-negro);
	text-decoration: underline;
	text-underline-offset: 2px;
}

table.cart.mrmate-carrito-tabla .mrmate-carrito-personalizacion__miniatura {
	display: inline-block;
	margin-top: 10px;
}

table.cart.mrmate-carrito-tabla .mrmate-carrito-personalizacion__miniatura img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid var(--mrmate-gris-borde);
	display: block;
}

table.cart.mrmate-carrito-tabla td.product-remove {
	width: 32px;
	padding-top: 28px;
}

table.cart.mrmate-carrito-tabla a.remove.mrmate-carrito-quitar {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	color: var(--mrmate-gris-texto);
	text-indent: 0;
	font-size: 0;
	border: 1px solid var(--mrmate-gris-borde);
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

table.cart.mrmate-carrito-tabla a.remove.mrmate-carrito-quitar:before {
	content: none;
	background: none;
	width: auto;
	height: auto;
}

table.cart.mrmate-carrito-tabla a.remove.mrmate-carrito-quitar svg {
	width: 12px;
	height: 12px;
}

table.cart.mrmate-carrito-tabla a.remove.mrmate-carrito-quitar:hover {
	background-color: var(--mrmate-alerta);
	border-color: var(--mrmate-alerta);
	color: #fff;
}

table.cart.mrmate-carrito-tabla td.product-quantity {
	padding-top: 22px;
}

table.cart.mrmate-carrito-tabla .quantity {
	width: auto;
	height: auto;
	border: 1px solid var(--mrmate-negro);
	border-radius: 999px;
	padding: 0;
	display: inline-flex;
	align-items: stretch;
	overflow: hidden;
}

table.cart.mrmate-carrito-tabla td.product-quantity .quantity .quantity-nav {
	position: static;
	display: inline-flex;
	align-items: stretch;
	width: auto;
	height: auto;
	inset: auto;
	border: none;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

table.cart.mrmate-carrito-tabla td.product-quantity .quantity .quantity-button {
	position: static;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	inset: auto;
	background-color: #fff;
	background-image: none;
	color: var(--mrmate-negro);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
	-webkit-user-select: none;
	user-select: none;
}

table.cart.mrmate-carrito-tabla td.product-quantity .quantity .quantity-button:before {
	content: none;
}

table.cart.mrmate-carrito-tabla .quantity-button.plus:after { content: "+"; }
table.cart.mrmate-carrito-tabla .quantity-button.minus:after { content: "\2212"; }

table.cart.mrmate-carrito-tabla td.product-quantity .quantity .quantity-button:hover {
	background-color: var(--mrmate-negro);
	color: #fff;
}

table.cart.mrmate-carrito-tabla td.product-quantity .quantity .qty,
table.cart.mrmate-carrito-tabla td.product-quantity .quantity input.qty {
	width: 44px;
	height: 38px;
	border: none;
	border-left: 1px solid var(--mrmate-gris-borde);
	border-right: 1px solid var(--mrmate-gris-borde);
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	color: var(--mrmate-negro);
	background: transparent;
	box-shadow: none;
	-moz-appearance: textfield;
}

table.cart.mrmate-carrito-tabla .qty::-webkit-outer-spin-button,
table.cart.mrmate-carrito-tabla .qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

@supports (-webkit-overflow-scrolling: touch) {
	table.cart.mrmate-carrito-tabla .quantity {
		width: auto;
	}
}

table.cart.mrmate-carrito-tabla td.product-subtotal {
	padding-top: 28px;
	white-space: nowrap;
}

table.cart.mrmate-carrito-tabla td.product-subtotal .amount,
table.cart.mrmate-carrito-tabla td.product-subtotal {
	font-size: 17px;
	font-weight: 700;
	color: var(--mrmate-negro);
}

table.cart.mrmate-carrito-tabla td.actions {
	padding-top: 2rem;
}

table.cart.mrmate-carrito-tabla td.actions .input-text {
	border-radius: 999px;
	border: 1px solid var(--mrmate-gris-borde);
}

table.cart.mrmate-carrito-tabla td.actions button {
	border-radius: 999px;
	font-weight: 600;
}

.cart_totals.mrmate-resumen-compra {
	background-color: #fff;
	border: 1px solid var(--mrmate-gris-borde);
	border-radius: 12px;
	padding: 28px 26px 26px;
}

.cart_totals.mrmate-resumen-compra h2 {
	display: block;
	margin: 0 0 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--mrmate-gris-borde);
	font-size: 20px;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--mrmate-negro);
	text-transform: none;
}

.mrmate-resumen-compra table.shop_table {
	background: transparent;
	border: none;
	table-layout: auto;
	width: 100%;
}

.mrmate-resumen-compra .shop_table tr td,
.mrmate-resumen-compra .shop_table tr th {
	padding: 12px 0;
	font-size: 14.5px;
	border-bottom: 1px solid #ececec;
}

.mrmate-resumen-compra .shop_table tr th {
	font-weight: 500;
	color: var(--mrmate-gris-texto);
	text-align: left;
}

.mrmate-resumen-compra .shop_table tr td {
	text-align: right;
	color: var(--mrmate-negro);
}

.mrmate-resumen-compra table.shop_table tr.shipping td,
.mrmate-resumen-compra table.shop_table tr.shipping th {
	display: table-cell;
	width: auto;
	border-left: none;
	border-right: none;
	border-top: none;
	padding: 12px 0;
}
.mrmate-resumen-compra table.shop_table tr.shipping td {
	border-bottom: 1px solid #ececec;
	text-align: left;
}
.mrmate-resumen-compra table.shop_table tr.cart-subtotal td,
.mrmate-resumen-compra table.shop_table tr.cart-subtotal th {
	border-left: none;
	border-right: none;
	border-top: none;
}

.mrmate-resumen-compra table.shop_table tr.order-total th,
.mrmate-resumen-compra table.shop_table tr.order-total td {
	border-bottom: none;
	padding-top: 18px;
	font-size: 24px;
	font-weight: 800;
	color: var(--mrmate-negro);
}

.mrmate-resumen-compra small.includes_tax {
	display: block;
	margin-top: 2px;
	font-size: 11.5px;
	font-weight: 400;
	color: var(--mrmate-gris-texto-suave);
}

.mrmate-resumen-compra .mrmate-caja-envio--carrito {
	margin: 0 0 22px;
	background-color: var(--mrmate-gris-suave);
}

.mrmate-resumen-compra .wc-proceed-to-checkout {
	margin: 22px 0 0;
}

.mrmate-resumen-compra .wc-proceed-to-checkout .checkout-button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 56px;
	background-color: var(--mrmate-negro);
	color: #fff;
	border-radius: 999px;
	font-size: 15.5px;
	font-weight: 700;
	letter-spacing: 0.01em;
	text-transform: none;
	transition: background-color 0.15s ease, transform 0.1s ease;
}

.mrmate-resumen-compra .wc-proceed-to-checkout .checkout-button:hover {
	background-color: #000;
	transform: translateY(-1px);
}

.mrmate-carrito-sellos {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 4px 0 18px;
	padding: 0;
	list-style: none;
}

.mrmate-carrito-sellos li {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--mrmate-gris-texto);
}

.mrmate-carrito-sellos li svg {
	flex-shrink: 0;
	margin-top: 1px;
	color: var(--mrmate-negro);
}

.mrmate-resumen-compra .mrmate-resenas-mini {
	margin: 0 0 16px;
}

@media (max-width: 992px) {
	table.cart.mrmate-carrito-tabla,
	table.cart.mrmate-carrito-tabla tbody,
	table.cart.mrmate-carrito-tabla tr.woocommerce-cart-form__cart-item,
	table.cart.mrmate-carrito-tabla td {
		display: block;
		width: 100%;
	}

	table.cart.mrmate-carrito-tabla tr.woocommerce-cart-form__cart-item {
		display: flex;
		flex-direction: column;
		position: relative;
		padding: 24px 0;
	}

	table.cart.mrmate-carrito-tabla tr.woocommerce-cart-form__cart-item td {
		border-bottom: none;
		padding: 0;
	}

	table.cart.mrmate-carrito-tabla td.product-remove {
		order: 1;
		position: absolute;
		top: 24px;
		right: 0;
		width: auto;
		padding: 0;
	}

	table.cart.mrmate-carrito-tabla td.product-thumbnail {
		order: 2;
		width: 100%;
		padding: 0 0 16px;
		position: static !important;
		top: auto !important;
		left: auto !important;
		max-height: none !important;
		overflow: visible !important;
		margin-bottom: 0 !important;
	}

	table.cart.mrmate-carrito-tabla .product-thumbnail img,
	table.cart.mrmate-carrito-tabla .mrmate-carrito-foto img {
		max-width: 100%;
		width: 100% !important;
		max-height: 260px;
		border-radius: 12px;
	}

	table.cart.mrmate-carrito-tabla td[data-title]:before {
		display: none !important;
		content: none !important;
	}

	table.cart.mrmate-carrito-tabla td.product-name {
		order: 3;
		padding: 0 56px 0 0;
		position: static !important;
	}

	table.cart.mrmate-carrito-tabla .mrmate-carrito-personalizacion {
		max-width: none;
	}

	table.cart.mrmate-carrito-tabla td.product-price {
		order: 4;
	}

	table.cart.mrmate-carrito-tabla td.product-quantity {
		order: 5;
		padding-top: 18px;
	}

	table.cart.mrmate-carrito-tabla td.product-subtotal {
		order: 6;
		text-align: left;
		padding-top: 16px;
	}

	table.cart.mrmate-carrito-tabla td.product-subtotal:before {
		content: "Total del producto: " !important;
		font-size: 12.5px;
		font-weight: 500;
		color: var(--mrmate-gris-texto);
		display: block !important;
		margin-bottom: 2px;
	}

	table.cart.mrmate-carrito-tabla td.product-subtotal .amount {
		font-size: 20px;
	}

	.mrmate-resumen-compra {
		position: static;
		margin-top: 8px;
	}
}
