/* ==========================================================================
   Velas Velia — Carrito clásico de WooCommerce (override de marca)
   --------------------------------------------------------------------------
   Estilos de la página de carrito (woocommerce/cart/cart.php). Consume SOLO
   tokens del sistema (tokens.css) y reutiliza componentes vv- (.vv-btn,
   .vv-input). Aplica el look Velia: hairlines --line, tipografías display/
   body, precios con color de marca y CTAs en pill.

   No se editan main.css/tokens.css. Carga automática vía functions.php
   (auto-encola assets/css/parts/*.css).
   ========================================================================== */

/* --- Contenedor general --------------------------------------------------- */

.vv-cart {
	color: var(--text-body);
	font-family: var(--font-body);
}

/* Layout de dos columnas (tabla + totales) en pantallas amplias.
   WooCommerce coloca la tabla dentro del form y los totales en
   .cart-collaterals; con CSS los disponemos lado a lado. */
@media (min-width: 992px) {
	.vv-cart {
		display: grid;
		width: 100%;
		grid-template-columns: minmax(0, 1fr) 360px;
		gap: var(--space-12);
		align-items: start;
	}

	.vv-cart__form {
		min-width: 0;
	}
}

/* ==========================================================================
   1. TABLA DEL CARRITO
   ========================================================================== */

.vv-cart__table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
	background: transparent;
}

/* Encabezados de columna — eyebrow de marca */
.vv-cart__col-head {
	font-family: var(--font-body);
	font-weight: var(--fw-semibold);
	font-size: var(--text-xs);
	text-transform: uppercase;
	letter-spacing: var(--tracking-label);
	color: var(--text-muted);
	text-align: left;
	padding: 0 var(--space-4) var(--space-4);
	border-bottom: var(--border-w) solid var(--line);
}

.vv-cart__table thead th.product-remove,
.vv-cart__table thead th.product-thumbnail {
	border-bottom: var(--border-w) solid var(--line);
	padding-bottom: var(--space-4);
}

.vv-cart__table .product-subtotal {
	text-align: right;
}

/* Filas de artículo con hairlines cálidos */
.vv-cart__item td {
	padding: var(--space-5) var(--space-4);
	border-bottom: var(--border-w) solid var(--line);
	vertical-align: middle;
	background: transparent;
}

/* --- Botón eliminar artículo --------------------------------------------- */

.vv-cart__remove,
.vv-cart__item .product-remove a.remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: var(--radius-pill);
	background: var(--gold-100);
	color: var(--gold-800) !important;
	font-size: 18px;
	line-height: 1;
	text-decoration: none;
	transition: background var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}

.vv-cart__remove:hover,
.vv-cart__item .product-remove a.remove:hover {
	background: var(--rose-400);
	color: #5A332E !important;
}

.vv-cart__remove:active {
	transform: var(--press-scale);
}

/* --- Miniatura del producto ----------------------------------------------- */

.vv-cart__thumb {
	width: 92px;
}

.vv-cart__thumb img {
	width: 76px;
	height: 76px;
	object-fit: cover;
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	display: block;
}

/* --- Nombre del producto (UPPERCASE tracked de marca) --------------------- */

.vv-cart__name {
	font-family: var(--font-body);
	font-weight: var(--fw-semibold);
}

.vv-cart__name-link,
.vv-cart__name a {
	color: var(--text-heading);
	font-weight: var(--fw-semibold);
	font-size: var(--text-sm);
	letter-spacing: 0.01em;
	text-transform: none;
	line-height: 1.3;
	/* El nombre debe partir por palabras, nunca letra a letra */
	word-break: normal;
	overflow-wrap: anywhere;
	hyphens: none;
	transition: color var(--dur) var(--ease-out);
}

.vv-cart__name-link:hover,
.vv-cart__name a:hover {
	color: var(--brand);
}

/* Meta de variaciones */
.vv-cart__name .variation,
.vv-cart__name dl.variation {
	margin: var(--space-2) 0 0;
	font-size: var(--text-xs);
	color: var(--text-muted);
	text-transform: none;
	letter-spacing: 0;
}

