/* ==========================================================================
   Zorrito Verde – Personalizador
   Cambia --zvp-accent para adaptar el color a la web.
   ========================================================================== */

.zvp-customizer,
.zvp-sheet {
	--zvp-accent: #34a065;
	--zvp-accent-soft: rgba(52, 160, 101, .1);
	--zvp-text: #1d1d1f;
	--zvp-muted: #6e6e73;
	--zvp-line: rgba(0, 0, 0, .08);
	--zvp-surface: #f5f5f7;
	--zvp-control: #fff;
	--zvp-error: #d70015;
	--zvp-focus: #0071e3;
	color: var(--zvp-text);
	-webkit-font-smoothing: antialiased;
}

.zvp-customizer *,
.zvp-customizer *::before,
.zvp-customizer *::after,
.zvp-sheet *,
.zvp-sheet *::before,
.zvp-sheet *::after {
	box-sizing: border-box;
}

/* --- El formulario del tema suele ser una fila flex: el personalizador va arriba a todo el ancho --- */
.zvp-has-customizer form.cart,
.zvp-has-customizer .woocommerce-variation-add-to-cart {
	flex-wrap: wrap !important;
}

.zvp-customizer {
	flex: 0 0 100% !important;
	order: -1;
	grid-column: 1 / -1;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 0 20px !important;
	float: none !important;
}

.zvp-card {
	container-type: inline-size;
	background: var(--zvp-surface);
	border-radius: 18px;
	padding: 20px;
}

.zvp-card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 14px;
}

.zvp-card-head .zvp-title {
	margin: 0 !important;
}

/* Botón "Limpiar" */
.zvp-clear {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	flex: 0 0 auto;
	padding: 5px 11px;
	border-radius: 999px;
	background: var(--zvp-control);
	box-shadow: 0 0 0 1px var(--zvp-line);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--zvp-muted);
	cursor: pointer;
	user-select: none;
	transition: color .2s, box-shadow .2s;
	-webkit-tap-highlight-color: transparent;
}

.zvp-clear:hover {
	color: var(--zvp-text);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .2);
}

.zvp-clear:focus-visible {
	outline: 2px solid var(--zvp-focus);
	outline-offset: 2px;
}

.zvp-clear[hidden] {
	display: none !important;
}

.zvp-clear:not([hidden]) {
	animation: zvp-fade .2s ease;
}

/* Aviso al marcar "Sí" (ej. el bordado se concreta por WhatsApp) */
.zvp-note {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 12px 0 0 !important;
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--zvp-accent-soft);
	font-size: 13px;
	line-height: 1.4;
	color: var(--zvp-text);
}

.zvp-note svg {
	flex: 0 0 auto;
	margin-top: 1px;
	color: var(--zvp-accent);
}

.zvp-title {
	margin: 0 0 14px !important;
	padding: 0;
	font-size: 21px !important;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -.02em;
	color: var(--zvp-text);
}

/* --- Rejilla de secciones: 1 columna, 2 cuando hay sitio --- */
.zvp-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
}

@container (min-width: 420px) {
	.zvp-grid {
		grid-template-columns: 1fr 1fr;
		grid-auto-flow: row dense; /* rellena huecos: ninguna tarjeta queda sola si hay sitio a su lado */
	}

	.zvp-tile-wide {
		grid-column: 1 / -1;
	}
}

.zvp-tile {
	position: relative;
	min-width: 0;
	padding: 14px;
	background: var(--zvp-control);
	border-radius: 14px;
	box-shadow: 0 0 0 1px var(--zvp-line);
	transition: box-shadow .2s;
}

.zvp-tile-head {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 10px;
}

.zvp-label {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -.01em;
}

.zvp-label-price {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	font-weight: 400;
	color: var(--zvp-muted);
}

