/* ==========================================================================
   Rancheando — features.css (global)
   §12: Wishlist (corazón en cards + PDP + nav + página) y popup exit-intent.
   Colores vía custom properties.
   ========================================================================== */

/* ───────── Corazón de wishlist en product-cards ───────── */
.rnc-fav {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, .9);
	border: 1px solid var(--hairline);
	cursor: pointer;
	transition: background .2s, transform .2s;
	backdrop-filter: blur(4px);
}
.rnc-fav:hover { transform: scale(1.08); }
.rnc-fav svg { width: 17px; height: 17px; fill: none; stroke: var(--marron-med); stroke-width: 1.6; transition: fill .2s, stroke .2s; }
.rnc-fav.is-active { background: var(--blanco); }
.rnc-fav.is-active svg { fill: var(--verde-ok); stroke: var(--verde-ok); }

/* ───────── Botón de wishlist en el PDP ───────── */
.pdp-fav {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 14px;
	padding: 12px 18px;
	background: transparent;
	border: 1px solid var(--arena-med);
	color: var(--texto-2);
	font-family: var(--font-body);
	font-size: 11px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	cursor: pointer;
	transition: border-color .2s, color .2s;
}
.pdp-fav:hover { border-color: var(--marron); color: var(--marron); }
.pdp-fav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: fill .2s; }
.pdp-fav.is-active { border-color: var(--verde-ok); color: var(--verde-ok); }
.pdp-fav.is-active svg { fill: var(--verde-ok); stroke: var(--verde-ok); }