.vv-cart__name .backorder_notification {
	margin: var(--space-2) 0 0;
	font-size: var(--text-xs);
	color: var(--gold-700);
}

/* --- Precio y subtotal (color de marca) ----------------------------------- */

.vv-cart__price,
.vv-cart__subtotal {
	font-family: var(--font-rounded);
	font-weight: var(--fw-bold);
	color: var(--gold-700);
	white-space: nowrap;
}

.vv-cart__subtotal {
	text-align: right;
	color: var(--ink-900);
	font-size: var(--text-md);
}

/* --- Selector de cantidad ------------------------------------------------- */

.vv-cart__qty .quantity {
	display: inline-flex;
	align-items: center;
}

.vv-cart__qty-input,
.vv-cart .quantity input.qty {
	width: 64px;
	box-sizing: border-box;
	text-align: center;
	font-family: var(--font-body);
	font-size: var(--text-sm);
	font-weight: var(--fw-medium);
	color: var(--text-body);
	background: var(--white);
	border: var(--border-w-2) solid var(--gold-300);
	border-radius: var(--radius-pill);
	padding: 9px 10px;
	outline: none;
	transition: border-color var(--dur), box-shadow var(--dur);
}

.vv-cart__qty-input:focus,
.vv-cart .quantity input.qty:focus {
	border-color: var(--gold-600);
	box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ==========================================================================
   2. ACCIONES (cupón + actualizar carrito)
   ========================================================================== */

.vv-cart__actions {
	padding: var(--space-6) var(--space-4) !important;
	border-bottom: none !important;
}

.vv-cart__actions::after {
	content: "";
	display: table;
	clear: both;
}

/* Cupón a la izquierda */
.vv-cart__coupon {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-3);
	float: left;
}

.vv-cart__coupon-input {
	width: auto;
	min-width: 200px;
	margin: 0;
}

/* Actualizar carrito a la derecha */
.vv-cart__update {
	float: right;
}

/* Espaciado responsive del bloque de acciones */
@media (max-width: 640px) {
	.vv-cart__coupon,
	.vv-cart__update {
		float: none;
		width: 100%;
	}

	.vv-cart__coupon {
		margin-bottom: var(--space-4);
	}

	.vv-cart__coupon-input {
		flex: 1 1 auto;
		min-width: 0;
	}

	.vv-cart__update {
		display: block;
	}
}

/* ==========================================================================
   3. TOTALES DEL CARRITO (cart-collaterals → .cart_totals)
   --------------------------------------------------------------------------
   El bloque de totales y el botón "Finalizar compra" salen de plantillas de
   Woo que NO se sobrescriben aquí (cart-totals.php / proceed-to-checkout.php);
   se estilizan por selector para que sigan el look de marca.
   ========================================================================== */

.vv-cart__collaterals .cart_totals {
	/* WooCommerce aplica .woocommerce .cart-collaterals .cart_totals{width:48%;
	   float:right} con mayor especificidad; forzamos ancho completo de columna. */
	width: 100% !important;
	float: none !important;
	background: var(--gold-050);
	border: var(--border-w) solid var(--line);
	border-radius: var(--radius-lg);
	padding: var(--space-6);
	box-shadow: var(--shadow-sm);
}

.vv-cart__collaterals .cart_totals > h2 {
	font-family: var(--font-display);
	font-weight: var(--fw-semibold);
	text-transform: none;
	letter-spacing: -0.01em;
	font-size: var(--text-lg);
	color: var(--text-heading);
	margin: 0 0 var(--space-4);
}

.vv-cart__collaterals .shop_table {
	width: 100%;
	border-collapse: collapse;
}

.vv-cart__collaterals .shop_table th,
.vv-cart__collaterals .shop_table td {
	padding: var(--space-3) 0;
	border-top: var(--border-w) solid var(--line);
	text-align: left;
	font-family: var(--font-body);
	font-size: var(--text-sm);
	color: var(--text-body);
}

.vv-cart__collaterals .shop_table td {
	text-align: right;
}

.vv-cart__collaterals .shop_table th {
	font-weight: var(--fw-semibold);
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: var(--tracking-label);
	font-size: var(--text-xs);
}

