/* ================================================
   Combos Regalo — Estilos de Carrito y Checkout
   ================================================ */

/* ── Sección contenedora ── */
.combo-regalo-selector {
	margin-top: 10px;
	padding: 10px 12px;
	border: 1.5px solid #cfcfcf;
	border-radius: 8px;
	background: #fafafa;
	display: block;
	max-width: 100%;
	transition: opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease;
	box-sizing: border-box;
}

/* Con regalo elegido, la caja se calma en verde */
.combo-regalo-selector--elegido {
	border-color: #a5d6a7;
	background: #f1f8f1;
}

.combo-regalo-selector.combo-regalo--loading {
	opacity: 0.5;
	cursor: wait;
}

.combo-regalo-titulo-cart {
	font-size: 13px;
	font-weight: 700;
	color: #222;
	margin-bottom: 9px;
	text-align: left;
	display: flex;
	align-items: center;
	gap: 6px;
}

.combo-regalo-gift-icon {
	width: 17px;
	height: 17px;
	flex-shrink: 0;
	color: #2e7d32;
}

/* ── Grid de tarjetas — fila en desktop ── */
.combo-regalo-cards {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 6px;
}

/* ── Tarjeta: imagen izquierda + texto derecha ── */
.combo-regalo-card {
	position: relative;
	display: flex;
	flex-direction: row;
	align-items: center;
	text-align: left;
	gap: 8px;
	width: 215px;
	flex-shrink: 0;
	padding: 7px 10px;
	border: 2px solid #e0e0e0;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
	user-select: none;
	box-sizing: border-box;
}

.combo-regalo-card--unico {
	width: 190px;
	cursor: default;
	border-color: #a5d6a7;
	background: #f1f8f1;
}

/* ── Estado seleccionado ── */
.combo-regalo-card.selected {
	border-color: #2e7d32;
	background: #f1f8f1;
	box-shadow: 0 0 0 3px rgba( 46, 125, 50, 0.12 );
}

/* ── Círculo indicador de selección (derecha de la tarjeta) ── */
.combo-regalo-card__dot {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	border-radius: 50%;
	border: 2px solid #cfcfcf;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	line-height: 1;
	color: transparent;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Hover sobre una tarjeta sin elegir: el círculo insinúa verde */
.combo-regalo-card[data-regalo-id]:hover .combo-regalo-card__dot {
	border-color: #81c784;
}

/* Elegido: tilde verde */
.combo-regalo-card.selected .combo-regalo-card__dot {
	background: #2e7d32;
	border-color: #2e7d32;
	color: #fff;
}

.combo-regalo-card.selected .combo-regalo-card__dot::before {
	content: '\2713'; /* ✓ */
}

/* Hover sobre el elegido SIMPLE (desktop): el click lo quita → mostrar ✕ */
.combo-regalo-card.selected[data-regalo-tipo="simple"]:hover .combo-regalo-card__dot {
	background: #fff;
	border-color: #d98a8a;
	color: #c62828;
}

.combo-regalo-card.selected[data-regalo-tipo="simple"]:hover .combo-regalo-card__dot::before {
	content: '\2715'; /* ✕ */
}

/* Touch (sin hover): en el elegido SIMPLE mostrar la ✕ siempre para que se entienda */
@media ( hover: none ) {
	.combo-regalo-card.selected[data-regalo-tipo="simple"] .combo-regalo-card__dot {
		background: #fff;
		border-color: #d98a8a;
		color: #c62828;
	}
	.combo-regalo-card.selected[data-regalo-tipo="simple"] .combo-regalo-card__dot::before {
		content: '\2715'; /* ✕ */
	}
}

/* ── Hover ── */
.combo-regalo-card[data-regalo-id]:hover {
	border-color: #81c784;
	box-shadow: 0 2px 6px rgba( 0, 0, 0, 0.07 );
}

/* ── Imagen ── */
.combo-regalo-card__imagen {
	width: 40px;
	height: 40px;
	overflow: hidden;
	border-radius: 4px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
}

.combo-regalo-card__imagen img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

/* ── Info: nombre arriba, precio abajo ── */
.combo-regalo-card__info {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1px;
	flex: 1;
	min-width: 0;
}

.combo-regalo-card__nombre {
	font-size: 12px;
	font-weight: 600;
	color: #333;
	line-height: 1.25;
	word-break: break-word;
}

.combo-regalo-card__precio {
	font-size: 11px;
	color: #666;
	white-space: nowrap;
}

.combo-regalo-card__precio del {
	color: #bbb;
}

/* ── "Gratis" ── */
.combo-regalo-gratis {
	color: #2e7d32;
	font-weight: 700;
	font-size: 12px;
}

/* ── "✓ Incluido" ── */
.combo-regalo-incluido {
	font-size: 10px;
	color: #2e7d32;
	font-weight: 600;
	margin-top: 1px;
}

.combo-regalo-incluido::before {
	content: '✓ ';
}

/* ── Sin stock ── */
.combo-regalo-card--sin-stock {
	opacity: 0.45;
	cursor: not-allowed;
	border-color: #e0e0e0;
	background: #f5f5f5;
}

.combo-regalo-card--sin-stock:hover {
	border-color: #e0e0e0;
	box-shadow: none;
}

.combo-regalo-card--sin-stock .combo-regalo-card__imagen img {
	filter: grayscale( 60% );
}

.combo-regalo-sin-stock {
	font-size: 10px;
	font-weight: 700;
	color: #c62828;
	margin-top: 1px;
	text-transform: uppercase;
}

/* ── Badge en pedidos ── */
.combo-regalo-badge {
	display: inline-block;
	background-color: #e8f5e9;
	color: #2e7d32;
	font-size: 10px;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 3px;
	margin-left: 6px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	vertical-align: middle;
}

/* ── Ocultar la fila del regalo (ya se ve en la cajita del combo) ── */
tr.combos-regalo-fila-oculta {
	display: none !important;
}

/* ── Variación elegida en la tarjeta seleccionada ── */
.combo-regalo-card__variacion {
	font-size: 10px;
	font-weight: 700;
	color: #2e7d32;
	margin-top: 1px;
}

.combo-regalo-card__variacion::before {
	content: '✓ ';
}

/* ── Responsive: mobile en columna ── */
@media ( max-width: 600px ) {
	.combo-regalo-cards {
		flex-direction: column;
	}
	.combo-regalo-card,
	.combo-regalo-card--unico {
		width: 100%;
	}
	.combo-regalo-card__imagen {
		width: 36px;
		height: 36px;
	}
}

/* ================================================
   Popup de selección de variación (producto variable)
   ================================================ */

.combo-regalo-modal[hidden] {
	display: none;
}

.combo-regalo-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.combo-regalo-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.55 );
}