/* ───────── Contador en el nav ───────── */
.nav-fav { position: relative; }
.fav-n {
	position: absolute;
	top: -6px;
	right: -8px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 50%;
	background: var(--verde-ok);
	color: var(--blanco);
	font-size: 9px;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ───────── Página de wishlist ───────── */
.rnc-wishlist { padding: 8px 0 24px; }
.rnc-wishlist-empty { padding: 48px 24px 64px; text-align: center; }
.rnc-wishlist-empty .be-h2 { font-family: var(--font-display); font-size: 30px; font-style: italic; font-weight: 400; color: var(--marron); margin-bottom: 12px; }
.rnc-wishlist-empty .be-sub { font-size: 14px; color: var(--texto-2); font-weight: 300; margin-bottom: 28px; }
.rnc-wishlist-empty .btn-solid { display: inline-block; background: var(--marron); color: var(--blanco); padding: 14px 36px; font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 500; transition: background .2s; }
.rnc-wishlist-empty .btn-solid:hover { background: var(--marron-med); }
.rnc-wishlist-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ───────── Popup exit-intent ───────── */
.exit-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.exit-modal.open { display: flex; }
.exit-overlay { position: absolute; inset: 0; background: rgba(60, 39, 0, .55); backdrop-filter: blur(2px); }
.exit-box {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 460px;
	background: var(--crema);
	border: 1px solid var(--arena-med);
	padding: 48px 40px 40px;
	text-align: center;
	animation: rncExitIn .35s var(--ease-img, ease) both;
}
@keyframes rncExitIn {
	from { opacity: 0; transform: translateY(16px); }
	to   { opacity: 1; transform: translateY(0); }
}
.exit-close {
	position: absolute;
	top: 14px;
	right: 16px;
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	color: var(--texto-2);
	cursor: pointer;
	transition: color .2s;
}
.exit-close:hover { color: var(--marron); }
.exit-eyebrow { font-size: 10px; letter-spacing: 4px; text-transform: uppercase; color: var(--camel); font-weight: 400; margin-bottom: 14px; }
.exit-title { font-family: var(--font-display); font-size: clamp(26px, 4vw, 34px); font-weight: 400; color: var(--marron); line-height: 1.18; margin-bottom: 14px; }
.exit-title em { font-style: italic; }
.exit-sub { font-size: 14px; color: var(--texto-2); font-weight: 300; line-height: 1.7; margin-bottom: 28px; }
.exit-cta {
	display: block;
	background: var(--marron);
	color: var(--blanco);
	padding: 16px;
	font-size: 12px;
	letter-spacing: 2.5px;
	text-transform: uppercase;
	font-weight: 500;
	transition: background .2s;
	margin-bottom: 12px;
}
.exit-cta:hover { background: var(--marron-med); }
.exit-dismiss {
	background: none;
	border: none;
	color: var(--texto-2);
	font-family: var(--font-body);
	font-size: 11px;
	letter-spacing: 1px;
	text-decoration: underline;
	cursor: pointer;
	transition: color .2s;
}
.exit-dismiss:hover { color: var(--marron); }

@media (min-width: 768px) {
	.rnc-wishlist-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}

/* Targets táctiles ≥44px en dispositivos sin hover (mobile/tablet) — mínimo recomendado. */
@media (hover: none) {
	.rnc-fav { width: 44px; height: 44px; }
	.rnc-fav svg { width: 19px; height: 19px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   PANEL DESLIZABLE DE FAVORITOS (drawer)
   No invasivo: se desliza desde la derecha, el velo es sutil y se cierra al
   tocar afuera o con Esc → el que no quiere, sigue navegando. Desktop/tablet/mobile.
   ══════════════════════════════════════════════════════════════════════════ */
.rnc-wd {
	position: fixed;
	inset: 0;
	z-index: 1100;
	visibility: hidden;
	pointer-events: none;
}
.rnc-wd.is-open { visibility: visible; pointer-events: auto; }
.rnc-wd-scrim {
	position: absolute;
	inset: 0;
	background: rgba(40, 28, 8, 0.32);
	opacity: 0;
	transition: opacity .3s ease;
}
.rnc-wd.is-open .rnc-wd-scrim { opacity: 1; }
.rnc-wd-panel {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: 400px;
	max-width: 90vw;
	background: var(--crema);
	box-shadow: -18px 0 50px rgba(60, 39, 0, 0.18);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform .38s cubic-bezier(.25, .46, .45, .94);
	will-change: transform;
}
.rnc-wd.is-open .rnc-wd-panel { transform: translateX(0); }

.rnc-wd-head {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 22px;
	border-bottom: 1px solid var(--arena-med);
	background: var(--blanco);
}
.rnc-wd-title {
	font-family: var(--font-display);
	font-size: 19px;
	color: var(--marron);
	letter-spacing: .01em;
}
.rnc-wd-close {
	width: 38px; height: 38px;
	display: flex; align-items: center; justify-content: center;
	background: none; border: 1px solid var(--arena-med); border-radius: 50%;
	color: var(--marron-med); cursor: pointer;
	transition: color .2s, border-color .2s, background .2s;
}
.rnc-wd-close:hover { color: var(--marron); border-color: var(--marron-med); background: var(--crema); }
.rnc-wd-close svg { width: 17px; height: 17px; }

.rnc-wd-body { flex: 1 1 auto; overflow-y: auto; padding: 22px; }

/* ── Estado LOGIN (invitado) + estado VACÍO ── */
.rnc-wd-login,
.rnc-wd-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 28px 14px;
}
.rnc-wd-login-ico {
	width: 64px; height: 64px;
	display: flex; align-items: center; justify-content: center;
	border-radius: 50%;
	background: var(--arena);
	color: var(--camel);
	margin-bottom: 22px;
}
.rnc-wd-login-ico svg { width: 30px; height: 30px; }
.rnc-wd-login-title,
.rnc-wd-empty-title {
	font-family: var(--font-display);
	font-size: 24px;
	color: var(--marron);
	margin-bottom: 12px;
}
.rnc-wd-login-sub,
.rnc-wd-empty-sub {
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--texto-2);
	max-width: 300px;
	margin-bottom: 26px;
}
.rnc-wd-google {
	display: inline-flex; align-items: center; justify-content: center; gap: 12px;
	width: 100%; padding: 14px 20px;
	background: var(--blanco); border: 1px solid var(--arena-med); color: var(--texto);
	font-family: var(--font-body); font-size: 14px; font-weight: 500; text-decoration: none;
	transition: border-color .2s, box-shadow .2s, background .2s;
}
.rnc-wd-google:hover { border-color: var(--marron-med); box-shadow: 0 4px 16px rgba(60, 39, 0, 0.08); }
.rnc-wd-google-ico { flex-shrink: 0; }
.rnc-wd-email {
	margin-top: 18px;
	font-size: 12px; letter-spacing: .04em;
	color: var(--marron-med); text-decoration: underline;
}
.rnc-wd-email:hover { color: var(--marron); }
.rnc-wd-shop {
	display: inline-block;
	background: var(--marron); color: var(--blanco);
	padding: 13px 26px;
	font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 500;
	text-decoration: none;
	transition: background .2s;
}
.rnc-wd-shop:hover { background: var(--marron-med); }

/* ── Estado LISTA (logueado) ── */
.rnc-wd-list { display: flex; flex-direction: column; }
.rnc-wd-item {
	display: flex;
	gap: 14px;
	padding: 16px 0;
	border-bottom: 1px solid var(--arena-med);
}
.rnc-wd-item:first-child { padding-top: 2px; }
.rnc-wd-thumb {
	flex: 0 0 78px;
	width: 78px;
	aspect-ratio: 4 / 5;
	background: var(--arena);
	overflow: hidden;
	display: block;
}
.rnc-wd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rnc-wd-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.rnc-wd-name {
	font-family: var(--font-display);
	font-size: 15px;
	color: var(--marron);
	line-height: 1.25;
	text-decoration: none;
	margin-bottom: 4px;
}
.rnc-wd-name:hover { color: var(--marron-med); }
.rnc-wd-price { font-size: 13px; color: var(--texto-2); margin-bottom: 10px; }
.rnc-wd-price del { opacity: .6; margin-right: 6px; }
.rnc-wd-price ins { text-decoration: none; color: var(--verde-ok); }
.rnc-wd-actions { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.rnc-wd-add {
	flex: 1 1 auto;
	background: var(--marron); color: var(--blanco);
	border: none; padding: 10px 12px;
	font-family: var(--font-body); font-size: 10.5px; letter-spacing: 1.5px;
	text-transform: uppercase; font-weight: 500; text-align: center; text-decoration: none;
	cursor: pointer; transition: background .2s;
}
.rnc-wd-add:hover { background: var(--marron-med); }
.rnc-wd-add.is-done { background: var(--verde-ok); }
.rnc-wd-add--link { display: inline-block; }
.rnc-wd-remove {
	flex: 0 0 38px;
	width: 38px; height: 38px;
	display: flex; align-items: center; justify-content: center;
	background: none; border: 1px solid var(--arena-med);
	color: var(--texto-2); cursor: pointer;
	transition: color .2s, border-color .2s;
}
.rnc-wd-remove:hover { color: var(--marron); border-color: var(--marron-med); }
.rnc-wd-remove svg { width: 14px; height: 14px; }
.rnc-wd-all {
	display: block;
	text-align: center;
	margin-top: 22px;
	padding: 12px;
	font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 500;
	color: var(--marron); text-decoration: underline;
}
.rnc-wd-all:hover { color: var(--marron-med); }

body.rnc-wd-lock { overflow: hidden; }

/* Página /lista-de-deseos/ sin sesión: el bloque de login centrado y con aire. */
.rnc-wishlist--gate { max-width: 460px; margin: 0 auto; padding: 40px 0 64px; }
.rnc-wishlist--gate .rnc-wd-login { padding: 20px 0; }

/* ══════════════════════════════════════════════════════════════════════════
   SIDE CART (#rnc-cart-drawer) — reusa el shell .rnc-wd-*; ítems propios .rnc-cd-*
   ══════════════════════════════════════════════════════════════════════════ */
.rnc-cd .rnc-wd-body { display: flex; flex-direction: column; padding: 0; }
.rnc-cd-list { flex: 1 1 auto; padding: 8px 22px 0; }
.rnc-cd .rnc-wd-body.is-busy { opacity: .55; pointer-events: none; }

.rnc-cd-flash {
	margin: 14px 22px 0;
	padding: 10px 12px;
	background: rgba(160, 44, 44, 0.07);
	border-left: 3px solid #a02c2c;
	color: #a02c2c;
	font-size: 12px; line-height: 1.5;
}

.rnc-cd-item {
	display: flex;
	gap: 14px;
	padding: 16px 0;
	border-bottom: 1px solid var(--arena-med);
}
.rnc-cd-thumb {
	flex: 0 0 72px;
	width: 72px;
	aspect-ratio: 4 / 5;
	background: var(--arena);
	overflow: hidden;
	display: block;
}
.rnc-cd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rnc-cd-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rnc-cd-head { display: flex; align-items: flex-start; gap: 10px; }
.rnc-cd-name {
	flex: 1 1 auto;
	font-family: var(--font-display);
	font-size: 15px;
	line-height: 1.25;
	color: var(--marron);
	text-decoration: none;
}
.rnc-cd-name:hover { color: var(--marron-med); }
.rnc-cd-remove {
	flex: 0 0 26px;
	width: 26px; height: 26px;
	display: flex; align-items: center; justify-content: center;
	background: none; border: none; color: var(--texto-2);
	cursor: pointer; transition: color .2s;
}
.rnc-cd-remove:hover { color: var(--marron); }
.rnc-cd-remove svg { width: 15px; height: 15px; }

/* Selector de variante dentro del ítem */
.rnc-cd-varsel { display: flex; flex-wrap: wrap; gap: 8px; }
.rnc-cd-varinput {
	flex: 1 1 auto;
	min-width: 0;
	padding: 8px 10px;
	border: 1px solid var(--arena-med);
	background: var(--blanco);
	font-family: var(--font-body);
	font-size: 12.5px;
	color: var(--texto);
	cursor: pointer;
}

.rnc-cd-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.rnc-cd-qty { display: inline-flex; align-items: stretch; border: 1px solid var(--arena-med); }
.rnc-cd-qbtn {
	width: 34px;
	background: var(--crema); border: none;
	color: var(--marron); font-size: 16px; line-height: 1; cursor: pointer;
	font-family: var(--font-body); transition: background .2s;
}
.rnc-cd-qbtn:hover { background: var(--arena); }
.rnc-cd-qinput {
	width: 38px; padding: 8px 2px;
	border: none; border-left: 1px solid var(--arena-med); border-right: 1px solid var(--arena-med);
	background: var(--blanco); text-align: center;
	font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--marron);
}
.rnc-cd-price { font-size: 14px; font-weight: 500; color: var(--marron); white-space: nowrap; }
.rnc-cd-price del { opacity: .55; font-weight: 400; margin-right: 5px; }
.rnc-cd-price ins { text-decoration: none; }

/* Pie del carrito: subtotal + botones apilados, pegado abajo del panel. */
.rnc-cd-foot {
	position: sticky;
	bottom: 0;
	flex: 0 0 auto;
	padding: 18px 22px 22px;
	background: var(--blanco);
	border-top: 1px solid var(--arena-med);
}
/* Saldo de puntos del cliente logueado (arriba del subtotal). */
.rnc-cd-points {
	display: flex; align-items: center; gap: 7px;
	margin-bottom: 12px; padding: 8px 12px;
	background: var(--crema); border: 1px solid var(--arena-med);
	font-size: 12px; color: var(--marron-med);
}
.rnc-cd-points-star { color: var(--camel); }
.rnc-cd-subtotal {
	display: flex; align-items: baseline; justify-content: space-between;
	margin-bottom: 16px;
}
.rnc-cd-sub-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--texto-2); font-weight: 500; }
.rnc-cd-sub-val { font-family: var(--font-display); font-size: 22px; font-weight: 400; color: var(--marron); }
.rnc-cd-btn {
	display: block; width: 100%; text-align: center; text-decoration: none;
	padding: 14px; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; font-weight: 500;
	transition: background .2s, border-color .2s, color .2s;
}
.rnc-cd-btn--ghost { border: 1px solid var(--marron); color: var(--marron); background: var(--blanco); margin-bottom: 10px; }
.rnc-cd-btn--ghost:hover { background: var(--crema); }
.rnc-cd-btn--solid { border: 1px solid var(--marron); background: var(--marron); color: var(--blanco); }
.rnc-cd-btn--solid:hover { background: var(--marron-med); border-color: var(--marron-med); }

.rnc-cd-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 22px; }

@media (max-width: 600px) {
	.rnc-wd-panel { width: 100%; max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.exit-box { animation: none; }
	.rnc-fav, .pdp-fav { transition: none; }
	.rnc-wd-panel, .rnc-wd-scrim { transition: none; }
}