/* Check verde junto al nombre cuando la sección está completa */
.zvp-tile-head::after {
	content: "";
	width: 18px;
	height: 18px;
	margin-left: auto;
	flex: 0 0 18px;
	border-radius: 50%;
	background: var(--zvp-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 3.5L11 1.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat;
	transform: scale(0);
	transition: transform .2s cubic-bezier(.3, 1.5, .6, 1);
}

.zvp-section.is-done .zvp-tile-head::after {
	transform: scale(1);
}

.zvp-help {
	margin: -4px 0 10px !important;
	font-size: 13px;
	line-height: 1.4;
	color: var(--zvp-muted);
}

.zvp-customizer input[type="radio"],
.zvp-customizer input[type="checkbox"] {
	position: absolute !important;
	opacity: 0 !important;
	width: 1px !important;
	height: 1px !important;
	margin: 0 !important;
	pointer-events: none;
}

.zvp-customizer label {
	margin: 0;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

/* --- Selector de tela (abre la ventana) --- */
.zvp-picker {
	all: unset;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 60px;
	padding: 8px 12px 8px 8px;
	background: var(--zvp-surface);
	border-radius: 12px;
	box-shadow: inset 0 0 0 1px transparent;
	color: var(--zvp-text);
	cursor: pointer;
	text-align: left;
	font: inherit;
	transition: box-shadow .2s, background .2s;
	-webkit-tap-highlight-color: transparent;
}

.zvp-picker:hover {
	background: #ececf0;
}

.zvp-picker:focus-visible {
	outline: 2px solid var(--zvp-focus);
	outline-offset: 2px;
}

.zvp-picker-thumb {
	position: relative;
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .12);
}

/* Sin tela: icono de "+" */
.zvp-picker-thumb:empty::before,
.zvp-picker-thumb:empty::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 2px;
	border-radius: 2px;
	background: var(--zvp-muted);
	transform: translate(-50%, -50%);
}

.zvp-picker-thumb:empty::after {
	transform: translate(-50%, -50%) rotate(90deg);
}

.zvp-picker-thumb img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	margin: 0 !important;
	object-fit: cover;
}

.zvp-picker-text {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}

.zvp-picker-value {
	font-size: 15px;
	font-weight: 500;
	line-height: 1.25;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.zvp-picker-meta {
	font-size: 12px;
	line-height: 1.3;
	color: var(--zvp-muted);
}

.zvp-chevron {
	flex: 0 0 auto;
	color: #aeaeb2;
}

/* Tela elegida: bien visible */
.zvp-picker.is-selected {
	background: var(--zvp-accent-soft);
	box-shadow: inset 0 0 0 2px var(--zvp-accent);
}

.zvp-picker.is-selected .zvp-picker-meta {
	color: var(--zvp-accent);
	font-weight: 500;
}

.zvp-picker.is-selected .zvp-picker-thumb {
	box-shadow: none;
}

/* --- Opciones (tallas): chips --- */
.zvp-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.zvp-chip {
	flex: 0 0 auto;
	min-width: 64px;
}

.zvp-chip > span {
	white-space: nowrap;
	padding-left: 14px !important;
	padding-right: 14px !important;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 6px 8px;
	background: var(--zvp-surface);
	border-radius: 10px;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	text-align: center;
	transition: background .2s, color .2s, box-shadow .2s;
}

.zvp-chip small {
	font-size: 11px;
	font-weight: 400;
	opacity: .75;
}

/* Opciones dentro de una sección Sí/No (ej. tamaños de bordado): cuadrícula igualada que cabe en media columna */
.zvp-reveal .zvp-chips {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
	gap: 6px;
}

.zvp-reveal .zvp-chip {
	min-width: 0;
}

.zvp-reveal .zvp-chip > span {
	min-height: 48px;
	padding: 6px 4px !important;
	font-size: 14px;
	white-space: normal;
}

/* Los precios de WooCommerce llevan varias etiquetas dentro (importe, símbolo): siempre en una línea */
.zvp-customizer small {
	white-space: nowrap;
}

.zvp-customizer small * {
	display: inline !important;
	white-space: nowrap;
	font: inherit;
	color: inherit;
}

.zvp-chip:hover > span {
	background: #ececf0;
}

.zvp-chip input:checked + span {
	background: var(--zvp-accent);
	color: #fff;
	box-shadow: 0 2px 8px rgba(52, 160, 101, .35);
}

.zvp-chip input:focus-visible + span {
	outline: 2px solid var(--zvp-focus);
	outline-offset: 2px;
}

/* --- Sí / No: interruptor estilo iOS --- */
.zvp-switch-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 32px;
}

