/* ==========================================================================
   Rancheando — cart.css
   Carrito (woocommerce/cart/cart.php). Ref: rancheando-cart.html.
   El form, qty, remover y totales son nativos de WooCommerce, estilados.
   Colores vía custom properties. Desktop-first (1000/768).
   ========================================================================== */

/* ───────── Header del carrito ───────── */
.cart-header { padding: 48px 56px 36px; border-bottom: 1px solid var(--arena-med); background: var(--crema); }
.cart-header-eyebrow { font-size: 10px; letter-spacing: 4px; text-transform: uppercase; color: var(--camel); font-weight: 400; margin-bottom: 10px; }
.cart-header-h1 { font-family: var(--font-display); font-size: clamp(32px, 5vw, 52px); font-weight: 400; font-style: italic; color: var(--marron); margin-bottom: 6px; }
.cart-header-count { font-size: 13px; color: var(--texto-2); font-weight: 300; }

/* ───────── Progreso ───────── */
.cart-progress { padding: 0 56px; background: var(--blanco); border-bottom: 1px solid var(--arena-med); display: flex; align-items: center; height: 48px; }
/* nowrap + flex-shrink:0 = el label NUNCA se parte en varias líneas ("Datos y pago" se cortaba
   en 3 renglones al angostarse); si no entra, la barra scrollea (overflow-x en mobile). */
.progress-step { display: flex; align-items: center; gap: 8px; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 400; padding: 0 20px; white-space: nowrap; flex-shrink: 0; }
.progress-step:first-child { padding-left: 0; }
.progress-dot { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 600; flex-shrink: 0; }
.progress-step.done .progress-dot { background: var(--marron); color: var(--blanco); }
.progress-step.active .progress-dot { background: var(--camel); color: var(--marron); }
.progress-step.pending .progress-dot { background: var(--arena-med); color: var(--texto-2); }
.progress-step.done, .progress-step.active { color: var(--marron); }
.progress-step.pending { color: var(--texto-2); }
.progress-line { flex: 1; height: 1px; background: var(--arena-med); margin: 0 8px; }

/* ───────── Layout ───────── */
.cart-layout { display: grid; grid-template-columns: 1fr 420px; gap: 0; align-items: start; }

/* ───────── Items (el form es la columna izquierda) ───────── */
.cart-items { padding: 40px 56px; border-right: 1px solid var(--arena-med); }
.cart-items-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.cih-label { font-size: 9px; letter-spacing: 3px; text-transform: uppercase; color: var(--camel); font-weight: 400; }
.clear-cart { font-size: 11px; color: var(--texto-2); font-weight: 300; border-bottom: 1px solid var(--arena-med); transition: color .2s; }
.clear-cart:hover { color: var(--marron); }

.cart-item { display: grid; grid-template-columns: 100px 1fr auto; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--arena-med); align-items: center; }
.cart-item:first-of-type { border-top: 1px solid var(--arena-med); }
/* Ancho por la COLUMNA del grid (no fijo): con 100px fijos la imagen se desbordaba de la
   columna de 80px en mobile y tapaba el "Eliminar" de al lado. aspect-ratio 4/5 = el de las
   fotos de producto, así escala bien en cualquier breakpoint. */
.ci-thumb { width: 100%; aspect-ratio: 4 / 5; border-radius: 2px; overflow: hidden; background: var(--arena); }
.ci-thumb img, .ci-thumb-fill { width: 100%; height: 100%; object-fit: cover; }
.ci-thumb-fill { background: linear-gradient(145deg, var(--camel-light), var(--camel)); }
.ci-name { font-family: var(--font-display); font-size: 20px; font-weight: 400; font-style: italic; color: var(--marron); margin-bottom: 3px; }
.ci-name a { color: inherit; }
.ci-variant { font-size: 12px; color: var(--texto-2); font-weight: 300; margin-bottom: 14px; }

