/*
 * cart-drawer.css — Carrito deslizante estilo Shopify.
 * Panel que entra desde la derecha al agregar un producto o tocar el carrito.
 */

.gn-drawer-overlay {
	position: fixed;
	inset: 0;
	background: rgba(10, 15, 20, .45);
	z-index: 1200;
	opacity: 0;
	transition: opacity .3s ease;
}
.gn-drawer-overlay.gn-visible { opacity: 1 !important; }
.gn-drawer-overlay[hidden] { display: none; }

.gn-drawer {
	position: fixed;
	top: 0; right: 0;
	height: 100%;
	width: min(420px, 92vw);
	background: #fff;
	z-index: 1300;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform .3s cubic-bezier(.4, 0, .2, 1);
	box-shadow: -12px 0 40px rgba(10, 15, 20, .18);
}
/* !important: el optimizador de CSS de LiteSpeed a veces reordena las reglas y
   deja la base .gn-drawer después de esta; así el estado "abierto" siempre gana. */
.gn-drawer.gn-abierto { transform: translateX(0) !important; }
.gn-drawer.gn-cargando { opacity: .6; pointer-events: none; }

.gn-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.1rem 1.25rem;
	border-bottom: 1px solid var(--color-borde);
	flex: none;
}
.gn-drawer__head h2 {
	margin: 0;
	font-size: 1.05rem;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--color-secundario);
}
.gn-drawer__cerrar {
	background: none;
	border: none;
	font-size: 1.8rem;
	line-height: 1;
	color: var(--color-secundario);
	cursor: pointer;
	width: 40px;
	height: 40px;
}

.gn-drawer__cuerpo {
	flex: 1;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}

/* ─── Lista de ítems ─── */
.gn-drawer__items {
	list-style: none;
	margin: 0;
	padding: .5rem 1.25rem;
	flex: 1;
}
.gn-drawer__item {
	display: grid;
	grid-template-columns: 64px 1fr;
	gap: .9rem;
	padding: 1rem 0;
	border-bottom: 1px solid var(--color-borde);
}
.gn-drawer__item:last-child { border-bottom: none; }
.gn-drawer__thumb img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: var(--radio-sm);
	border: 1px solid var(--color-borde);
}
.gn-drawer__nombre {
	margin: 0 0 .15rem;
	font-size: .88rem;
	font-weight: 600;
	line-height: 1.3;
}
.gn-drawer__nombre a { color: var(--color-secundario); }
.gn-drawer__variacion {
	font-size: .78rem;
	color: var(--color-texto-suave);
	margin-bottom: .3rem;
}
.gn-drawer__variacion p { margin: 0; }
.gn-drawer__precio {
	margin: 0 0 .5rem;
	font-weight: 700;
	color: var(--color-secundario);
	font-size: .9rem;
}
.gn-drawer__fila {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .5rem;
}
.gn-drawer__qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--color-borde);
	border-radius: var(--radio-full);
	overflow: hidden;
}
.gn-drawer__qty button {
	background: none;
	border: none;
	width: 30px;
	height: 30px;
	font-size: 1rem;
	cursor: pointer;
	color: var(--color-secundario);
	line-height: 1;
}
.gn-drawer__qty button:hover { background: var(--color-fondo-alterno); }
.gn-drawer__qval {
	min-width: 26px;
	text-align: center;
	font-size: .85rem;
	font-weight: 600;
}
.gn-drawer__eliminar {
	font-size: .78rem;
	color: var(--color-texto-suave);
	text-decoration: underline;
	text-underline-offset: 3px;
}
.gn-drawer__eliminar:hover { color: var(--color-error); }

/* ─── Pie ─── */
.gn-drawer__pie {
	flex: none;
	padding: 1.1rem 1.25rem calc(1.1rem + env(safe-area-inset-bottom));
	border-top: 1px solid var(--color-borde);
	background: #fff;
}
.gn-drawer__pie .gn-envio-gratis-barra { margin-bottom: .9rem; }
.gn-drawer__total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: .2rem;
}
.gn-drawer__total span {
	font-size: .95rem;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: var(--color-secundario);
}
.gn-drawer__total strong {
	font-family: var(--fuente-titulos);
	font-size: 1.25rem;
	font-weight: 800;
	color: var(--color-secundario);
}
.gn-drawer__nota {
	font-size: .76rem;
	color: var(--color-texto-suave);
	margin: 0 0 .9rem;
}
.gn-drawer__comprar {
	display: block;
	width: 100%;
	background: var(--color-primario);
	color: #fff;
	text-align: center;
	padding: .95rem 1rem;
	border-radius: var(--radio-md);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	font-size: .9rem;
	transition: background var(--transicion);
}
.gn-drawer__comprar:hover { background: var(--color-primario-hover); color: #fff; }
.gn-drawer__vercarrito {
	display: block;
	text-align: center;
	margin-top: .7rem;
	font-size: .85rem;
	color: var(--color-secundario);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ─── Vacío ─── */
.gn-drawer__vacio {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .8rem;
	padding: 2rem;
	text-align: center;
	color: var(--color-texto-suave);
}
.gn-drawer__vacio-icono { font-size: 2.5rem; }
.gn-drawer__vacio .gn-drawer__comprar { max-width: 240px; }

/* Contador del ícono del carrito (por si estaba oculto en 0) */
.gn-cart-count[data-count="0"] { display: none; }
