/*
 * Popup de opciones: recorrido paso a paso sobre una superficie oscura.
 * Las variables viven en el modal para no filtrarse al resto del tema.
 */
.notiwoo-options-modal,
.notiwoo-options-toast {
	--nw-surface: #111827;
	--nw-panel: #1e2532;
	--nw-row: #1f2937;
	--nw-row-hover: #2b3543;
	--nw-row-active: #2563eb;
	--nw-text: #f8fafc;
	--nw-text-rgb: 248, 250, 252;
	--nw-muted: rgba(248, 250, 252, 0.66);
	--nw-line: rgba(248, 250, 252, 0.14);
	--nw-cta: #2563eb;
	--nw-cta-text: #ffffff;
	--nw-accent-rgb: 37, 99, 235;
	--nw-deep: #020306;
	--nw-deep-rgb: 2, 3, 6;
	--nw-danger: #ffb4a8;
	--nw-radius: 22px;
}

.notiwoo-options-modal[hidden],
.notiwoo-options-toast[hidden] {
	display: none !important;
}

body.notiwoo-options-open {
	overflow: hidden;
}

.notiwoo-options-modal {
	align-items: center;
	display: flex;
	inset: 0;
	justify-content: center;
	padding: 24px;
	position: fixed;
	z-index: 999999;
}

.notiwoo-options-modal__backdrop {
	background: rgba(var(--nw-deep-rgb), 0.78);
	inset: 0;
	position: absolute;
	backdrop-filter: blur(3px);
}

.notiwoo-options-dialog {
	background: var(--nw-surface);
	border-radius: var(--nw-radius);
	box-shadow: 0 30px 90px rgba(var(--nw-deep-rgb), 0.55);
	color: var(--nw-text);
	display: flex;
	flex-direction: column;
	max-height: min(860px, calc(100vh - 48px));
	max-width: 520px;
	overflow: hidden;
	position: relative;
	width: 100%;
	z-index: 1;
}

.notiwoo-options-dialog:focus,
.notiwoo-step:focus {
	outline: none;
}

.notiwoo-options-dialog__close {
	align-items: center;
	/* Flota sobre la foto, no sobre la superficie: contraste fijo. */
	background: rgba(0, 0, 0, 0.45);
	border: 0;
	border-radius: 999px;
	color: #ffffff;
	cursor: pointer;
	display: flex;
	font-size: 24px;
	height: 36px;
	justify-content: center;
	line-height: 1;
	padding: 0 0 3px;
	position: absolute;
	right: 14px;
	top: 14px;
	width: 36px;
	z-index: 4;
}

.notiwoo-options-dialog__close:hover {
	background: rgba(0, 0, 0, 0.66);
}

/* ---------- Hero ---------- */

.notiwoo-hero {
	position: relative;
}

.notiwoo-hero__media {
	aspect-ratio: 16 / 10;
	background: var(--nw-deep);
	display: block;
	overflow: hidden;
	position: relative;
	width: 100%;
}

.notiwoo-hero__media--empty {
	align-items: center;
	display: flex;
	justify-content: center;
}

.notiwoo-hero__initial {
	color: rgba(var(--nw-text-rgb), 0.3);
	font-size: 72px;
	font-weight: 800;
	line-height: 1;
}