.qty-row { display: flex; align-items: center; border: 1px solid var(--arena-med); width: fit-content; }
.qty-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--crema); border: none; cursor: pointer; font-size: 18px; color: var(--marron); transition: background .2s; font-family: var(--font-body); }
.qty-btn:hover { background: var(--arena); }
.qty-row .quantity { margin: 0; }
.qty-row input.qty { width: 44px; height: 36px; text-align: center; border: none; border-left: 1px solid var(--arena-med); border-right: 1px solid var(--arena-med); background: var(--blanco); font-size: 15px; font-weight: 500; color: var(--marron); font-family: var(--font-body); -moz-appearance: textfield; }
.qty-row input.qty::-webkit-outer-spin-button, .qty-row input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ci-remove { display: inline-block; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--camel); margin-top: 10px; transition: color .2s; background: none; border: none; font-family: var(--font-body); padding: 0; cursor: pointer; }
.ci-remove:hover { color: var(--marron); }
.ci-price { text-align: right; }
.ci-price-main { font-family: var(--font-display); font-size: 24px; font-weight: 400; font-style: italic; color: var(--marron); }
.ci-price-tf { font-size: 12px; color: var(--verde-ok); font-weight: 400; margin-top: 4px; }

/* El carrito se auto-actualiza al cambiar cantidades: el botón "Actualizar carrito" se
   oculta (queda en el DOM con el nonce; el JS lo dispara solo). */
.cart-actions { display: none; }

/* Cupón aplicado en el resumen (línea con "quitar"). */
.cs-line-coupon .cs-label { color: var(--verde-ok); }
.cs-line-coupon .cs-val { color: var(--verde-ok); }
.cs-coupon-remove { margin-left: 8px; color: var(--marron-med); text-decoration: none; font-size: 11px; transition: color .2s; }
.cs-coupon-remove:hover { color: #b3423a; }

/* Campo de aplicar cupón (mismo estilo que el checkout, adaptado al resumen). */
.cart-summary .rnc-coupon { margin: 14px 0; padding: 14px 0; border-top: 1px solid var(--arena-med); border-bottom: 1px solid var(--arena-med); }
.rnc-coupon-title { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--texto-2); font-weight: 400; margin-bottom: 12px; }
.rnc-coupon-row { display: flex; align-items: stretch; gap: 8px; }
.rnc-coupon-input { flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid var(--arena-med); background: var(--blanco); font-family: var(--font-body); font-size: 13px; color: var(--texto); }
.rnc-coupon-input:focus { outline: none; border-color: var(--marron); }
.rnc-coupon-apply { flex-shrink: 0; background: var(--marron); color: var(--blanco); border: none; padding: 0 20px; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600; cursor: pointer; transition: background .2s; }
.rnc-coupon-apply:hover { background: var(--marron-med); }
.rnc-coupon-msg { font-size: 12px; font-weight: 300; line-height: 1.45; margin-top: 8px; }
.rnc-coupon-msg:empty { margin-top: 0; }
.rnc-coupon-msg.is-error { color: #b3423a; }
.rnc-coupon-msg.is-ok { color: var(--verde-ok); }

/* Transfer banner */
.transfer-banner { background: var(--marron); padding: 20px 24px; margin-top: 28px; display: flex; align-items: center; gap: 16px; border-radius: 2px; }
.tb-icon { font-size: 20px; flex-shrink: 0; }
.tb-text { font-size: 14px; color: rgba(255,255,255,.8); flex: 1; font-weight: 300; }
.tb-text strong { color: var(--camel-light); font-weight: 500; }
.tb-saving { font-family: var(--font-display); font-size: 22px; font-style: italic; font-weight: 400; color: var(--camel); flex-shrink: 0; }

/* ───────── Resumen ───────── */
.cart-summary { background: var(--crema); padding: 40px; position: sticky; top: var(--nav-h); max-height: calc(100vh - var(--nav-h)); overflow-y: auto; }
.cs-title { font-family: var(--font-display); font-size: 22px; font-weight: 400; font-style: italic; color: var(--marron); margin-bottom: 28px; }
.cs-line { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; font-size: 14px; }
.cs-label { color: var(--texto-2); font-weight: 300; }
.cs-val { color: var(--marron); font-weight: 400; }
.cs-divider { height: 1px; background: var(--arena-med); margin: 18px 0; }
.cs-total-row { display: flex; justify-content: space-between; align-items: baseline; }
.cs-total-label { font-family: var(--font-display); font-size: 18px; color: var(--marron); }
.cs-total-val { font-family: var(--font-display); font-size: 32px; font-style: italic; font-weight: 400; color: var(--marron); }
.cs-total-note { font-size: 11px; color: var(--texto-2); font-weight: 300; margin-top: 4px; margin-bottom: 24px; }

.btn-checkout { display: block; width: 100%; background: var(--marron); color: var(--blanco); border: none; padding: 18px; font-size: 13px; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 500; cursor: pointer; font-family: var(--font-body); transition: background .2s; text-align: center; margin-bottom: 12px; }
.btn-checkout:hover { background: var(--marron-med); }
.checkout-note { font-size: 11px; color: var(--texto-2); font-weight: 300; text-align: center; line-height: 1.6; }
.summary-trust { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--arena-med); display: flex; flex-direction: column; gap: 10px; }
.st-line { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--texto-2); font-weight: 300; }
.st-icon { color: var(--camel); font-size: 15px; }