/* Total final destacado con color de marca */
.vv-cart__collaterals .order-total th,
.vv-cart__collaterals .order-total td {
	border-top: var(--border-w-2) solid var(--gold-300);
	padding-top: var(--space-4);
}

.vv-cart__collaterals .order-total td {
	font-family: var(--font-rounded);
	font-weight: var(--fw-bold);
	font-size: var(--text-lg);
	color: var(--gold-700);
}

.vv-cart__collaterals .order-total th {
	font-size: var(--text-sm);
	color: var(--ink-900);
}

/* Botón "Finalizar compra" (proceed-to-checkout) — primario de marca */
.vv-cart__collaterals .wc-proceed-to-checkout {
	width: 100%;
	margin-top: var(--space-5);
	padding: 0;
}

/* Pill ancho legible: el botón debe ocupar todo el ancho del bloque de
   totales y mostrar el texto en una línea cómoda (no en círculo). Se usa
   flex para centrar y white-space:nowrap para que no parta el rótulo. */
.vv-cart__collaterals .wc-proceed-to-checkout a.checkout-button,
.vv-cart__collaterals .wc-proceed-to-checkout a {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	box-sizing: border-box;
	padding: 14px 24px;
	font-family: var(--font-body);
	font-size: 17px;
	font-weight: var(--fw-semibold);
	letter-spacing: 0.02em;
	line-height: var(--leading-snug);
	text-align: center;
	white-space: nowrap; /* rótulo en una sola línea, sin envolver letra a letra */
	border-radius: var(--radius-pill);
	border: var(--border-w-2) solid var(--gold-600);
	background: var(--gold-600);
	color: var(--text-on-brand) !important;
	box-shadow: var(--shadow-pill);
	transition: transform var(--dur) var(--ease-out), filter var(--dur);
}

.vv-cart__collaterals .wc-proceed-to-checkout a.checkout-button:hover {
	filter: brightness(1.06);
}

.vv-cart__collaterals .wc-proceed-to-checkout a.checkout-button:active {
	transform: var(--press-scale);
}

/* ==========================================================================
   4. AVISOS / MENSAJES DE WOO DENTRO DEL CARRITO
   ========================================================================== */

.vv-cart .woocommerce-message,
.vv-cart .woocommerce-info,
.vv-cart .woocommerce-error {
	font-family: var(--font-body);
	font-size: var(--text-sm);
}

/* Tabla responsive en móvil/tablet (Woo añade data-title).
   Breakpoint a 991px para colapsar a tarjetas justo antes de que el layout
   de 2 columnas entre a 992px; así se evita la zona muerta 768–991px. */
@media (max-width: 991px) {
	.vv-cart__table thead {
		display: none;
	}

	.vv-cart__item {
		display: block;
		border-bottom: var(--border-w-2) solid var(--line);
		padding: var(--space-3) 0;
	}

	.vv-cart__item td {
		display: flex;
		align-items: center;
		justify-content: space-between;
		border-bottom: var(--border-w) solid var(--line);
		padding: var(--space-3) var(--space-2);
		text-align: right;
	}

	.vv-cart__item td::before {
		content: attr(data-title);
		font-family: var(--font-body);
		font-weight: var(--fw-semibold);
		font-size: var(--text-xs);
		text-transform: uppercase;
		letter-spacing: var(--tracking-label);
		color: var(--text-muted);
		text-align: left;
	}

	.vv-cart__item td.product-remove,
	.vv-cart__item td.product-thumbnail {
		justify-content: flex-start;
		border-bottom: none;
	}

	.vv-cart__item td.product-remove::before,
	.vv-cart__item td.product-thumbnail::before {
		content: none;
	}

	.vv-cart__name {
		text-align: right;
	}

	/* Targets táctiles cómodos en móvil/tablet --------------------------- */
	/* Botón eliminar a 40x40px para cumplir el área mínima de toque */
	.vv-cart__remove,
	.vv-cart__item .product-remove a.remove {
		width: 40px;
		height: 40px;
		font-size: var(--text-lg);
	}

	/* Input de cantidad con altura/padding aptos para el dedo */
	.vv-cart__qty-input,
	.vv-cart .quantity input.qty {
		min-height: 44px;
		padding: 12px 10px;
	}
}