.notiwoo-hero__image {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.notiwoo-hero__scrim {
	background: linear-gradient(to bottom, rgba(var(--nw-deep-rgb), 0) 34%, rgba(var(--nw-deep-rgb), 0.55) 66%, var(--nw-surface) 100%);
	inset: 0;
	position: absolute;
}

.notiwoo-hero__badge {
	background: rgba(0, 0, 0, 0.55);
	border-radius: 999px;
	color: #ffffff;
	font-size: 13px;
	font-weight: 700;
	padding: 6px 13px;
	position: absolute;
	right: 62px;
	top: 16px;
}

.notiwoo-hero__copy {
	align-items: flex-end;
	bottom: 0;
	display: flex;
	gap: 14px;
	justify-content: space-between;
	left: 0;
	padding: 0 20px 16px;
	position: absolute;
	right: 0;
}

.notiwoo-hero__title {
	color: var(--nw-text);
	font-size: clamp(21px, 4.4vw, 27px);
	font-weight: 800;
	letter-spacing: -0.01em;
	line-height: 1.15;
	margin: 0;
	min-width: 0;
	text-shadow: 0 2px 12px rgba(var(--nw-deep-rgb), 0.6);
}

.notiwoo-hero__price {
	color: var(--nw-text);
	font-size: clamp(18px, 3.6vw, 23px);
	font-weight: 800;
	text-shadow: 0 2px 12px rgba(var(--nw-deep-rgb), 0.6);
	white-space: nowrap;
}

/* ---------- Progreso ---------- */

.notiwoo-options-dialog__progress:not(:empty) {
	padding: 0 20px;
}

.notiwoo-progress__track {
	background: rgba(var(--nw-text-rgb), 0.16);
	border-radius: 999px;
	height: 4px;
	margin-top: 14px;
	overflow: hidden;
	width: 100%;
}

.notiwoo-progress__bar {
	background: var(--nw-cta);
	border-radius: inherit;
	display: block;
	height: 100%;
	transition: width 220ms ease;
}

/* ---------- Cuerpo del paso ---------- */

.notiwoo-options-dialog__body {
	overflow-y: auto;
	padding: 18px 20px 6px;
	scrollbar-gutter: stable;
}

.notiwoo-step__description {
	color: var(--nw-text);
	font-size: 15px;
	line-height: 1.5;
	margin: 0 0 20px;
	opacity: 0.92;
}

.notiwoo-step__title {
	color: var(--nw-muted);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
	margin: 0 0 4px;
	padding-left: 2px;
}

.notiwoo-step__rule {
	color: var(--nw-muted);
	font-size: 12px;
	margin: 0 0 10px;
	padding-left: 2px;
}

.notiwoo-choices {
	display: grid;
	gap: 8px;
	margin-top: 10px;
}

.notiwoo-choice-wrap {
	min-width: 0;
	position: relative;
}

.notiwoo-choice__input {
	height: 1px;
	left: 14px;
	opacity: 0;
	position: absolute;
	top: 50%;
	width: 1px;
}

.notiwoo-choice {
	align-items: center;
	background: var(--nw-row);
	border: 1px solid transparent;
	border-radius: 13px;
	box-sizing: border-box;
	color: var(--nw-text);
	cursor: pointer;
	display: flex;
	font: inherit;
	gap: 10px;
	justify-content: space-between;
	min-height: 56px;
	padding: 13px 16px;
	text-align: left;
	transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
	width: 100%;
}

.notiwoo-choice:hover {
	background: var(--nw-row-hover);
}

/* La fila elegida se pinta con el color de marca, así que su texto usa el
   contraste calculado para ese color y no el del fondo del popup. */
.notiwoo-choice.is-selected,
.notiwoo-choice.is-selected .notiwoo-choice__price {
	background: var(--nw-row-active);
	border-color: rgba(var(--nw-text-rgb), 0.35);
	color: var(--nw-cta-text);
}

.notiwoo-choice.is-selected .notiwoo-choice__price {
	background: none;
	border: 0;
}

.notiwoo-choice__name {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	margin-right: auto;
	min-width: 0;
}

.notiwoo-choice__price {
	color: var(--nw-text);
	font-size: 14px;
	font-weight: 600;
	opacity: 0.86;
	white-space: nowrap;
}

.notiwoo-choice__check {
	display: block;
	flex: 0 0 auto;
	height: 16px;
	position: relative;
	width: 16px;
}

.notiwoo-choice.is-selected .notiwoo-choice__check::after {
	border-bottom: 2.5px solid var(--nw-cta-text);
	border-right: 2.5px solid var(--nw-cta-text);
	content: "";
	height: 13px;
	left: 4px;
	position: absolute;
	top: 0;
	transform: rotate(45deg);
	width: 7px;
}

.notiwoo-choice__input:focus-visible + .notiwoo-choice,
.notiwoo-options-dialog button:focus-visible,
.notiwoo-options-dialog textarea:focus-visible {
	outline: 3px solid rgba(var(--nw-text-rgb), 0.55);
	outline-offset: 2px;
}

.notiwoo-choice__input:disabled + .notiwoo-choice {
	cursor: not-allowed;
	opacity: 0.42;
}

.notiwoo-step.has-error .notiwoo-choices {
	border-radius: 15px;
	box-shadow: 0 0 0 2px var(--nw-danger);
}

.notiwoo-step__error {
	color: var(--nw-danger);
	font-size: 13px;
	font-weight: 600;
	margin: 10px 0 0;
}

/* ---------- Paso final: nota, cantidad y resumen ---------- */

.notiwoo-options-comments__label {
	display: none;
}

.notiwoo-options-comments__input {
	background: var(--nw-panel);
	border: 1px solid var(--nw-line);
	border-radius: 13px;
	box-sizing: border-box;
	color: var(--nw-text);
	font: inherit;
	font-size: 15px;
	padding: 13px 15px;
	resize: vertical;
	width: 100%;
}

.notiwoo-options-comments__input::placeholder {
	color: var(--nw-muted);
}

.notiwoo-quantity-field {
	align-items: center;
	display: flex;
	justify-content: space-between;
	margin-top: 16px;
}

.notiwoo-quantity-field__label {
	color: var(--nw-text);
	font-size: 15px;
	font-weight: 600;
}

.notiwoo-quantity {
	align-items: center;
	background: var(--nw-panel);
	border: 1px solid var(--nw-line);
	border-radius: 999px;
	display: flex;
	height: 44px;
	overflow: hidden;
}

.notiwoo-quantity__button {
	background: transparent;
	border: 0;
	color: var(--nw-text);
	cursor: pointer;
	font-size: 20px;
	height: 100%;
	padding: 0;
	width: 42px;
}

.notiwoo-quantity__button:hover:not(:disabled) {
	background: rgba(var(--nw-text-rgb), 0.1);
}

.notiwoo-quantity__button:disabled {
	cursor: not-allowed;
	opacity: 0.35;
}

.notiwoo-quantity__value {
	color: var(--nw-text);
	font-size: 15px;
	font-weight: 700;
	min-width: 30px;
	text-align: center;
}

.notiwoo-summary {
	background: var(--nw-panel);
	border-radius: 15px;
	margin-top: 18px;
	padding: 14px 16px;
}

.notiwoo-summary__title {
	color: var(--nw-muted);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	margin: 0 0 8px;
	text-transform: uppercase;
}

.notiwoo-summary__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.notiwoo-summary__row {
	color: var(--nw-text);
	display: flex;
	font-size: 14px;
	gap: 12px;
	justify-content: space-between;
	padding: 4px 0;
}

.notiwoo-summary__label {
	min-width: 0;
}

.notiwoo-summary__price {
	color: var(--nw-muted);
	white-space: nowrap;
}

.notiwoo-summary__total {
	border-top: 1px solid var(--nw-line);
	display: flex;
	font-size: 15px;
	justify-content: space-between;
	margin-top: 10px;
	padding-top: 10px;
}

/* ---------- Estado y pie ---------- */

.notiwoo-options-dialog__status {
	color: var(--nw-muted);
	font-size: 13px;
	padding: 0 20px;
}

.notiwoo-options-dialog__status:not(:empty) {
	padding-bottom: 6px;
	padding-top: 6px;
}

.notiwoo-options-dialog__status.is-error {
	color: var(--nw-danger);
	font-weight: 600;
}

.notiwoo-options-dialog__footer {
	align-items: center;
	display: flex;
	gap: 12px;
	justify-content: space-between;
	padding: 12px 20px 20px;
}

.notiwoo-nav {
	align-items: center;
	background: var(--nw-row);
	border: 0;
	border-radius: 999px;
	color: var(--nw-text);
	cursor: pointer;
	display: flex;
	flex: 0 0 auto;
	height: 52px;
	justify-content: center;
	padding: 0;
	transition: background 140ms ease, opacity 140ms ease;
	width: 52px;
}

.notiwoo-nav:hover:not(:disabled) {
	background: var(--nw-row-hover);
}

.notiwoo-nav:disabled {
	cursor: not-allowed;
	opacity: 0.3;
}

.notiwoo-nav__icon {
	font-size: 28px;
	line-height: 1;
	margin-top: -3px;
}

.notiwoo-cta {
	background: var(--nw-cta);
	border: 0;
	border-radius: 999px;
	color: var(--nw-cta-text);
	cursor: pointer;
	flex: 1 1 auto;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	min-height: 52px;
	min-width: 0;
	padding: 12px 18px;
	transition: transform 140ms ease, opacity 140ms ease;
}

.notiwoo-cta:hover:not(:disabled) {
	transform: translateY(-1px);
}

.notiwoo-cta:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

/* ---------- Carga y error ---------- */

.notiwoo-options-loading,
.notiwoo-options-error-state {
	align-items: center;
	color: var(--nw-muted);
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 300px;
	padding: 32px;
	text-align: center;
}

.notiwoo-options-error-state strong {
	color: var(--nw-text);
	font-size: 17px;
}

.notiwoo-options-retry {
	background: var(--nw-cta);
	border: 0;
	border-radius: 999px;
	color: var(--nw-cta-text);
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	margin-top: 14px;
	padding: 11px 22px;
}

.notiwoo-options-spinner {
	animation: notiwoo-spin 800ms linear infinite;
	border: 3px solid rgba(var(--nw-text-rgb), 0.22);
	border-radius: 999px;
	border-top-color: var(--nw-cta);
	height: 34px;
	width: 34px;
}

/* ---------- Disparadores del catálogo ---------- */

.notiwoo-card-trigger {
	cursor: pointer;
}

.notiwoo-single-product-marker {
	display: none;
	margin-bottom: 14px;
}

.notiwoo-extras-ready .notiwoo-single-product-marker {
	display: block;
}

.notiwoo-extras-ready .notiwoo-single-product-marker + form.cart {
	display: none !important;
}

.notiwoo-single-options-trigger {
	min-height: 48px;
	width: 100%;
}

.notiwoo-options-toast {
	background: var(--nw-surface);
	border-radius: 999px;
	bottom: 24px;
	box-shadow: 0 12px 34px rgba(var(--nw-deep-rgb), 0.4);
	color: var(--nw-text);
	font-size: 14px;
	font-weight: 600;
	left: 50%;
	max-width: calc(100vw - 32px);
	padding: 12px 20px;
	position: fixed;
	transform: translateX(-50%);
	z-index: 1000000;
}

@keyframes notiwoo-spin {
	to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
	.notiwoo-options-modal {
		align-items: flex-end;
		padding: 0;
	}

	.notiwoo-options-dialog {
		border-radius: var(--nw-radius) var(--nw-radius) 0 0;
		max-height: 94vh;
		max-width: none;
	}

	.notiwoo-hero__media {
		aspect-ratio: 16 / 9;
	}

	.notiwoo-options-dialog__body {
		padding: 16px 16px 4px;
	}

	.notiwoo-options-dialog__progress:not(:empty),
	.notiwoo-options-dialog__status {
		padding-left: 16px;
		padding-right: 16px;
	}

	.notiwoo-options-dialog__footer {
		gap: 10px;
		padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
	}

	.notiwoo-nav {
		height: 48px;
		width: 48px;
	}

	.notiwoo-cta {
		min-height: 48px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.notiwoo-choice,
	.notiwoo-cta,
	.notiwoo-nav,
	.notiwoo-progress__bar {
		transition: none;
	}

	.notiwoo-options-spinner {
		animation-duration: 1.6s;
	}
}