/* La barra de envío gratis se movió a assets/css/freeship.css (módulo reusable en
   carrito, producto y archivo — inc/free-shipping.php). */

/* ───────── Carrito vacío ───────── */
.cart-empty { padding: 80px 56px; text-align: center; }
.ce-h2 { font-family: var(--font-display); font-size: 36px; font-style: italic; font-weight: 400; color: var(--marron); margin-bottom: 14px; }
.ce-sub { font-size: 15px; color: var(--texto-2); font-weight: 300; margin-bottom: 36px; }
.cart-empty .btn-solid { display: inline-block; background: var(--marron); color: var(--blanco); padding: 16px 40px; font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 500; transition: background .2s; }
.cart-empty .btn-solid:hover { background: var(--marron-med); }

/* WooCommerce notices dentro del carrito */
.woocommerce-cart-form ~ .woocommerce-message,
.woocommerce-message, .woocommerce-info, .woocommerce-error { margin: 24px 56px; padding: 14px 18px; background: var(--crema); border: 1px solid var(--arena-med); border-left: 3px solid var(--camel); font-size: 13px; list-style: none; }

/* ───────── Responsive ───────── */
@media (max-width: 1000px) {
	.cart-layout { grid-template-columns: 1fr; }
	.cart-items { padding: 32px 28px; border-right: none; }
	.cart-summary { position: relative; border-top: 1px solid var(--arena-med); padding: 36px 28px; max-height: none; top: 0; }
}
@media (max-width: 768px) {
	.cart-header { padding: 36px 20px 28px; }

	/* Barra de pasos: tipografía, dots y espaciado más chicos para que los 3 pasos entren en
	   UNA línea. Antes: "Datos y pago" se partía en 3 renglones (sin nowrap) dentro de una barra
	   de alto fijo → todo apretado y el 3er paso cortado. Alto auto + overflow-x como red de
	   seguridad en pantallas muy angostas. */
	.cart-progress { padding: 0 16px; height: auto; min-height: 46px; overflow-x: auto; }
	.progress-step { font-size: 9px; letter-spacing: 0.6px; gap: 6px; padding: 0 8px; }
	.progress-dot { width: 17px; height: 17px; font-size: 8px; }
	.progress-line { min-width: 10px; margin: 0 2px; }

	.cart-items { padding: 28px 20px; }

	/* Fila de producto: más compacta (título/precio/stepper eran demasiado grandes en pantalla
	   chica) y alineada arriba, que es como se lee una lista. */
	.cart-item { grid-template-columns: 80px 1fr; gap: 14px; align-items: start; padding: 20px 0; }
	.ci-name { font-size: 15px; line-height: 1.3; }
	.ci-variant { font-size: 12px; }
	.qty-row { margin-top: 10px; }
	.qty-btn { width: 36px; height: 36px; font-size: 16px; }
	.qty-row input.qty { width: 40px; height: 36px; font-size: 14px; }
	.ci-remove { margin-top: 8px; }
	.cart-item .ci-price { grid-column: 2; text-align: left; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--arena-med); }
	.ci-price-main { font-size: 18px; }
	.ci-price-tf { font-size: 11px; }

	.cart-summary { padding: 28px 20px; }
	.transfer-banner { flex-direction: column; gap: 10px; text-align: center; }
}
