/* ============================================================
   NX::Merchant Store Pro
   Sistema independiente del corazón/Favoritos.
   ============================================================ */

/* Contenedor del botón de pedido + botón de carrito, en la ficha
   de producto (ver single-nx_product.php). */
.nx-producto-acciones {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.nx-producto-acciones .nx-btn-pedido,
.nx-producto-acciones .nx-btn-carrito {
	margin-bottom: 8px;
}

/* Botón "Añadir al carrito": mismo tamaño/forma que "Realizar pedido en
   tienda" pero en azul, para distinguirlo visualmente sin competir. */
.nx-btn-carrito {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #9f8776;
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 10px 24px;
	font-size: 1rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.15s ease;
}

.nx-btn-carrito:hover {
	background: #766154;
}

.nx-btn-carrito svg {
	pointer-events: none;
	flex-shrink: 0;
}

/* Estado "ya está en el carrito": el botón nunca desaparece, solo
   cambia de aspecto/texto — así siempre queda claro cómo quitarlo
   de nuevo sin tener que abrir el carrito. */
.nx-btn-carrito.is-en-carrito {
	background: #16a34a;
}

.nx-btn-carrito.is-en-carrito:hover {
	background: #15803d;
}

/* ============================================================
   TARJETA DE PRODUCTO con botón "Añadir al carrito" (v2.21)
   Usado por [nx_destacados]. La tarjeta pasa a ser una columna para
   que el botón quede siempre alineado al pie, aunque los títulos
   tengan longitudes distintas.
   ============================================================ */

.nx-producto-card--con-carrito {
	display: flex;
	flex-direction: column;
}

.nx-producto-card-acciones {
	margin-top: auto;
	padding-top: 12px;
}

.nx-btn-carrito-card {
	box-sizing: border-box;
	width: 100%;
	justify-content: center;
	padding: 10px 14px;
	font-size: 0.95rem;
	line-height: 1.3;
	text-align: center;
}

/* Producto con variantes: no se puede añadir desde la tarjeta (el precio,
   SKU e imagen dependen de la combinación); el distintivo lleva a la ficha. */
.nx-btn-carrito-card.nx-btn-opciones {
	background: #fff;
	color: #2563eb;
	border: 2px solid #2563eb;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.nx-producto-card:hover .nx-btn-carrito-card.nx-btn-opciones,
.nx-btn-carrito-card.nx-btn-opciones:hover {
	background: #2563eb;
	color: #fff;
}

/* ============================================================
   BURBUJA FLOTANTE — fija arriba a la derecha.
   ============================================================ */

.nx-carrito-burbuja {
	position: fixed;
	top: 90px;
	right: 20px;
	z-index: 9998;
	width: 52px;
	height: 52px;
	border: none;
	border-radius: 50%;
	background: #2563eb;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nx-carrito-burbuja:hover {
	transform: scale(1.06);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.nx-carrito-burbuja:active {
	transform: scale(0.95);
}

.nx-carrito-burbuja svg {
	pointer-events: none;
}

.nx-carrito-burbuja-contador {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 10px;
	background: #dc2626;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}

@media (max-width: 600px) {
	.nx-carrito-burbuja {
		top: 70px;
		right: 12px;
		width: 46px;
		height: 46px;
	}
}

/* ============================================================
   MODAL DEL CARRITO
   ============================================================ */

.nx-carrito-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 80px 12px 30px;
	overflow-y: auto;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.nx-carrito-modal.is-abierto {
	opacity: 1;
	visibility: visible;
}

.nx-carrito-modal-fondo {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
}

.nx-carrito-modal-caja {
	position: relative;
	background: #fff;
	width: 100%;
	max-width: 760px;
	border-radius: 12px;
	overflow: hidden;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
	transform: translateY(-14px) scale(0.98);
	transition: transform 0.2s ease;
}

.nx-carrito-modal.is-abierto .nx-carrito-modal-caja {
	transform: translateY(0) scale(1);
}

.nx-carrito-modal-cabecera {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 20px;
	background: #1e3a5f;
	flex-shrink: 0;
}

.nx-carrito-modal-cabecera h3 {
	margin: 0;
	color: #fff;
	font-size: 1rem;
	font-weight: 700;
}

.nx-carrito-modal-cerrar {
	width: 30px;
	height: 30px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 15px;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.2s ease;
}

.nx-carrito-modal-cerrar:hover {
	background: #dc2626;
	transform: rotate(90deg);
}

.nx-carrito-modal-lista {
	padding: 10px 16px;
	overflow-y: auto;
	flex: 1;
}

.nx-carrito-modal-vacio {
	padding: 40px 10px;
	color: #777;
	text-align: center;
	font-size: 14px;
}

.nx-carrito-modal-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	margin-bottom: 8px;
	background: #f7f7f7;
	border: 1px solid #ececec;
	border-radius: 8px;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.nx-carrito-modal-item:hover {
	border-color: #d7d7d7;
	background: #f2f2f2;
}

.nx-carrito-modal-item-imagen {
	width: 48px;
	height: 48px;
	flex-shrink: 0;
	border-radius: 6px;
	overflow: hidden;
	background: #eee;
}

.nx-carrito-modal-item-imagen img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.nx-carrito-modal-item-info {
	flex: 1;
	min-width: 0;
}

.nx-carrito-modal-item-nombre {
	display: block;
	color: #222;
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.nx-carrito-modal-item-nombre:hover {
	color: #2563eb;
}

.nx-carrito-modal-item-sku {
	display: block;
	margin-top: 1px;
	font-size: 11px;
	font-family: Consolas, Monaco, monospace;
	color: #888;
}

.nx-carrito-modal-item-variante {
	display: block;
	margin-top: 1px;
	font-size: 11px;
	color: #666;
}

.nx-carrito-modal-item-precio {
	display: block;
	margin-top: 2px;
	color: #2c7a4b;
	font-size: 13px;
	font-weight: 700;
}

.nx-carrito-modal-item-quitar {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: #b7b7b7;
	font-size: 15px;
	cursor: pointer;
	transition: color 0.15s ease, background 0.15s ease;
}

.nx-carrito-modal-item-quitar:hover {
	color: #dc2626;
	background: #fdecec;
}

/* ============================================================
   RESUMEN (subtotal / IVA / total) — petición 1
   ============================================================ */

.nx-carrito-modal-resumen {
	flex-shrink: 0;
	padding: 14px 20px 20px;
	border-top: 1px solid #eee;
	background: #fafafa;
}

.nx-carrito-resumen-fila {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 4px 0;
	font-size: 14px;
	color: #555;
}

.nx-carrito-resumen-fila.nx-carrito-resumen-total {
	margin-top: 6px;
	padding-top: 10px;
	border-top: 1px dashed #ddd;
	font-size: 16px;
}

.nx-carrito-resumen-fila.nx-carrito-resumen-total span:first-child {
	font-weight: 700;
	color: #222;
}

.nx-carrito-resumen-fila.nx-carrito-resumen-total span:last-child {
	font-weight: 800;
	color: #2563eb;
	font-size: 18px;
}

.nx-carrito-btn-enviar-pedido {
	display: block;
	width: 100%;
	margin-top: 14px;
	text-align: center;
}

/* ============================================================
   CHECKOUT DEL CARRITO — resumen de productos (petición 3)
   ============================================================ */

.nx-carritop-resumen-productos {
	margin-bottom: 16px;
}

.nx-carritop-lista-resumen {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid #eee;
	border-radius: 8px;
	overflow: hidden;
}

.nx-carritop-lista-resumen li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 12px;
	font-size: 13.5px;
	background: #fafafa;
}

.nx-carritop-lista-resumen li:nth-child(even) {
	background: #fff;
}

.nx-carritop-lista-resumen li span {
	color: #333;
}

.nx-carritop-lista-resumen li span small {
	display: block;
	font-family: Consolas, Monaco, monospace;
	font-size: 11px;
	font-weight: 400;
	color: #888;
}

.nx-carritop-lista-resumen li strong {
	flex-shrink: 0;
	color: #2c7a4b;
}
