/*
 * Vista rápida — v3.204.0
 *
 * El botón aparece al pasar el mouse sobre la tarjeta. En pantallas táctiles
 * no hay "pasar el mouse", así que ahí queda siempre visible: esconderlo
 * detrás de un gesto que el teléfono no tiene lo dejaría inalcanzable para
 * la mayoría del tráfico.
 */

/* ---------- El botón sobre la tarjeta ---------- */

.cgvr-abrir {
	position: absolute;
	left: 50%;
	bottom: 12px;
	transform: translateX(-50%) translateY(6px);
	z-index: 5;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border: 0;
	border-radius: 999px;
	background: rgba(15, 23, 42, .88);
	color: #fff;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	pointer-events: none;
	transition: opacity .16s ease, transform .16s ease;
	backdrop-filter: blur(2px);
	white-space: nowrap;
}

/* El botón vive dentro del contenedor de la foto, pero quien decide mostrarlo
   es la tarjeta entera: pasar el mouse por el precio también cuenta como
   "estoy mirando este producto". */
[data-cg-qv]:hover .cgvr-abrir,
[data-cg-qv]:focus-within .cgvr-abrir,
.cgvr-abrir:focus-visible {
	opacity: 1;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0);
}

.cgvr-abrir:hover { background: #0F172A; }
.cgvr-abrir:focus-visible { outline: 2px solid #1E73BE; outline-offset: 2px; }

/*
 * Siempre visible cuando no hay mouse — y también en pantalla angosta.
 *
 * Al principio esto era solo (hover: none). Probando se vio el problema: un
 * navegador de escritorio en ventana angosta —y varias tablets— dicen tener
 * hover, así que el botón quedaba escondido detrás de un gesto que ahí no
 * existe. El ancho es la señal confiable: si la pantalla es de teléfono, el
 * botón se muestra sin pedir permiso.
 */
@media (hover: none), (max-width: 720px) {
	.cgvr-abrir {
		opacity: 1;
		pointer-events: auto;
		transform: translateX(-50%);
		bottom: 8px;
		padding: 6px 12px;
		font-size: 12px;
	}
	.cgvr-abrir-tx { display: none; }
}

/* ---------- La ventana ---------- */

body.cgvr-abierto { overflow: hidden; }

.cgvr-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(15, 23, 42, .58);
}
.cgvr-modal[hidden] { display: none; }

.cgvr-caja {
	position: relative;
	width: 100%;
	max-width: 900px;
	max-height: 88vh;
	overflow: auto;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
	-webkit-overflow-scrolling: touch;
}

.cgvr-x {
	position: absolute;
	top: 10px;
	right: 12px;
	z-index: 2;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: rgba(241, 245, 249, .95);
	color: #0F172A;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}
.cgvr-x:hover { background: #E2E8F0; }

.cgvr-cargando,
.cgvr-error { padding: 60px 24px; text-align: center; color: #64748B; font-size: 14px; }
.cgvr-error .cgvr-btn { margin-top: 14px; display: inline-block; }

/* ---------- Contenido ---------- */

.cgvr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.cgvr-col-img { padding: 22px; background: #F8FAFC; border-radius: 16px 0 0 16px; }
.cgvr-col-info { padding: 26px 24px 24px; min-width: 0; }

.cgvr-foto {
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
}
.cgvr-foto img { width: 100%; height: 100%; object-fit: contain; }
.cgvr-sinfoto { color: #94A3B8; font-size: 13px; }

.cgvr-minis { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cgvr-mini {
	width: 54px; height: 54px; padding: 0;
	border: 2px solid transparent; border-radius: 9px;
	background: #fff; cursor: pointer; overflow: hidden;
}
.cgvr-mini.on { border-color: #1E73BE; }
.cgvr-mini img { width: 100%; height: 100%; object-fit: cover; }

.cgvr-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cgvr-badge {
	font-size: 10px; font-weight: 900; letter-spacing: .03em;
	padding: 4px 9px; border-radius: 7px; color: #fff;
}
.cgvr-badge img.emoji {
	height: 1.4em !important; width: 1.4em !important;
	vertical-align: -.28em !important; margin: 0 2px 0 0 !important;
}

.cgvr-nombre { margin: 0 0 6px; font-size: 20px; line-height: 1.3; font-weight: 800; }
.cgvr-nombre a { color: #0F172A; text-decoration: none; }
.cgvr-nombre a:hover { text-decoration: underline; }

.cgvr-vendedor { font-size: 13px; color: #475569; margin-bottom: 12px; }
.cgvr-ck { color: #16A34A; font-weight: 900; }

.cgvr-precio { font-size: 26px; font-weight: 900; color: #0F172A; margin-bottom: 10px; }
.cgvr-precio del { font-size: 15px; font-weight: 600; color: #94A3B8; margin-left: 6px; }
.cgvr-off {
	font-size: 12px; font-weight: 800; color: #DC2626;
	background: #FEE2E2; padding: 3px 8px; border-radius: 6px;
	vertical-align: middle; margin-left: 4px;
}

.cgvr-resumen { font-size: 13.5px; line-height: 1.5; color: #475569; margin: 0 0 14px; }

/* ---------- Variantes ---------- */

.cgvr-variantes { margin: 0 0 14px; }
.cgvr-eje { margin-bottom: 10px; }
.cgvr-eje-nom {
	display: block; font-size: 12px; font-weight: 800;
	color: #334155; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .03em;
}
.cgvr-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.cgvr-pill {
	padding: 7px 13px; border: 1.5px solid #CBD5E1; border-radius: 8px;
	background: #fff; color: #0F172A; font-size: 13px; font-weight: 600; cursor: pointer;
}
.cgvr-pill:hover { border-color: #94A3B8; }
.cgvr-pill.on { border-color: #1E73BE; background: #EFF6FF; color: #1E73BE; }
.cgvr-aviso { font-size: 12.5px; color: #B45309; background: #FEF3C7; padding: 7px 11px; border-radius: 8px; margin: 8px 0 0; }

/* ---------- Comprar ---------- */

.cgvr-fila { display: flex; gap: 10px; align-items: stretch; margin-top: 4px; }
.cgvr-qty {
	width: 72px; padding: 11px 10px; border: 1.5px solid #CBD5E1;
	border-radius: 10px; font-size: 15px; text-align: center;
}
.cgvr-btn {
	flex: 1; padding: 12px 20px; border: 0; border-radius: 10px;
	background: #1E73BE; color: #fff; font-size: 15px; font-weight: 800;
	cursor: pointer; text-align: center; text-decoration: none;
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.cgvr-btn:hover { background: #1758a0; }
.cgvr-btn[disabled] { background: #CBD5E1; cursor: not-allowed; }

.cgvr-regla { font-size: 12.5px; color: #B45309; background: #FEF3C7; border-radius: 8px; padding: 7px 11px; margin: 0 0 9px; }

.cgvr-nota { font-size: 12.5px; color: #64748B; margin: 9px 0 0; line-height: 1.45; }

.cgvr-agotado {
	padding: 12px; border-radius: 10px; background: #F1F5F9;
	color: #64748B; font-weight: 700; text-align: center; font-size: 14px;
}

.cgvr-datos { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 7px; }
.cgvr-datos li { font-size: 13px; color: #334155; display: flex; gap: 8px; align-items: center; }
.cgvr-ic { width: 18px; text-align: center; }

.cgvr-todo {
	display: inline-block; margin-top: 16px;
	font-size: 13.5px; font-weight: 700; color: #1E73BE; text-decoration: none;
}
.cgvr-todo:hover { text-decoration: underline; }

/* ---------- Teléfono ---------- */

@media (max-width: 720px) {
	.cgvr-modal { padding: 0; align-items: flex-end; }
	.cgvr-caja { max-width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
	.cgvr-cols { grid-template-columns: 1fr; }
	.cgvr-col-img { padding: 16px; border-radius: 16px 16px 0 0; }
	.cgvr-foto { aspect-ratio: 4 / 3; }
	.cgvr-col-info { padding: 18px 16px 24px; }
	.cgvr-nombre { font-size: 17px; }
	.cgvr-precio { font-size: 22px; }
}
