/* Akibara Native Cart CSS - Brutalismo */
:root {
	--akb-cart-width: 404px;
	--akb-cart-z: 999999;
}

/* Overlay oscuro */
.akb-cart-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(4px);
	z-index: calc(var(--akb-cart-z) - 1);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}
.akb-cart-overlay.akb-open {
	opacity: 1;
	visibility: visible;
}

/* Drawer / Off-canvas */
.akb-cart-drawer {
	position: fixed;
	top: 0;
	right: 0;
	width: 100%;
	max-width: var(--akb-cart-width);
	height: 100vh;
	background: var(--aki-surface-1, #111);
	color: var(--aki-text-main, #fff);
	z-index: var(--akb-cart-z);
	display: flex;
	flex-direction: column;
	border-left: 4px solid #000;
	box-shadow: 0 0 0 transparent;
	transform: translateX(100%);
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
	visibility: hidden; /* Evita que exista interactivamente o cause overflow cuando está cerrado */
}
.akb-cart-drawer[data-side="left"] {
	right: auto;
	left: 0;
	border-left: none;
	border-right: 4px solid #000;
	transform: translateX(-100%);
}
.akb-cart-drawer.akb-open {
	transform: translateX(0);
	box-shadow: -10px 0 0 var(--aki-red, #ff0000);
	visibility: visible;
}
.akb-cart-drawer[data-side="left"].akb-open {
	box-shadow: 10px 0 0 var(--aki-red, #ff0000);
}

/* Header */
.akb-cart-header {
	padding: 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 2px solid var(--aki-border, #333);
	background: var(--aki-black, #121212);
}
.akb-cart-header h3 {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: -1px;
}
.akb-cart-close {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	color: #fff;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	/* Tap target >=44px (antes ~19x32); el glifo sigue a 2rem, centrado. */
	width: var(--touch-target-min, 44px);
	height: var(--touch-target-min, 44px);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.akb-cart-close:hover {
	color: var(--aki-red, #ff0000);
}
.akb-cart-close:focus-visible,
.akb-cart-checkout-btn:focus-visible,
.akb-cart-continue-btn:focus-visible,
.akb-cart-item-remove:focus-visible,
.akb-cart-qty-ctrl button:focus-visible,
.akb-cs-add-btn:focus-visible {
	outline: 3px solid var(--aki-yellow, #ffeb3b);
	outline-offset: 2px;
}

.akb-cart-live {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Body */
.akb-cart-body {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
}

.akb-cart-status {
	display: grid;
	gap: 8px;
	min-height: 0;
	margin-bottom: 14px;
}
.akb-cart-status[hidden] {
	display: none;
}
.akb-cart-status__item {
	padding: 10px 12px;
	background: #090909;
	border-left: 4px solid var(--aki-yellow, #ffeb3b);
	color: var(--aki-text-muted, #ccc);
	font-size: 0.82rem;
	line-height: 1.35;
}

/* Items */
.akb-cart-item {
	display: flex;
	align-items: center;
	position: relative;
	padding: 15px;
	border: 2px solid transparent;
	border-bottom: 2px solid var(--aki-black, #000);
	gap: 15px;
	background: var(--aki-surface-1);
	transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.akb-cart-item:hover {
	transform: translate(-4px, -4px);
	box-shadow: 6px 6px 0 var(--aki-black);
	border-color: var(--aki-black);
	z-index: 10;
}
.akb-cart-item-img {
	width: 60px;
	height: 80px;
	background: #222;
	flex-shrink: 0;
	overflow: hidden;
}
.akb-cart-item-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.akb-cart-item-details {
	flex: 1;
}
.akb-cart-item-title {
	font-weight: 800;
	font-size: 1rem;
	margin-bottom: 5px;
	line-height: 1.2;
}
.akb-cart-item-price {
	color: var(--aki-yellow, #FFD700);
	font-size: 0.9rem;
}
.akb-cart-item-qty {
	display: flex;
	align-items: center;
	margin-top: 10px;
}
.akb-cart-item-qty span {
	font-size: 0.8rem;
	background: var(--aki-surface-3, #333);
	padding: 2px 8px;
	border-radius: 4px;
	font-weight: bold;
}
.akb-cart-qty-ctrl {
	display: flex;
	align-items: center;
	border: 2px solid var(--aki-black, #000);
	border-radius: 0;
	overflow: hidden;
}
.akb-cart-qty-ctrl button {
	background: var(--aki-surface-3, #333);
	border: none;
	color: #fff;
	padding: 5px 12px;
	min-width: var(--touch-target-min, 44px);
	min-height: var(--touch-target-min, 44px);
	cursor: pointer;
	font-weight: 900;
	transition: background 0.2s, color 0.2s;
}
.akb-cart-qty-ctrl button:hover {
	background: var(--aki-black, #121212);
	color: var(--aki-white);
}
.akb-cart-qty-ctrl button:disabled,
.akb-cart-qty-ctrl button[aria-disabled="true"] {
	opacity: 0.4;
	cursor: not-allowed;
}
.akb-cart-qty-ctrl button:disabled:hover,
.akb-cart-qty-ctrl button[aria-disabled="true"]:hover {
	background: var(--aki-surface-3, #333);
	color: #fff;
}
/* Carrito vacío: el JS oculta el footer entero (atributo [hidden] no le gana al
   display:flex de autor → hace falta esta regla) para no dejar "Pagar pedido"
   activo sobre $0 ni la barra de envío congelada. */
.akb-cart-footer[hidden] {
	display: none;
}
.akb-cart-qty-ctrl input {
	background: transparent;
	border: none;
	color: #fff;
	width: 40px;
	text-align: center;
	-moz-appearance: textfield;
}
.akb-cart-qty-ctrl input::-webkit-outer-spin-button,
.akb-cart-qty-ctrl input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.akb-cart-item-remove {
	background: transparent !important;
	border: 2px solid transparent !important;
	box-shadow: none !important;
	color: var(--aki-text-muted, #777);
	cursor: pointer;
	width: var(--touch-target-min, 44px);
	height: var(--touch-target-min, 44px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
/* Ícono basurero (SVG con stroke=currentColor → hereda color de reposo/hover). */
.akb-cart-item-remove svg {
	width: 18px;
	height: 18px;
	display: block;
}
.akb-cart-item-remove:hover {
	background: var(--aki-red, #ff0000) !important;
	color: var(--aki-white) !important;
	border-color: var(--aki-black) !important;
	transform: translate(-2px, -2px) !important;
	box-shadow: 4px 4px 0 var(--aki-black) !important;
}

/* Cross-Sells Gamification */
.akb-cart-cross-sells {
	margin-top: 30px;
	padding-top: 20px;
	border-top: 2px dashed var(--aki-border, #333);
	min-height: 120px;
}
.akb-cart-cross-sells h4 {
	margin: 0 0 15px 0;
	font-size: 1.1rem;
	font-weight: 800;
	text-transform: uppercase;
	color: var(--aki-text-muted, #aaa);
}
.akb-cs-item {
	display: flex;
	align-items: center;
	padding: 10px;
	background: var(--aki-surface-2, #181818);
	margin-bottom: 10px;
	border: 2px solid var(--aki-black, #000);
	border-radius: 0;
	gap: 10px;
	transition: transform 0.2s, box-shadow 0.2s;
}
.akb-cs-item:hover {
	transform: translate(-2px, -2px);
	box-shadow: 4px 4px 0 var(--aki-black);
}
.akb-cs-img {
	width: 40px;
	height: 55px;
	background: #222;
	flex-shrink: 0;
	overflow: hidden;
}
.akb-cs-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.akb-cs-details {
	flex: 1;
}
.akb-cs-title {
	font-weight: bold;
	font-size: 0.9rem;
	margin-bottom: 3px;
	line-height: 1.2;
}
.akb-cs-price {
	color: var(--aki-yellow, #FFD700);
	font-size: 0.8rem;
}
.akb-cs-add-btn {
	background: var(--aki-black, #000);
	color: var(--aki-white, #fff);
	border: 2px solid var(--aki-border, #333);
	padding: 5px 10px;
	text-decoration: none;
	font-size: 0.8rem;
	font-weight: 900;
	text-transform: uppercase;
	cursor: pointer;
	border-radius: 0;
	transition: background-color 0.2s, color 0.2s;
}
.akb-cs-add-btn:hover {
	background: var(--aki-yellow, #ff0000);
	color: var(--aki-black);
	border-color: var(--aki-black);
	transform: translate(-2px, -2px);
	box-shadow: 3px 3px 0 var(--aki-black);
}

/* Empty State */
.akb-cart-empty {
	text-align: center;
	padding: 40px 0;
	color: var(--aki-text-muted, #777);
}

/* Loading */
.akb-cart-loading {
	text-align: center;
	padding: 40px 0;
	min-height: 120px;
	font-weight: bold;
	color: var(--aki-text-muted, #777);
	animation: pulse 1.5s infinite;
}
@keyframes pulse {
	0% { opacity: 0.5; }
	50% { opacity: 1; }
	100% { opacity: 0.5; }
}

/* Footer */
.akb-cart-footer {
	padding: 20px;
	background: var(--aki-black, #121212);
	border-top: 2px solid var(--aki-border, #333);
}
.akb-cart-progress-slot {
	min-height: 44px;
	margin-bottom: 12px;
}
.akb-cart-subtotal {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 1.2rem;
	font-weight: 900;
	margin-bottom: 10px;
}
.akb-cart-shipping-notice {
	font-size: 0.8rem;
	color: var(--aki-text-muted, #aaa);
	text-align: center;
	margin-bottom: 15px;
}
.akb-cart-checkout-btn {
	display: block;
	box-sizing: border-box;
	text-align: center;
	background: var(--aki-red) !important;
	color: #fff !important;
	padding: 16px;
	font-size: 1.2rem;
	font-weight: 800;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: 4px !important;
	border: none !important;
	box-shadow: none !important;
	transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
	clip-path: none !important;
	transform: none !important;
}
.akb-cart-checkout-btn:hover {
	/* Checkout = zona calmada: feedback por color/brillo, SIN movimiento
	   (ui-ux-pro-max "stable hover"). Se quitó el translateY que daba el salto. */
	background: var(--aki-red-bright); /* Brighter red */
	box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3) !important;
	color: #fff;
}
.akb-cart-continue-btn {
	display: block;
	box-sizing: border-box;
	margin-top: 12px;
	text-align: center;
	color: #aaa;
	font-size: 0.95rem;
	font-weight: 600;
	text-transform: uppercase;
	text-decoration: none;
	padding: 14px;
	border-radius: 4px;
	border: 1px solid #333;
	transition: color 0.2s ease, border-color 0.2s ease;
}
.akb-cart-continue-btn:hover {
	color: #fff;
	border-color: #666;
	background: rgba(255, 255, 255, 0.05);
}

.akb-reduced-motion,
.akb-reduced-motion *,
.akb-reduced-motion::before,
.akb-reduced-motion::after {
	animation-duration: 0.01ms !important;
	animation-iteration-count: 1 !important;
	scroll-behavior: auto !important;
	transition-duration: 0.01ms !important;
}

/* Responsiveness (Mobile/Tablet) */
@media (max-width: 480px) {
	.akb-cart-drawer.akb-cart-drawer--mobile-full {
		max-width: none;
		border-left: none; /* En mobile ocupa toda la pantalla */
		border-right: none;
	}
	.akb-cart-header {
		padding: 15px;
	}
	.akb-cart-body {
		padding: 15px;
	}
	.akb-cart-item {
		gap: 10px;
	}
	.akb-cart-item-img {
		width: 50px;
		height: 70px;
	}
	.akb-cart-item-title {
		font-size: 0.9rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.akb-cart-overlay,
	.akb-cart-drawer,
	.akb-cart-item,
	.akb-cs-item,
	.akb-cart-checkout-btn,
	.akb-cart-loading {
		animation: none !important;
		transition: none !important;
	}

	.akb-cart-item:hover,
	.akb-cs-item:hover,
	.akb-cart-checkout-btn:hover {
		transform: none;
	}
}
