/* ============================================================
   WYVRN — cesta de la compra
   Botón del nav + cajón lateral. Tokens en common.css.
   ============================================================ */

/* ===================== BOTÓN DEL NAV ===================== */
.cart-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	background: transparent;
	border: var(--hairline) solid var(--border);
	border-radius: var(--r-sm);
	color: var(--text-muted);
	cursor: pointer;
	transition: color 200ms var(--ease), border-color 200ms var(--ease), background 200ms var(--ease);
}

.cart-btn:hover {
	color: var(--accent-text);
	border-color: var(--accent-text);
	background: var(--accent-wash);
}

.cart-btn svg { width: 18px; height: 18px; }

.cart-count {
	position: absolute;
	top: -6px;
	right: -6px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: var(--r-pill);
	background: var(--accent);
	color: var(--on-accent);
	font-family: var(--font-body);
	font-size: 11px;
	font-weight: 800;
	line-height: 18px;
	text-align: center;
}

/* ===================== CAJÓN ===================== */
.cart-scrim {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(2px);
	opacity: 0;
	transition: opacity 260ms var(--ease);
	z-index: 900;
}

.cart-drawer {
	position: fixed;
	top: 0;
	right: 0;
	width: 420px;
	max-width: 92vw;
	height: 100%;
	background: var(--surface-grad);
	border-left: var(--hairline) solid var(--border);
	box-shadow: var(--shadow-pop);
	transform: translateX(100%);
	transition: transform 300ms var(--ease);
	z-index: 901;
	display: flex;
	flex-direction: column;
}

body.cart-open .cart-scrim { opacity: 1; }
body.cart-open .cart-drawer { transform: translateX(0); }

.cart-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--s-5);
	border-bottom: var(--hairline) solid var(--border);
}

.cart-head h2 { font-size: var(--fs-xl); }

.cart-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: none;
	border: var(--hairline) solid transparent;
	border-radius: var(--r-sm);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: var(--text-muted);
	transition: color 180ms var(--ease), border-color 180ms var(--ease);
}

.cart-close:hover { color: var(--accent-text); border-color: var(--border); }

.cart-body {
	flex: 1;
	overflow-y: auto;
	padding: 0 var(--s-5);
}

/* ===================== LÍNEA DE PRODUCTO ===================== */
.cart-item {
	display: flex;
	align-items: center;
	gap: var(--s-3);
	padding: var(--s-4) 0;
	border-bottom: var(--hairline) solid var(--border);
}

.cart-item img {
	width: 58px;
	height: 58px;
	object-fit: contain;
	flex: 0 0 auto;
	padding: var(--s-2);
	background: var(--sunken-grad);
	border: var(--hairline) solid var(--border);
	border-radius: var(--r-sm);
	box-shadow: var(--highlight), var(--shadow-1);
}

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-info h3 {
	font-size: var(--fs-md);
	font-weight: 800;
	line-height: 1.2;
}

.cart-item-type {
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-faint);
	margin-top: 3px;
}

.cart-item-right {
	display: flex;
	align-items: center;
	gap: var(--s-3);
	flex: 0 0 auto;
}

.cart-item-price {
	font-family: var(--font-display);
	font-size: var(--fs-lg);
	font-weight: 800;
}

.cart-remove {
	background: none;
	border: none;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: var(--text-faint);
	padding: 0 2px;
	transition: color 150ms var(--ease);
}

.cart-remove:hover { color: var(--danger); }

/* ===================== VACÍA ===================== */
.cart-empty { text-align: center; padding: var(--s-9) var(--s-4); }

.cart-empty p {
	color: var(--text-muted);
	margin-bottom: var(--s-5);
}

/* ===================== PIE ===================== */
.cart-foot {
	border-top: var(--hairline) solid var(--border);
	padding: var(--s-5);
	background: var(--surface-2);
}

.cart-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: var(--s-2);
}

.cart-saved { font-size: var(--fs-base); color: var(--ok-text); }

.cart-total {
	font-family: var(--font-display);
	font-size: var(--fs-xl);
	font-weight: 800;
	margin-bottom: var(--s-4);
}

.cart-checkout {
	display: flex;
	width: 100%;
	padding: 15px 0;
}

.cart-note {
	font-size: var(--fs-xs);
	color: var(--text-faint);
	text-align: center;
	margin-top: var(--s-3);
	line-height: 1.5;
}

.cart-clear {
	display: block;
	margin: var(--s-3) auto 0;
	background: none;
	border: none;
	font-family: var(--font-body);
	font-size: var(--fs-sm);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	color: var(--text-faint);
	transition: color 180ms var(--ease);
}

.cart-clear:hover { color: var(--danger); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 480px) {
	.cart-drawer { width: 100%; }
	.cart-item img { width: 48px; height: 48px; }
}