.combo-regalo-modal__dialog {
	position: relative;
	background: #fff;
	color: #222;
	width: 100%;
	max-width: 540px;
	max-height: calc( 100vh - 32px );
	overflow-y: auto;
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba( 0, 0, 0, 0.3 );
	padding: 26px 28px 20px;
	box-sizing: border-box;
	animation: combo-regalo-modal-in 0.18s ease;
}

@keyframes combo-regalo-modal-in {
	from { opacity: 0; transform: translateY( 8px ) scale( 0.98 ); }
	to   { opacity: 1; transform: none; }
}

.combo-regalo-modal__close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 32px;
	height: 32px;
	min-width: 0;
	padding: 0;
	margin: 0;
	border: none !important;
	background: none !important;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
	font-size: 26px;
	line-height: 1;
	color: #222;
	cursor: pointer;
	transition: color 0.15s ease;
}

.combo-regalo-modal__close:hover,
.combo-regalo-modal__close:focus,
.combo-regalo-modal__close:active {
	border: none !important;
	background: none !important;
	box-shadow: none !important;
	color: #d6006f !important; /* fucsia — solo la cruz, sin fondo */
	outline: none;
}

.combo-regalo-modal__body {
	margin-top: 4px;
	text-align: left;
}

/* ── Encabezado: imagen al lado del título + precio ── */
.combo-regalo-modal__header {
	display: flex;
	gap: 16px;
	align-items: center;
	margin-bottom: 14px;
}

.combo-regalo-modal__media {
	width: 88px;
	height: 88px;
	flex-shrink: 0;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

.combo-regalo-modal__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.combo-regalo-modal__titulo {
	flex: 1;
	min-width: 0;
}

.combo-regalo-modal__nombre {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 5px;
	line-height: 1.25;
	color: #1a1a1a;
}

.combo-regalo-modal__precio {
	font-size: 15px;
}

.combo-regalo-modal__precio del {
	color: #aaa;
	margin-right: 4px;
}

.combo-regalo-modal__desc {
	font-size: 14px;
	line-height: 1.5;
	color: #555;
	margin-bottom: 16px;
}

.combo-regalo-modal__desc p {
	margin: 0 0 8px;
}

.combo-regalo-modal__label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: #333;
}

.combo-regalo-modal__attr {
	display: block;
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.combo-regalo-modal__select {
	width: 100%;
	padding: 9px 10px;
	font-size: 14px;
	border: 1.5px solid #ccc;
	border-radius: 7px;
	background: #fff;
	color: #222;
	box-sizing: border-box;
}

.combo-regalo-modal__acciones {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 18px;
}

.combo-regalo-modal__quitar {
	border: none;
	background: transparent;
	color: #c62828;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	padding: 8px 4px;
	text-decoration: underline;
}

.combo-regalo-modal__quitar[hidden] {
	display: none;
}

.combo-regalo-modal__confirmar {
	margin-left: auto;
	border: none;
	background: #2e7d32;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	padding: 11px 22px;
	border-radius: 8px;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.combo-regalo-modal__confirmar:hover {
	background: #276b2b;
}

.combo-regalo-modal__confirmar:disabled {
	background: #bdbdbd;
	cursor: not-allowed;
}

@media ( max-width: 480px ) {
	.combo-regalo-modal__dialog {
		padding: 22px 18px 16px;
	}
	.combo-regalo-modal__header {
		gap: 12px;
		margin-bottom: 12px;
	}
	.combo-regalo-modal__media {
		width: 72px;
		height: 72px;
	}
	.combo-regalo-modal__nombre {
		font-size: 16px;
	}
	.combo-regalo-modal__desc {
		font-size: 13px;
	}
}
