/* Maderia Configurator Fase 1 */
.pw-configurator {
	max-width: 1080px;
	margin: 2.5rem auto;
	font-family: inherit;
}

.pw-cfg-title {
	margin: 0 0 .25rem;
	font-size: var(--wp--preset--font-size--x-large, 1.8rem);
}

.pw-cfg-sub {
	margin: 0 0 2rem;
	opacity: .8;
	max-width: 60ch;
}

.pw-preview {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;
	background: var(--wp--preset--color--base-2, #faf7f2);
	border: 1px solid rgba(0,0,0,.08);
	border-radius: 12px;
	padding: 1rem 1.25rem;
	margin-bottom: 2rem;
}

.pw-preview-photo { width: 88px; height: 88px; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #fff; }
.pw-preview-photo.pw-empty { display: none; }
.pw-preview-photo img { width: 100%; height: 100%; object-fit: cover; }
.pw-preview-caption { flex: 1 1 auto; min-width: 180px; font-weight: 600; }
.pw-preview-shape { flex: 0 0 auto; }
.pw-preview-table { width: 140px; max-width: 140px; height: auto; border: 2px solid var(--wp--preset--color--contrast-2, #303030); border-radius: 4px; background: #fffbea; display: flex; align-items: center; justify-content: center; padding: 18px; text-align: center; color: #555; }
.pw-preview-table[data-shape="large"] { border-radius: 8px; }
.pw-preview-dims { font-size: .8rem; }

/* ---------------------------------------------------------------
   Asistente de pasos
   Un paso a la vez. Con todos visibles, un producto calculado deja
   la pantalla llena de bloques y huecos; así solo se ve el que toca.

   La caja reserva una parte del alto (lo mide la JavaScript al arrancar
   y al cambiar el ancho): lo justo para que los pasos que se parecen no
   hagan saltar el botón de Continuar. No reserva el paso más alto
   entero —con un paso de dos tarjetas y otro de rejilla, eso dejaba un
   hueco enorme y el botón al final de la pantalla— sino como mucho lo
   que necesita el paso actual más un margen.
   --------------------------------------------------------------- */

.pw-flow-panels {
	position: relative;
	transition: min-height .25s ease;
}

.pw-step[hidden] { display: none; }

/* Medición: fuera de flujo para no empujar nada mientras se calcula. */
.pw-step.is-midiendo {
	position: absolute !important;
	visibility: hidden !important;
	pointer-events: none !important;
	left: 0;
	right: 0;
}

/* Entrada de cada paso. Solo opacidad: animar la altura a la vez que
   el ancho reservado haría que el texto saltara a media transición, y
   la animación se repite sola porque la clase se quita y se vuelve a
   poner en cada cambio de paso. */
@keyframes pw-step-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

.pw-step.is-active { animation: pw-step-in .28s ease both; }

.pw-flow {
	list-style: none;
	margin: 0 0 1.25rem;
	padding: 0;
	display: grid;
	gap: .55rem;
}

.pw-flowbar {
	grid-column: 1 / -1;
	height: 3px;
	border-radius: 99px;
	background: rgba(0,0,0,.1);
	overflow: hidden;
}

.pw-flowbar-fill {
	display: block;
	height: 100%;
	width: 25%;
	border-radius: 99px;
	background: var(--wp--preset--color--accent, #a67c3d);
	transition: width .3s ease;
}

.pw-flownav {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.pw-flowcount {
	font-size: .78rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	opacity: .6;
	font-variant-numeric: tabular-nums;
}

.pw-flownav .pw-flowback {
	background: none;
	border: 1px solid rgba(0,0,0,.18);
	border-radius: 8px;
	padding: .4rem .85rem;
	font-size: .85rem;
	cursor: pointer;
}

.pw-flownav .pw-flownext,
.pw-flownav-foot .pw-flownext {
	background: var(--wp--preset--color--accent, #a67c3d);
	color: #fff;
	border: 0;
	border-radius: 8px;
	padding: .5rem 1.1rem;
	font-size: .88rem;
	font-weight: 600;
	cursor: pointer;
	margin-left: auto;
}

/* Continuar apagado mientras el paso esté a medias. */
.pw-flownext[disabled],
.pw-flownext.disabled { opacity: .4; cursor: not-allowed; }

/* El resumen solo aparece en el último paso. */
.pw-summary { display: none; }
.pw-summary.is-last { display: block; }

@media (min-width: 720px) {
	.pw-summary.is-last { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem 1.25rem; align-items: center; }
}

/* En el último paso no hace falta un botón "Continuar": ya no hay a
   dónde ir, y el resumen con su botón de carrito ocupa ese lugar. */
.pw-flownav-foot.is-last { display: none; }

@media (prefers-reduced-motion: reduce) {
	.pw-flowbar-fill { transition: none; }
	.pw-flow-panels { transition: none; }
	/* Nada de fundidos: con movimiento reducido se cambia de pantalla
	   de golpe, que es justo lo que se pidió. */
	.pw-step.is-active { animation: none; }
}

/* --------------------------------------------------------------- */

.pw-step {
	border: 1px solid rgba(0,0,0,.1);
	border-radius: 12px;
	padding: 1.25rem 1.5rem 1.5rem;
	margin: 0 0 1.5rem;
}

/* Los subgrupos (armado, forma, canto, base) viven dentro del mismo
   paso: no llevan caja propia porque no son un paso del recorrido. */
.pw-step--inline { margin-bottom: 0; border: 0; padding: 0; }

.pw-step legend {
	font-weight: 700;
	font-size: 1.1rem;
	padding: 0 .5rem;
}

.pw-step-help { margin: .25rem 0 1rem; opacity: .75; }
.pw-step-sub { font-size: 1rem; margin: 1.25rem 0 .6rem; }

.pw-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
	gap: 10px;
}

.pw-grid + .pw-step-sub { margin-top: 1.5rem; }

.pw-opt {
	position: relative;
	display: block;
	cursor: pointer;
	border: 1px solid rgba(0,0,0,.12);
	border-radius: 10px;
	padding: 8px;
	overflow: hidden;
	text-align: center;
	background: #fff;
	transition: box-shadow .12s ease, border-color .12s ease;
}

.pw-opt img, .pw-opt .pw-ph-fallback { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; display: block; }
.pw-opt .pw-ph-fallback { display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: #9a7b4f; background: #f4ecde; }
.pw-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pw-opt-name { display: block; margin-top: 6px; font-size: .85rem; font-weight: 600; line-height: 1.25; }
.pw-opt-desc { display: block; margin-top: 2px; font-size: .75rem; opacity: .7; line-height: 1.3; }

.pw-opt:hover { border-color: var(--wp--preset--color--accent, #a67c3d); }
.pw-opt.pw-selected { border-color: var(--wp--preset--color--contrast, #000); box-shadow: 0 0 0 2px rgba(0,0,0,.12); }
.pw-opt.pw-disabled { opacity: .42; cursor: not-allowed; filter: grayscale(1); }

/* ---------------------------------------------------------------
   Mesa de oficina: tarjetas de madera y grosor, ejes de medidas y
   el resumen de la cuarta pantalla.
   --------------------------------------------------------------- */

.pw-is-tarifario .pw-step { padding: 1.5rem 1.75rem 1.75rem; }

.pw-grid-tarifa { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }

/* Tarjeta con foto: la foto manda en el ancho para que las dos
   maderas se comparen en igualdad de condiciones. */
.pw-opt-tarifa { padding: 0; text-align: left; }
.pw-opt-media { display: block; background: #f4ecde; }
.pw-opt-media img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 9px 9px 0 0; }
.pw-opt-nofoto { display: block; height: 10px; }
.pw-opt-body { display: block; padding: .7rem .85rem .85rem; }
.pw-opt-tarifa .pw-opt-name { margin-top: 0; font-size: 1rem; }
.pw-opt-tarifa .pw-opt-desc { font-size: .8rem; margin-top: .2rem; }

/* Los grosores no llevan foto: son dos cifras y una frase. La cifra
   va en grande porque es el dato, no un nombre de opción. */
.pw-grid-grosores { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pw-opt-grosor { display: flex; align-items: center; gap: .9rem; text-align: left; padding: 1rem; }
.pw-grosor-cifra { flex: 0 0 auto; display: flex; align-items: baseline; gap: .2rem; }
.pw-grosor-num { font-size: 1.9rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.pw-grosor-unit { font-size: .8rem; opacity: .7; }
.pw-opt-grosor .pw-opt-body { padding: 0; }
.pw-opt-grosor .pw-opt-name { margin-top: 0; }

/* Medidas: dos listas de cifras, una por eje. */
.pw-axes { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }

@media (min-width: 700px) {
	.pw-axes { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}

.pw-axis { border: 0; padding: 0; margin: 0; min-width: 0; }
.pw-axis legend { font-weight: 700; font-size: .95rem; padding: 0 0 .5rem; }
.pw-axis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; }

.pw-axis-opt {
	position: relative;
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: .15rem;
	padding: .7rem .25rem;
	border: 1px solid rgba(0,0,0,.12);
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
	transition: border-color .12s ease, box-shadow .12s ease, opacity .12s ease;
}

.pw-axis-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pw-axis-val { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pw-axis-unit { font-size: .72rem; opacity: .65; }
.pw-axis-opt:hover { border-color: var(--wp--preset--color--accent, #a67c3d); }
.pw-axis-opt.pw-selected { border-color: var(--wp--preset--color--contrast, #000); box-shadow: 0 0 0 2px rgba(0,0,0,.12); }
.pw-axis-opt.pw-disabled { opacity: .35; cursor: not-allowed; background: #f6f6f4; }

.pw-medidas-aviso {
	margin: .9rem 0 0;
	font-size: .85rem;
	color: #8a5a1b;
	background: #fdf5e6;
	border-radius: 8px;
	padding: .5rem .7rem;
}

.pw-medidas-aviso[hidden] { display: none; }

/* Cuarta pantalla: la pieza elegida y su precio. */
.pw-step-resumen { border-color: rgba(0,0,0,.14); background: var(--wp--preset--color--base-2, #faf7f2); }
.pw-resumen-title { margin: 0 0 1rem; font-size: 1.25rem; }
.pw-resumen-datos { margin: 0 0 1rem; display: grid; gap: .4rem; }
.pw-resumen-fila { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .4rem; border-bottom: 1px dashed rgba(0,0,0,.12); }
.pw-resumen-fila dt { font-weight: 600; }
.pw-resumen-fila dd { margin: 0; text-align: right; }
.pw-total-resumen { font-size: 1.4rem; padding-top: .75rem; }
.pw-precio-nota { font-size: .82rem; opacity: .75; margin: .5rem 0 1rem; }
.pw-leadtime-aviso { color: #8a5a1b; }
.pw-leadtime[hidden], .pw-leadtime-aviso[hidden] { display: none; }

.pw-measures { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem 1.5rem; }
.pw-measure label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: .35rem; }
.pw-measure input[type="range"] { width: 100%; accent-color: var(--wp--preset--color--accent, #a67c3d); }
.pw-measure input[type="number"] { width: 96px; padding: .45rem .6rem; border: 1px solid rgba(0,0,0,.2); border-radius: 8px; }
.pw-range-hint { font-size: .8rem; opacity: .75; margin: .4rem 0; }
.pw-fuera { display: block; margin: .5rem 0; font-size: .9rem; }
.pw-nota { width: 100%; min-height: 46px; margin-top: .6rem; padding: .55rem .7rem; border: 1px solid rgba(0,0,0,.2); border-radius: 8px; }

.pw-base-opts .pw-extras { display: block; }
.pw-extras-note { font-size: .85rem; opacity: .8; margin: .4rem 0 .8rem; }
.pw-extra-opt { display: flex; align-items: center; gap: .7rem; border: 1px solid rgba(0,0,0,.12); border-radius: 10px; padding: .55rem .8rem; margin-bottom: .45rem; cursor: pointer; background: #fff; }
.pw-extra-opt img, .pw-extra-opt .pw-ph-fallback { width: 44px; height: 33px; object-fit: cover; border-radius: 5px; text-align: center; line-height: 33px; background: #f4ecde; }
.pw-extra-name { font-weight: 600; font-size: .9rem; }
.pw-extra-desc { display: block; font-size: .75rem; opacity: .7; }

.pw-grabado-label { display: block; margin-top: 1rem; }
.pw-grabado-label > span { font-weight: 600; display: block; margin-bottom: .35rem; }
.pw-grabado { width: 100%; min-height: 46px; padding: .55rem .7rem; border: 1px solid rgba(0,0,0,.2); border-radius: 8px; }
.pw-grabado:disabled { opacity: .5; }
.pw-char-count { font-size: .75rem; opacity: .6; }

.pw-summary {
	position: sticky;
	bottom: 0;
	z-index: 20;
	background: #fff;
	border: 1px solid rgba(0,0,0,.12);
	border-radius: 12px;
	box-shadow: 0 -4px 14px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.08);
	padding: 1rem 1.25rem;
}

.pw-summary-title { margin: 0 0 .5rem; font-size: 1rem; }
.pw-lines { list-style: none; margin: 0 0 .6rem; padding: 0; }
.pw-line { display: flex; justify-content: space-between; gap: 1rem; font-size: .88rem; padding: .18rem 0; }
.pw-line-label { opacity: .85; }
.pw-line-amount { white-space: nowrap; }
.pw-total { display: flex; justify-content: space-between; align-items: baseline; margin: .4rem 0; font-size: 1.15rem; font-weight: 700; border-top: 1px solid rgba(0,0,0,.1); padding-top: .5rem; }
.pw-leadtime { font-size: .8rem; opacity: .7; margin: 0 0 .7rem; }

.pw-submit { width: 100%; padding: .85rem 1rem; font-size: 1.05rem; cursor: pointer; }
.pw-submit[disabled] { opacity: .55; cursor: not-allowed; }
.pw-actions { display: flex; gap: .7rem; margin-top: .65rem; }
.pw-actions .button { flex: 1 1 auto; text-align: center; }

@media (min-width: 720px) {
	.pw-submit { width: auto; min-width: 240px; }
	.pw-actions { margin-top: 0; flex-direction: column; }
}