.zvp-switch {
	position: relative;
	flex: 0 0 51px;
	width: 51px;
	height: 31px;
	border-radius: 31px;
	background: #e9e9ea;
	transition: background .25s;
}

.zvp-switch::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 27px;
	height: 27px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .06);
	transition: transform .25s cubic-bezier(.3, 1.2, .6, 1);
}

.zvp-switch-input:checked + .zvp-switch {
	background: var(--zvp-accent);
}

.zvp-switch-input:checked + .zvp-switch::after {
	transform: translateX(20px);
}

.zvp-switch-input:focus-visible + .zvp-switch {
	outline: 2px solid var(--zvp-focus);
	outline-offset: 2px;
}

.zvp-type-toggle .zvp-help {
	margin: 6px 0 0 !important;
}

.zvp-reveal {
	margin-top: 12px;
}

.zvp-reveal:not([hidden]) {
	animation: zvp-fade .25s ease;
}

@keyframes zvp-fade {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: none; }
}

/* --- Resumen y errores --- */
.zvp-extras {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	margin-top: 14px;
	padding: 0 4px;
	font-size: 14px;
	color: var(--zvp-muted);
}

.zvp-extras strong {
	font-size: 15px;
	font-weight: 600;
	color: var(--zvp-text);
}

.zvp-extras[hidden],
.zvp-error[hidden],
.zvp-reveal[hidden],
.zvp-sheet[hidden],
.zvp-sheet [hidden] {
	display: none !important;
}

.zvp-error {
	margin: 14px 0 0 !important;
	padding: 12px 14px;
	border-radius: 12px;
	background: #fff0f1;
	color: var(--zvp-error);
	font-size: 14px;
}

.zvp-section.zvp-has-error {
	box-shadow: 0 0 0 2px var(--zvp-error);
}

.zvp-section.zvp-has-error .zvp-label {
	color: var(--zvp-error);
}

/* ==========================================================================
   Ventana de telas
   ========================================================================== */

html.zvp-lock,
html.zvp-lock body {
	overflow: hidden !important;
}

.zvp-sheet {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	font-family: inherit;
}

.zvp-sheet-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .35);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	opacity: 0;
	transition: opacity .25s;
}

.zvp-sheet-panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 640px;
	max-height: min(720px, 100%);
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
	overflow: hidden;
	opacity: 0;
	transform: scale(.96) translateY(8px);
	transition: opacity .25s, transform .25s cubic-bezier(.2, .9, .3, 1);
}

.zvp-sheet.is-open .zvp-sheet-backdrop {
	opacity: 1;
}

.zvp-sheet.is-open .zvp-sheet-panel {
	opacity: 1;
	transform: none;
}

.zvp-sheet-grabber {
	display: none;
}

.zvp-sheet-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px 12px;
}

.zvp-sheet-title {
	margin: 0 !important;
	font-size: 19px !important;
	font-weight: 600;
	letter-spacing: -.02em;
	color: var(--zvp-text);
}

.zvp-sheet-close {
	all: unset;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--zvp-surface);
	color: var(--zvp-muted);
	cursor: pointer;
}

.zvp-sheet-close:hover {
	background: #e8e8ed;
	color: var(--zvp-text);
}

.zvp-sheet-close:focus-visible {
	outline: 2px solid var(--zvp-focus);
	outline-offset: 2px;
}

.zvp-sheet-tools {
	padding: 0 20px 12px;
	border-bottom: 1px solid var(--zvp-line);
}

.zvp-search {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 12px;
	background: var(--zvp-surface);
	border-radius: 10px;
	color: var(--zvp-muted);
	cursor: text;
}

.zvp-search input {
	all: unset;
	flex: 1;
	min-width: 0;
	height: 100%;
	font: inherit;
	font-size: 16px; /* evita el zoom automático en iPhone */
	color: var(--zvp-text);
}

.zvp-search input::placeholder {
	color: var(--zvp-muted);
}

.zvp-search:focus-within {
	box-shadow: 0 0 0 2px var(--zvp-focus);
}

.zvp-filters {
	display: flex;
	gap: 6px;
	margin-top: 10px;
	overflow-x: auto;
	scrollbar-width: none;
}

.zvp-filters::-webkit-scrollbar {
	display: none;
}

.zvp-filter {
	all: unset;
	flex: 0 0 auto;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--zvp-surface);
	font-size: 13px;
	font-weight: 500;
	color: var(--zvp-text);
	cursor: pointer;
	white-space: nowrap;
}

.zvp-filter.is-active {
	background: var(--zvp-text);
	color: #fff;
}

.zvp-filter:focus-visible {
	outline: 2px solid var(--zvp-focus);
	outline-offset: 2px;
}

.zvp-sheet-body {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 16px 20px 24px;
}

.zvp-sheet-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
	gap: 16px 12px;
}

.zvp-opt {
	all: unset;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	min-width: 0;
	cursor: pointer;
	text-align: center;
	-webkit-tap-highlight-color: transparent;
}

.zvp-opt-img {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	border-radius: 14px;
	overflow: hidden;
	background: var(--zvp-surface);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
	transition: box-shadow .2s, transform .2s;
}

.zvp-opt-img img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	margin: 0 !important;
	object-fit: cover;
}

.zvp-opt:hover .zvp-opt-img {
	transform: scale(1.03);
}

.zvp-opt:focus-visible .zvp-opt-img {
	box-shadow: 0 0 0 3px var(--zvp-focus);
}

.zvp-opt-check {
	position: absolute;
	top: 6px;
	right: 6px;
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--zvp-accent);
	color: #fff;
	box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, .2);
	transform: scale(0);
	transition: transform .2s cubic-bezier(.3, 1.5, .6, 1);
}

.zvp-opt-name {
	margin-top: 6px;
	font-size: 13px;
	line-height: 1.25;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.zvp-opt-price {
	font-size: 12px;
	color: var(--zvp-muted);
}

.zvp-opt.is-selected .zvp-opt-img {
	box-shadow: 0 0 0 3px var(--zvp-accent);
	transform: none;
}

.zvp-opt.is-selected .zvp-opt-check {
	transform: scale(1);
}

.zvp-opt.is-selected .zvp-opt-name {
	font-weight: 600;
	color: var(--zvp-accent);
}

.zvp-sheet-empty {
	margin: 24px 0 !important;
	text-align: center;
	color: var(--zvp-muted);
	font-size: 14px;
}

/* --- Móvil: panel que sube desde abajo --- */
@media (max-width: 600px) {
	.zvp-card {
		padding: 16px 12px 12px;
		border-radius: 16px;
	}

	.zvp-title {
		font-size: 19px !important;
		padding: 0 4px;
	}

	/* Tarjetas más compactas para que muchas secciones no alarguen la página */
	.zvp-grid {
		gap: 8px;
	}

	.zvp-tile {
		padding: 10px 10px 10px 12px;
		border-radius: 12px;
	}

	.zvp-tile-head {
		margin-bottom: 8px;
	}

	.zvp-picker {
		min-height: 52px;
		padding: 6px 10px 6px 6px;
		border-radius: 10px;
	}

	.zvp-picker-thumb {
		flex-basis: 40px;
		width: 40px;
		height: 40px;
		border-radius: 8px;
	}

	.zvp-chip > span {
		min-height: 40px;
	}

	.zvp-sheet {
		align-items: flex-end;
		padding: 0;
	}

	.zvp-sheet-panel {
		max-width: none;
		height: 88vh;
		height: 88dvh;
		max-height: none;
		border-radius: 20px 20px 0 0;
		transform: translateY(100%);
		opacity: 1;
		transition: transform .3s cubic-bezier(.2, .9, .3, 1);
	}

	.zvp-sheet-grabber {
		display: block;
		width: 36px;
		height: 5px;
		margin: 8px auto 0;
		border-radius: 3px;
		background: #d1d1d6;
	}

	.zvp-sheet-header {
		padding: 10px 16px 10px;
	}

	.zvp-sheet-tools {
		padding: 0 16px 12px;
	}

	.zvp-sheet-body {
		padding: 14px 16px calc(24px + env(safe-area-inset-bottom));
	}

	.zvp-sheet-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 14px 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.zvp-customizer *,
	.zvp-sheet * {
		transition: none !important;
		animation: none !important;
	}
}
