/* Configurador de ventanas — estilos */
:root {
  --marca: #1F6F50;
  --marca-oscuro: #17533c;
  --marca-suave: #e7f2ed;
  --tinta: #14181c;
  --texto: #2a3138;
  --gris: #66707a;
  --tenue: #98a1aa;
  --linea: #e4e7ea;
  --fondo: #f5f4f1;
  --blanco: #fff;
  --aviso: #b4541a;
  --aviso-suave: #fdf1e7;
  --error: #b3261e;
  --radio: 14px;
  --sombra: 0 10px 30px rgba(16, 22, 28, .12), 0 2px 6px rgba(16, 22, 28, .06);
  --panel: 452px;
  --letra: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--letra); color: var(--texto); background: var(--tinta); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }

#app { display: grid; grid-template-columns: minmax(0, 1fr) var(--panel); height: 100dvh; }
#escena { position: relative; min-width: 0; background: #1a1f24; overflow: hidden; }
#lienzo, #lienzo canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
#lienzo canvas { cursor: grab; }
#lienzo canvas:active { cursor: grabbing; }
.cotas { position: absolute; inset: 0; pointer-events: none; }
.cota { font-size: 12px; font-weight: 650; color: #0b3b28; background: #d7f7e6; border: 1px solid #19c37d; padding: 1px 7px; border-radius: 20px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cota.total { font-size: 13px; background: #19c37d; color: #03271a; }
.velo { position: absolute; inset: 0; background: #0d1013; opacity: 0; pointer-events: none; transition: opacity .19s ease; z-index: 3; }
.velo.visible { opacity: 1; }

/* ---- barra superior */
.barra { position: absolute; z-index: 5; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 28px; background: linear-gradient(180deg, rgba(10, 13, 16, .55), rgba(10, 13, 16, 0)); pointer-events: none; }
.barra > * { pointer-events: auto; }
.marca { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; min-width: 0; }
.marca-logo { width: 40px; height: 40px; border-radius: 11px; background: var(--marca); display: grid; place-items: center; flex: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); overflow: hidden; }
.marca-logo svg { width: 22px; height: 22px; }
.marca-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.marca-texto { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.marca-texto b { font-size: 16px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marca-texto small { font-size: 12px; color: rgba(255, 255, 255, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-acciones { display: flex; gap: 8px; }
.pastilla { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 15px; border-radius: 40px; font-weight: 600; font-size: 13.5px; color: #fff; background: rgba(20, 24, 28, .55); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); transition: background .15s, transform .15s; white-space: nowrap; }
.pastilla:hover { background: rgba(20, 24, 28, .78); }
.pastilla.fuerte { background: #fff; color: var(--tinta); border-color: #fff; }
.pastilla.fuerte:hover { background: #f0f2f3; }
.pastilla.activa { background: var(--marca); border-color: var(--marca); }
.pastilla svg { width: 17px; height: 17px; flex: none; }
.pastilla .corto { display: none; }
.pastilla .n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 20px; background: var(--marca); color: #fff; font-size: 12px; display: inline-grid; place-items: center; }

.ficha-viva { position: absolute; z-index: 4; left: 18px; top: 76px; display: flex; flex-wrap: wrap; gap: 6px; max-width: min(560px, calc(100% - 36px)); pointer-events: none; }
.ficha-viva span { font-size: 12.5px; font-weight: 600; color: #fff; background: rgba(20, 24, 28, .5); border: 1px solid rgba(255, 255, 255, .14); padding: 4px 11px; border-radius: 30px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-variant-numeric: tabular-nums; }
.ficha-viva span.ok { background: rgba(31, 111, 80, .82); border-color: rgba(255, 255, 255, .2); }
.ficha-viva span.no { background: rgba(180, 84, 26, .85); }

.avisos { position: absolute; z-index: 4; left: 18px; bottom: 96px; max-width: min(460px, calc(100% - 36px)); display: grid; gap: 6px; }
.aviso { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; line-height: 1.35; padding: 10px 13px; border-radius: 12px; background: rgba(255, 255, 255, .96); color: var(--texto); box-shadow: var(--sombra); }
.aviso.error { border-left: 4px solid var(--error); }
.aviso.nota { border-left: 4px solid #d09a2b; }
.aviso svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }

/* ---- herramientas del visor */
.herramientas { position: absolute; z-index: 5; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; max-width: calc(100% - 24px); }
.grupo { display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 40px; background: rgba(18, 22, 26, .62); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); box-shadow: 0 8px 28px rgba(0, 0, 0, .28); }
.grupo button { height: 40px; min-width: 40px; padding: 0 14px; border-radius: 40px; color: rgba(255, 255, 255, .82); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background .15s, color .15s; white-space: nowrap; }
.grupo button:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.grupo button.activo { background: #fff; color: var(--tinta); }
.grupo button.icono { padding: 0; width: 40px; }
.grupo button svg { width: 18px; height: 18px; }
.grupo .sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .16); margin: 0 4px; }
.grupo input[type=range] { width: 92px; margin: 0 10px 0 4px; accent-color: #fff; }
.pista { position: absolute; z-index: 4; left: 50%; bottom: 76px; transform: translateX(-50%); font-size: 12px; color: rgba(255, 255, 255, .78); background: rgba(18, 22, 26, .4); padding: 4px 12px; border-radius: 20px; pointer-events: none; transition: opacity .6s; white-space: nowrap; }
.pista.oculta { opacity: 0; }
.menu-flotante { position: absolute; z-index: 8; bottom: 78px; background: rgba(18, 22, 26, .9); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 6px; display: grid; gap: 2px; min-width: 190px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 12px 34px rgba(0, 0, 0, .4); }
.menu-flotante button { color: #fff; text-align: left; padding: 9px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 550; display: flex; align-items: center; gap: 9px; }
.menu-flotante button:hover { background: rgba(255, 255, 255, .12); }
.menu-flotante button.activo { background: rgba(255, 255, 255, .18); }
.menu-flotante small { color: rgba(255, 255, 255, .55); font-size: 11.5px; padding: 6px 12px 2px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.menu-flotante i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .4); display: inline-block; }

.cargador { position: absolute; inset: 0; z-index: 9; display: grid; place-content: center; justify-items: center; gap: 16px; background: #14181c; color: rgba(255, 255, 255, .8); font-size: 14px; transition: opacity .5s ease, visibility .5s; }
#app:not(.cargando) .cargador { opacity: 0; visibility: hidden; }
.cargador-aro { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .16); border-top-color: #fff; animation: giro 0.9s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }

/* ---- panel */
#panel { background: var(--blanco); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; border-left: 1px solid #0d1013; position: relative; z-index: 6; }
.pasos { display: flex; gap: 6px; padding: 14px 18px 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--linea); }
.pasos::-webkit-scrollbar { display: none; }
.paso { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px 0 5px; border-radius: 36px; font-size: 13px; font-weight: 600; color: var(--gris); background: var(--fondo); border: 1px solid transparent; transition: all .15s; }
.paso i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; background: #fff; color: var(--gris); border: 1px solid var(--linea); font-variant-numeric: tabular-nums; }
.paso:hover { color: var(--tinta); }
.paso.hecho i { background: var(--marca-suave); color: var(--marca); border-color: transparent; }
.paso.activo { background: var(--tinta); color: #fff; }
.paso.activo i { background: var(--marca); color: #fff; border-color: transparent; }

.contenido { overflow-y: auto; padding: 22px 22px 28px; scroll-behavior: smooth; overscroll-behavior: contain; }
.contenido::-webkit-scrollbar { width: 10px; }
.contenido::-webkit-scrollbar-thumb { background: #d9dde1; border-radius: 10px; border: 3px solid #fff; }
.titulo { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.titulo h2 { font-size: 22px; letter-spacing: -.02em; color: var(--tinta); font-weight: 700; }
.titulo span { font-size: 12.5px; color: var(--tenue); font-weight: 600; }
.entrada { color: var(--gris); font-size: 14px; margin-bottom: 18px; }
h3.apartado { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--tenue); font-weight: 700; margin: 22px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
h3.apartado:first-of-type { margin-top: 4px; }
h3.apartado b { color: var(--texto); text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; }

.segmento { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--fondo); border-radius: 12px; margin-bottom: 16px; }
.segmento button { height: 38px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--gris); transition: all .15s; }
.segmento button.activo { background: #fff; color: var(--tinta); box-shadow: 0 1px 3px rgba(16, 22, 28, .14); }

.rejilla { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.rejilla.dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opcion { position: relative; text-align: left; border: 1.5px solid var(--linea); border-radius: var(--radio); padding: 11px; background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s; display: block; width: 100%; }
.opcion:hover { border-color: #c3c9cf; }
.opcion.activa { border-color: var(--marca); box-shadow: 0 0 0 3px var(--marca-suave); }
.opcion.activa::after { content: ""; position: absolute; top: 9px; right: 9px; width: 20px; height: 20px; border-radius: 50%; background: var(--marca) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.4l3 3 6-6.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/20px; }
.opcion b { display: block; font-size: 13.5px; color: var(--tinta); font-weight: 650; line-height: 1.25; }
.opcion small { display: block; font-size: 12px; color: var(--gris); margin-top: 2px; line-height: 1.3; }
.opcion.tipo svg { width: 100%; height: 74px; display: block; margin-bottom: 8px; }
.opcion.tipo svg .m { fill: #fff; stroke: #2a3138; stroke-width: 2.2; }
.opcion.tipo svg .v { fill: #dcecf3; stroke: #2a3138; stroke-width: 1.3; }
.opcion.tipo svg .a { fill: none; stroke: #66707a; stroke-width: 1.1; }
.opcion.tipo svg .h { fill: #2a3138; }
.opcion.tipo.activa svg .v { fill: #cfeadd; }

.serie { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 13px; align-items: center; padding: 12px; margin-bottom: 9px; }
.serie .dibujo { width: 74px; height: 92px; border-radius: 10px; background: var(--fondo); display: grid; place-items: center; overflow: hidden; }
.serie .dibujo svg { width: 70px; height: 88px; }
.serie h4 { font-size: 15.5px; color: var(--tinta); letter-spacing: -.01em; padding-right: 26px; }
.serie .linea { font-size: 12px; color: var(--tenue); font-weight: 600; }
.serie p { font-size: 13px; color: var(--gris); margin: 3px 0 7px; line-height: 1.35; }
.datos { display: flex; flex-wrap: wrap; gap: 5px; }
.datos span { font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 20px; background: var(--fondo); color: var(--texto); font-variant-numeric: tabular-nums; white-space: nowrap; }
.datos span.verde { background: var(--marca-suave); color: var(--marca-oscuro); }
.datos span.naranja { background: var(--aviso-suave); color: var(--aviso); }
.enlace { color: var(--marca); font-weight: 650; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(31, 111, 80, .35); }
.enlace:hover { text-decoration-color: currentColor; }
.opcion.apagada { opacity: .5; }

.seccion2d { width: 100%; max-height: 340px; background: var(--fondo); border-radius: 12px; padding: 8px; }
.seccion2d .pvc { fill: #fff; stroke: #2a3138; stroke-width: .5; stroke-linejoin: round; }
.seccion2d .camara { fill: #eef1f3; stroke: #7b858f; stroke-width: .35; }
.seccion2d .acero { fill: #9aa4ac; stroke: #4c565f; stroke-width: .35; }
.seccion2d .junta { fill: #1b1d1f; }
.seccion2d .vidrio { fill: #bfe3e6; stroke: #4f8d94; stroke-width: .35; }
.seccion2d .intercalario { fill: #30363b; }
.seccion2d .cota { stroke: var(--marca); stroke-width: .4; }
.seccion2d .texto { font-size: 5.2px; fill: var(--marca-oscuro); font-weight: 700; text-anchor: middle; font-family: var(--letra); }
.seccion2d .rotulo { font-size: 4.6px; fill: #98a1aa; font-weight: 700; letter-spacing: .4px; font-family: var(--letra); }

.muestras { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 9px 7px; }
.muestra { text-align: center; font-size: 11.5px; color: var(--gris); font-weight: 600; line-height: 1.2; }
.muestra i { display: block; width: 100%; aspect-ratio: 1.25; border-radius: 11px; border: 1.5px solid rgba(16, 22, 28, .12); margin-bottom: 5px; background-size: cover; background-position: center; transition: box-shadow .15s, transform .15s; position: relative; }
.muestra:hover i { transform: translateY(-1px); }
.muestra.activa i { box-shadow: 0 0 0 2px #fff, 0 0 0 4.5px var(--marca); }
.muestra.activa { color: var(--tinta); }

.campos { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.campo { display: grid; gap: 5px; }
.campo.ancho { grid-column: 1 / -1; }
.campo > span { font-size: 12.5px; font-weight: 650; color: var(--texto); }
.campo input, .campo select, .campo textarea { height: 46px; border: 1.5px solid var(--linea); border-radius: 11px; padding: 0 13px; background: #fff; outline: none; width: 100%; transition: border-color .15s, box-shadow .15s; font-size: 15px; }
.campo textarea { height: 86px; padding: 11px 13px; resize: vertical; line-height: 1.4; }
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--marca); box-shadow: 0 0 0 3px var(--marca-suave); }
.campo .con-unidad { position: relative; }
.campo .con-unidad input { padding-right: 48px; font-weight: 650; font-size: 17px; font-variant-numeric: tabular-nums; }
.campo .con-unidad em { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--tenue); font-size: 13px; font-weight: 600; }
.campo input[type=range] { height: 22px; padding: 0; border: 0; accent-color: var(--marca); box-shadow: none; }
.medida { border: 1.5px solid var(--linea); border-radius: var(--radio); padding: 13px 14px 8px; }
.medida label { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 650; }
.medida label small { color: var(--tenue); font-weight: 600; }
.medida .valor { display: flex; align-items: center; gap: 8px; margin: 5px 0 3px; }
.medida .valor input { border: 0; outline: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--tinta); width: 100%; min-width: 0; padding: 0; background: none; font-variant-numeric: tabular-nums; }
.medida .valor em { font-style: normal; color: var(--tenue); font-weight: 600; }
.medida .regla { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; }
.medida .regla button { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 1.5px solid var(--linea); color: var(--texto); font-size: 17px; line-height: 1; display: grid; place-items: center; }
.medida .regla button:hover { border-color: var(--marca); color: var(--marca); }
.medida input[type=range] { width: 100%; min-width: 0; accent-color: var(--marca); margin: 0; }
.pano.cabeza { border: 0; padding: 0 0 2px; font-size: 11.5px; color: var(--tenue); font-weight: 650; }
.medida:focus-within { border-color: var(--marca); box-shadow: 0 0 0 3px var(--marca-suave); }

.pano { display: grid; grid-template-columns: 30px minmax(0, 1.25fr) minmax(0, .8fr) minmax(0, 1fr) 30px; gap: 7px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--linea); }
.pano:last-of-type { border-bottom: 0; }
.pano > i { width: 28px; height: 28px; border-radius: 50%; background: var(--fondo); display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 12.5px; color: var(--gris); }
.pano select, .pano input { height: 38px; border: 1.5px solid var(--linea); border-radius: 9px; padding: 0 8px; width: 100%; min-width: 0; background: #fff; outline: none; font-size: 13.5px; }
.pano select:focus, .pano input:focus { border-color: var(--marca); }
.pano .quitar { width: 30px; height: 30px; border-radius: 50%; color: var(--tenue); display: grid; place-items: center; }
.pano .quitar:hover { background: var(--fondo); color: var(--error); }
.pano .quitar svg { width: 16px; height: 16px; }
.union { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--tenue); padding: 2px 0 2px 37px; font-weight: 600; }
.union select { height: 28px; border: 1px solid var(--linea); border-radius: 7px; font-size: 12px; padding: 0 6px; background: #fff; color: var(--texto); }

.fila { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--linea); }
.fila:last-child { border-bottom: 0; }
.fila b { display: block; font-size: 14.5px; color: var(--tinta); font-weight: 650; }
.fila small { display: block; font-size: 12.5px; color: var(--gris); line-height: 1.35; }
.interruptor { position: relative; width: 46px; height: 27px; flex: none; }
.interruptor input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.interruptor i { position: absolute; inset: 0; border-radius: 30px; background: #d5dade; transition: background .18s; }
.interruptor i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s; }
.interruptor input:checked + i { background: var(--marca); }
.interruptor input:checked + i::after { transform: translateX(19px); }
.interruptor input:focus-visible + i { box-shadow: 0 0 0 3px var(--marca-suave); }
.sub { background: var(--fondo); border-radius: 12px; padding: 13px; margin: 0 0 6px; display: grid; gap: 11px; }

.tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabla td { padding: 8px 0; border-bottom: 1px solid var(--linea); vertical-align: top; }
.tabla td:first-child { color: var(--gris); width: 40%; padding-right: 10px; }
.tabla td:last-child { color: var(--tinta); font-weight: 600; }
.tabla tr:last-child td { border-bottom: 0; }
.prestaciones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.dato-grande { background: var(--fondo); border-radius: 12px; padding: 11px 12px; }
.dato-grande small { font-size: 11.5px; color: var(--gris); font-weight: 650; display: block; }
.dato-grande b { font-size: 21px; color: var(--tinta); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dato-grande em { font-style: normal; font-size: 11.5px; color: var(--gris); font-weight: 600; }
.clase { display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 8px; border-radius: 7px; color: #fff; font-weight: 800; font-size: 14px; background: #2e8b57; }
.clase.B { background: #5aa63c; } .clase.C { background: #b7b41e; } .clase.D { background: #e09b1b; } .clase.E { background: #d2571c; }
.nota-pie { font-size: 12px; color: var(--tenue); line-height: 1.4; margin-top: 10px; }

.precio-lineas { display: grid; gap: 7px; font-size: 13.5px; }
.precio-lineas div { display: flex; justify-content: space-between; gap: 12px; }
.precio-lineas div span:last-child { font-weight: 650; color: var(--tinta); font-variant-numeric: tabular-nums; white-space: nowrap; }
.precio-lineas .total { border-top: 1.5px solid var(--tinta); padding-top: 9px; margin-top: 3px; font-size: 15px; font-weight: 700; color: var(--tinta); }
.precio-lineas .rebaja span { color: var(--marca) !important; }
.precio-lineas .tenue { color: var(--gris); }
.sello { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: var(--marca-suave); color: var(--marca-oscuro); }
.sello.pro { background: #14181c; color: #fff; }
.sello.ojo { background: var(--aviso-suave); color: var(--aviso); }

/* ---- pie con el precio */
.pie { border-top: 1px solid var(--linea); padding: 13px 18px calc(13px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; background: #fff; }
.pie .importe { min-width: 0; }
.pie .importe small { display: block; font-size: 12px; color: var(--gris); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pie .importe b { font-size: 25px; letter-spacing: -.025em; color: var(--tinta); font-variant-numeric: tabular-nums; line-height: 1.15; }
.pie .importe s { color: var(--tenue); font-size: 14px; font-weight: 600; margin-left: 7px; }
.pie .botones { display: flex; gap: 8px; }
.boton { height: 48px; padding: 0 20px; border-radius: 13px; font-weight: 700; font-size: 14.5px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--marca); color: #fff; transition: background .15s, transform .1s, box-shadow .15s; white-space: nowrap; box-shadow: 0 6px 16px rgba(31, 111, 80, .28); }
.boton:hover { background: var(--marca-oscuro); }
.boton:active { transform: translateY(1px); }
.boton.claro { background: #fff; color: var(--tinta); border: 1.5px solid var(--linea); box-shadow: none; }
.boton.claro:hover { border-color: #b9c0c6; background: #fff; }
.boton.negro { background: var(--tinta); box-shadow: none; }
.boton.negro:hover { background: #000; }
.boton.ancho { width: 100%; }
.boton.pequeno { height: 40px; padding: 0 15px; font-size: 13.5px; border-radius: 11px; }
.boton[disabled] { opacity: .5; pointer-events: none; }
.boton svg { width: 18px; height: 18px; }
.botonera { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; }
.siguiente { margin-top: 22px; display: flex; justify-content: space-between; gap: 10px; }

/* ---- ventanas emergentes */
.capa { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; background: rgba(10, 13, 16, .58); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: aparece .18s ease; }
@keyframes aparece { from { opacity: 0; } }
.dialogo { width: min(520px, 100%); max-height: calc(100dvh - 36px); overflow-y: auto; background: #fff; border-radius: 20px; padding: 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); position: relative; animation: sube .22s cubic-bezier(.2, .8, .3, 1); }
.dialogo.grande { width: min(860px, 100%); }
@keyframes sube { from { transform: translateY(14px); opacity: 0; } }
.dialogo h2 { font-size: 22px; letter-spacing: -.02em; color: var(--tinta); margin-bottom: 5px; padding-right: 36px; }
.dialogo > p { color: var(--gris); margin-bottom: 18px; font-size: 14px; }
.cerrar { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--gris); background: var(--fondo); z-index: 2; }
.cerrar:hover { color: var(--tinta); background: #e9ebed; }
.cerrar svg { width: 17px; height: 17px; }
.error-texto { color: var(--error); font-size: 13px; font-weight: 600; min-height: 18px; margin-top: 8px; }
.casilla { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--gris); line-height: 1.4; margin-top: 12px; }
.casilla input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--marca); flex: none; }
.casilla a { color: var(--marca); }
.trampa { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.exito { text-align: center; padding: 14px 0 4px; }
.exito .marca-ok { width: 64px; height: 64px; border-radius: 50%; background: var(--marca-suave); color: var(--marca); display: grid; place-items: center; margin: 0 auto 14px; }
.exito .marca-ok svg { width: 30px; height: 30px; }
.exito b.ref { font-size: 20px; color: var(--tinta); letter-spacing: .02em; }

/* ---- presupuesto */
.posicion { display: grid; grid-template-columns: 116px minmax(0, 1fr) auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--linea); align-items: center; }
.posicion img { width: 116px; height: 78px; object-fit: cover; border-radius: 10px; background: var(--fondo); display: block; }
.posicion input.etiqueta { border: 0; border-bottom: 1.5px dashed var(--linea); font-weight: 700; font-size: 15px; color: var(--tinta); width: 100%; padding: 2px 0; outline: none; background: none; }
.posicion input.etiqueta:focus { border-bottom-color: var(--marca); }
.posicion p { font-size: 12.5px; color: var(--gris); line-height: 1.35; margin-top: 4px; }
.posicion .lado { text-align: right; display: grid; gap: 7px; justify-items: end; }
.posicion .lado b { font-size: 16px; color: var(--tinta); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cantidad { display: inline-flex; align-items: center; border: 1.5px solid var(--linea); border-radius: 30px; }
.cantidad button { width: 30px; height: 30px; font-size: 17px; color: var(--texto); }
.cantidad span { min-width: 22px; text-align: center; font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.acciones-pos { display: flex; gap: 12px; margin-top: 6px; }
.acciones-pos button { font-size: 12.5px; font-weight: 650; color: var(--gris); }
.acciones-pos button:hover { color: var(--tinta); }
.vacio { text-align: center; padding: 34px 10px; color: var(--gris); }
.totales { background: var(--fondo); border-radius: 14px; padding: 15px 16px; margin-top: 16px; }

.brindis { position: fixed; z-index: 80; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--sombra); opacity: 0; transition: all .25s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.brindis.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---- pantallas estrechas */
@media (max-width: 1180px) { :root { --panel: 410px; } .grupo button { padding: 0 11px; } }
@media (max-width: 920px) {
  body { overflow: auto; }
  #app { grid-template-columns: 1fr; grid-template-rows: 46dvh minmax(0, 1fr); height: 100dvh; }
  #panel { border-left: 0; border-radius: 18px 18px 0 0; margin-top: -16px; box-shadow: 0 -10px 30px rgba(0, 0, 0, .25); }
  .barra { padding: 10px 12px 22px; }
  .marca-logo { width: 34px; height: 34px; border-radius: 9px; }
  .marca-texto small { display: none; }
  .marca-texto b { font-size: 14.5px; }
  .pastilla { height: 36px; padding: 0 12px; font-size: 12.5px; }
  .pastilla .largo { display: none; }
  .ficha-viva { top: 58px; left: 12px; }
  .ficha-viva span { font-size: 11.5px; padding: 3px 9px; }
  .ficha-viva span.extra { display: none; }
  .herramientas { bottom: 26px; gap: 6px; left: 0; right: 0; transform: none; max-width: none; padding: 0 10px; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  .herramientas::-webkit-scrollbar { display: none; }
  .herramientas .grupo { flex: none; }
  #escena { overflow: hidden; }
  .pastilla .corto { display: inline; }
  .grupo { padding: 4px; }
  .grupo button { height: 34px; min-width: 34px; padding: 0 9px; font-size: 12.5px; }
  .grupo button.icono { width: 34px; }
  .grupo button .largo, .grupo .solo-grande { display: none; }
  .pista, .avisos { display: none; }
  .contenido { padding: 18px 16px 22px; }
  .pasos { padding: 12px 14px 10px; }
  .titulo h2 { font-size: 20px; }
  .pie { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .pie .importe b { font-size: 21px; }
  .boton { height: 46px; padding: 0 16px; }
  .dialogo { padding: 22px 18px; border-radius: 18px; }
  .campos { grid-template-columns: 1fr; }
  .posicion { grid-template-columns: 84px minmax(0, 1fr); }
  .posicion img { width: 84px; height: 60px; }
  .posicion .lado { grid-column: 1 / -1; grid-template-columns: auto auto; justify-content: space-between; align-items: center; }
}
@media (max-width: 400px) { .rejilla { grid-template-columns: repeat(2, minmax(0, 1fr)); } .prestaciones { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- miniaturas de sección y aviso de privacidad */
.dibujo.mini .seccion2d { background: none; padding: 0; max-height: none; }
.dibujo.mini .cota, .dibujo.mini .texto, .dibujo.mini .rotulo { display: none; }
.privacidad { position: fixed; z-index: 70; left: 18px; bottom: 18px; width: min(430px, calc(100% - 36px)); background: #fff; border-radius: 16px; padding: 16px 18px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); font-size: 13px; color: var(--gris); line-height: 1.45; }
.privacidad div { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
@media (max-width: 920px) { .privacidad { left: 10px; bottom: 10px; width: calc(100% - 20px); } }

/* ================= v2 ================= */
/* ---- accesos destacados sobre la escena */
.destacados { position: absolute; z-index: 5; right: 18px; top: 76px; display: grid; gap: 8px; justify-items: end; }
.destacados button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 15px 0 12px; border-radius: 40px; font-weight: 650; font-size: 13.5px; color: var(--tinta); background: rgba(255, 255, 255, .94); box-shadow: 0 8px 24px rgba(0, 0, 0, .28); transition: transform .15s, background .15s; white-space: nowrap; }
.destacados button:hover { background: #fff; transform: translateX(-2px); }
.destacados button svg { width: 18px; height: 18px; color: var(--marca); flex: none; }

/* ---- menú para abrir las hojas */
.menu-flotante.hojas { min-width: 318px; max-width: calc(100% - 20px); max-height: calc(100% - 150px); overflow-y: auto; padding: 8px; gap: 4px; }
.menu-flotante .rapidos { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 2px 4px 6px; }
.menu-flotante .rapidos button { justify-content: center; text-align: center; padding: 8px 6px; font-size: 12.5px; background: rgba(255, 255, 255, .1); }
.menu-flotante .rapidos button:hover { background: rgba(255, 255, 255, .2); }
.hoja-fila { display: grid; grid-template-columns: 92px minmax(0, 1fr) 52px 62px; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; color: #fff; font-size: 13px; font-weight: 600; }
.hoja-fila:hover { background: rgba(255, 255, 255, .06); }
.hoja-fila span em { display: block; font-style: normal; font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, .55); }
.hoja-fila input[type=range] { width: 100%; min-width: 0; accent-color: #fff; margin: 0; }
.hoja-fila output { font-variant-numeric: tabular-nums; font-size: 12px; color: rgba(255, 255, 255, .8); text-align: right; }
.menu-flotante .hoja-fila button { justify-content: center; padding: 6px 4px; font-size: 12px; border: 1px solid rgba(255, 255, 255, .22); }
.menu-flotante .hoja-fila button.activo { background: #fff; color: var(--tinta); border-color: #fff; }
.menu-flotante p { color: rgba(255, 255, 255, .55); font-size: 11.5px; padding: 4px 10px 4px; line-height: 1.35; }

/* ---- atajos y acciones del resumen */
.atajo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--radio); background: var(--marca-suave); margin: 14px 0; }
.atajo > div { display: flex; align-items: center; gap: 11px; min-width: 0; }
.atajo svg { width: 22px; height: 22px; color: var(--marca); flex: none; }
.atajo b { display: block; font-size: 13.5px; color: var(--tinta); }
.atajo small { display: block; font-size: 12px; color: var(--gris); line-height: 1.3; }
.atajo .boton { flex: none; background: #fff; }
.botonera.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.botonera:empty { display: none; }
.botonera > .boton:only-child { grid-column: 1 / -1; }
.boton.whatsapp { background: #1f8f4f; box-shadow: 0 6px 16px rgba(31, 143, 79, .28); }
.boton.whatsapp:hover { background: #17753f; }
.mas-acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; margin-top: 12px; }
.mas-acciones button { display: flex; align-items: center; gap: 8px; padding: 9px 4px; font-size: 13px; font-weight: 650; color: var(--texto); border-radius: 8px; text-align: left; }
.mas-acciones button:hover { color: var(--marca); }
.mas-acciones svg { width: 17px; height: 17px; color: var(--marca); flex: none; }
.validez { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--gris); font-weight: 600; margin-top: 10px; }
.validez svg { width: 15px; height: 15px; }
.ayudas { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: var(--radio); border: 1.5px solid var(--marca-suave); background: linear-gradient(180deg, var(--marca-suave), #fff 70%); margin-top: 18px; }
.ayudas .marca-ok { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--marca); display: grid; place-items: center; }
.ayudas .marca-ok svg { width: 20px; height: 20px; }
.ayudas b { font-size: 14.5px; color: var(--tinta); }
.ayudas p { font-size: 12.5px; color: var(--gris); line-height: 1.45; margin: 4px 0 8px; }
.ayudas small { display: block; font-size: 11px; color: var(--tenue); margin-top: 6px; }
.foto-casa { position: relative; display: block; width: 100%; border-radius: 12px; overflow: hidden; background: var(--fondo); }
.foto-casa img { display: block; width: 100%; max-height: 240px; object-fit: cover; }
.foto-casa span { position: absolute; right: 8px; bottom: 8px; background: rgba(20, 24, 28, .72); color: #fff; font-size: 12px; font-weight: 650; padding: 5px 11px; border-radius: 20px; }
.pie .importe em { display: flex; align-items: center; gap: 5px; font-style: normal; font-size: 11.5px; color: var(--marca-oscuro); font-weight: 650; margin-top: 1px; white-space: nowrap; }
.pie .importe em svg { width: 13px; height: 13px; }

/* ---- presupuesto: plazos, validez y enlaces */
.posicion .foto { position: relative; }
.posicion .foto span { position: absolute; left: 5px; bottom: 5px; background: var(--marca); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.posicion p.plazo { display: flex; align-items: center; gap: 5px; color: var(--marca-oscuro); font-weight: 650; }
.posicion p.plazo svg { width: 13px; height: 13px; }
.condiciones { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--linea); font-size: 13px; color: var(--gris); }
.condiciones span { display: inline-flex; align-items: center; gap: 6px; }
.condiciones b { color: var(--tinta); }
.condiciones svg { width: 15px; height: 15px; color: var(--marca); }
.enlace-caja { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.enlace-caja input { height: 40px; border: 1.5px solid var(--linea); border-radius: 11px; padding: 0 12px; font-size: 13px; color: var(--texto); background: var(--fondo); min-width: 0; outline: none; }
.compartir { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 18px; align-items: center; margin-top: 16px; }
.qr { width: 168px; height: 168px; border-radius: 12px; border: 1.5px solid var(--linea); display: grid; place-items: center; overflow: hidden; background: #fff; }
.qr svg { width: 100%; height: 100%; display: block; }
.botones-v { display: grid; gap: 8px; }
.botones-v .boton { text-decoration: none; }
.pasos-ra { margin: 0 0 6px; padding-left: 20px; font-size: 13.5px; color: var(--texto); line-height: 1.6; }
.cita { border: 1.5px solid var(--linea); border-radius: 12px; padding: 12px 13px; gap: 11px; }
.cita .campos { margin-top: 2px; }

/* ---- comparador */
.comparar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; padding-top: 10px; }
.columna { position: relative; border: 1.5px solid var(--linea); border-radius: 16px; padding: 18px 16px 16px; display: grid; gap: 4px; align-content: start; text-align: center; }
.columna.destacada { border-color: var(--marca); box-shadow: 0 0 0 3px var(--marca-suave); }
.columna .cinta { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--marca); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 11px; border-radius: 20px; white-space: nowrap; }
.columna > small { font-size: 12px; color: var(--tenue); font-weight: 650; }
.columna h3 { font-size: 20px; color: var(--tinta); letter-spacing: -.02em; }
.columna .dibujo { width: 84px; height: 104px; margin: 6px auto; border-radius: 10px; background: var(--fondo); display: grid; place-items: center; overflow: hidden; }
.columna .dibujo svg { width: 78px; height: 98px; }
.columna .serie { display: block; padding: 0; margin: 0; font-size: 14.5px; color: var(--tinta); }
.columna .vidrio { font-size: 12.5px; color: var(--gris); }
.columna .precio { margin: 10px 0 4px; display: grid; }
.columna .precio b { font-size: 24px; letter-spacing: -.02em; color: var(--tinta); font-variant-numeric: tabular-nums; }
.columna .precio small { font-size: 11.5px; color: var(--tenue); font-weight: 600; }
.columna .precio em { font-style: normal; font-size: 12px; color: var(--marca-oscuro); font-weight: 650; }
.columna ul { list-style: none; margin: 8px 0 12px; padding: 0; text-align: left; font-size: 12.5px; }
.columna li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--linea); color: var(--gris); }
.columna li b { color: var(--tinta); font-weight: 650; text-align: right; }
.columna li:last-child { border-bottom: 0; }
.columna .clase { min-width: 28px; height: 20px; font-size: 12px; font-style: normal; }

/* ---- varias ventanas */
.previa { margin-top: 12px; max-height: 260px; overflow-y: auto; }
.tabla.lista td { padding: 7px 8px 7px 0; font-size: 13px; width: auto; color: var(--tinta); font-weight: 600; }
.tabla.lista tr:first-child td { font-size: 11.5px; color: var(--tenue); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.tabla.lista td:last-child { color: var(--gris); font-weight: 500; font-size: 12px; }
.tabla.lista tr.mal td { color: var(--error); }

/* ---- fotomontaje */
.montaje { position: fixed; inset: 0; z-index: 60; background: #0f1215; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; color: #fff; animation: aparece .18s ease; }
.montaje header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.montaje header b { display: block; font-size: 16px; }
.montaje header small { display: block; font-size: 12.5px; color: rgba(255, 255, 255, .6); }
.montaje .cerrar { position: static; flex: none; background: rgba(255, 255, 255, .1); color: #fff; }
.montaje .cerrar:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.montaje-lienzo { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; padding: 12px; }
.montaje-vacio { text-align: center; max-width: 460px; padding: 20px; }
.montaje-vacio .marca-ok { width: 72px; height: 72px; border-radius: 50%; background: rgba(255, 255, 255, .08); display: grid; place-items: center; margin: 0 auto 16px; }
.montaje-vacio .marca-ok svg { width: 32px; height: 32px; }
.montaje-vacio h2 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 8px; }
.montaje-vacio p { color: rgba(255, 255, 255, .65); font-size: 14px; margin-bottom: 20px; }
.montaje-botones { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.montaje label.boton { cursor: pointer; }
.montaje-area { position: relative; touch-action: none; cursor: move; user-select: none; -webkit-user-select: none; }
.montaje-area canvas { display: block; width: 100%; height: 100%; border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.asa { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: rgba(255, 255, 255, .25); border: 2.5px solid #fff; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .5); cursor: grab; touch-action: none; }
.asa::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--marca); }
.asa:active { cursor: grabbing; }
.montaje footer { display: flex; align-items: center; gap: 10px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255, 255, 255, .1); background: #161a1e; overflow-x: auto; scrollbar-width: none; }
.montaje footer::-webkit-scrollbar { display: none; }
.montaje footer > * { flex: none; }
.montaje footer .hueco { flex: 1 1 auto; }
.montaje .segmento { background: rgba(255, 255, 255, .08); min-width: 250px; }
.montaje .segmento button { color: rgba(255, 255, 255, .7); font-size: 13px; height: 34px; padding: 0 10px; }
.montaje .segmento button.activo { background: #fff; color: var(--tinta); }
.montaje-luz { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 650; color: rgba(255, 255, 255, .75); }
.montaje-luz input { width: 96px; accent-color: #fff; }
.montaje .boton.claro { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .2); }
.montaje .boton.claro:hover { background: rgba(255, 255, 255, .18); }

/* ---- configurador incrustado en otra web */
.incrustado .marca { pointer-events: none; }

@media (max-width: 1180px) { .destacados button span { display: none; } .destacados button { width: 42px; padding: 0; justify-content: center; } }
@media (max-width: 920px) {
  .destacados { top: 56px; right: 10px; gap: 6px; }
  .destacados button { width: 38px; height: 38px; }
  .ficha-viva { max-width: calc(100% - 66px); }
  .menu-flotante.hojas { min-width: 0; width: calc(100% - 20px); left: 10px !important; bottom: 74px; max-height: calc(100% - 84px); }
  .menu-flotante.hojas { padding: 6px; background: rgba(18, 22, 26, .78); }
  .menu-flotante.hojas > small, .menu-flotante.hojas > p { display: none; }
  .menu-flotante .rapidos { padding: 0 0 4px; }
  .menu-flotante .rapidos button { padding: 7px 4px; }
  .hoja-fila { grid-template-columns: 58px minmax(0, 1fr) 44px 58px; padding: 3px 6px; }
  .hoja-fila span em { display: none; }
  .comparar { grid-template-columns: 1fr; gap: 16px; }
  .botonera.tres { grid-template-columns: 1fr; }
  .botonera.tres .solo-grande { display: none; }
  .compartir { grid-template-columns: 1fr; justify-items: center; }
  .compartir .botones-v { width: 100%; }
  .mas-acciones { grid-template-columns: 1fr; }
  .montaje header small { display: none; }
  .montaje footer { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .montaje .segmento { min-width: 210px; }
}
@media (max-width: 480px) { .marca-texto { display: none; } }

/* ================= v3 ================= */
/* ---- acabados del vidrio */
.acabados { display: grid; gap: 8px; }
.acabado { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 12px; align-items: center; text-align: left; padding: 9px; border: 1.5px solid var(--linea); border-radius: var(--radio); background: #fff; position: relative; transition: border-color .15s, box-shadow .15s; }
.acabado:hover { border-color: #c3c9cf; }
.acabado.activa { border-color: var(--marca); box-shadow: 0 0 0 3px var(--marca-suave); }
.acabado i { display: block; width: 62px; height: 62px; border-radius: 10px; border: 1px solid rgba(16, 22, 28, .14); background-size: cover; position: relative; overflow: hidden; }
.acabado i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(125deg, rgba(255, 255, 255, .55) 0 18%, rgba(255, 255, 255, 0) 32% 100%); }
.acabado b { display: block; font-size: 14px; color: var(--tinta); }
.acabado small { display: block; font-size: 12px; color: var(--gris); line-height: 1.3; margin: 1px 0 3px; }
.acabado em { font-style: normal; font-size: 11px; font-weight: 650; color: var(--marca-oscuro); letter-spacing: .02em; }
.acabado i.v-transparente { background: linear-gradient(180deg, #8fc1ea, #cfe6f4 55%, #7fae6b 56%, #5e9150); }
.acabado i.v-mate { background: linear-gradient(180deg, #eef3f5, #dfe7ea); }
.acabado i.v-gotas { background: radial-gradient(circle at 30% 30%, #fff 0 12%, transparent 13%), radial-gradient(circle at 70% 60%, #fff 0 10%, transparent 11%), radial-gradient(circle at 45% 80%, #fff 0 9%, transparent 10%), #d5e2e6; background-size: 21px 21px, 17px 17px, 25px 25px, auto; }
.acabado i.v-estriado { background: repeating-linear-gradient(90deg, #eef4f6 0 4px, #c4d5da 4px 8px); }
.acabado i.v-gris { background: linear-gradient(180deg, #5d6b78, #8b98a3 55%, #566a50 56%, #46583f); }
.acabado i.v-bronce { background: linear-gradient(180deg, #8a6f57, #b39a80 55%, #6e6a43 56%, #5a5634); }
.acabado i.v-espejo { background: linear-gradient(160deg, #dfe9f1, #7e93a6 45%, #c9d6e0 60%, #5f7386); }

/* ---- barrotillos */
.contadores { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.contador { border: 1.5px solid var(--linea); border-radius: 12px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.contador span { font-size: 13px; font-weight: 650; color: var(--texto); }
.contador div { display: inline-flex; align-items: center; gap: 4px; }
.contador b { min-width: 22px; text-align: center; font-size: 16px; color: var(--tinta); font-variant-numeric: tabular-nums; }
.contador button { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--linea); font-size: 17px; line-height: 1; color: var(--texto); display: grid; place-items: center; }
.contador button:hover { border-color: var(--marca); color: var(--marca); }
.contador button[disabled] { opacity: .35; pointer-events: none; }
.atajos-b { display: flex; gap: 16px; margin-top: 9px; }

/* ---- modelos de manilla */
.rejilla.modelos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opcion.modelo { text-align: center; padding: 10px 8px; }
.opcion.modelo svg { width: 46px; height: 58px; display: block; margin: 0 auto 6px; fill: #c9ced2; stroke: #2a3138; stroke-width: 1.4; }
.opcion.modelo.activa svg { fill: var(--marca-suave); }
.segmento .punto { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; border: 1px solid rgba(16, 22, 28, .25); }

/* ---- guía para medir */
.guia-medir { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.guia-medir figure { margin: 0; border: 1.5px solid var(--linea); border-radius: 14px; padding: 12px; }
.guia-medir svg { width: 100%; height: auto; display: block; background: var(--fondo); border-radius: 9px; }
.guia-medir figcaption { font-size: 13px; color: var(--texto); line-height: 1.4; margin-top: 9px; }
.guia-medir figcaption b { display: block; color: var(--tinta); font-size: 14px; }
.guia-medir .pared { fill: #ddd8cf; }
.guia-medir .hueco { fill: #fff; stroke: #2a3138; stroke-width: 1.5; }
.guia-medir .cota-g { stroke: var(--marca); stroke-width: 1.6; fill: none; }
.guia-medir .cota-r { stroke: #b4541a; stroke-width: 1.6; fill: none; stroke-dasharray: 5 4; }
.guia-medir text { font-size: 11px; font-weight: 700; fill: var(--marca-oscuro); font-family: var(--letra); }
.consejos { margin: 14px 0 0; padding-left: 20px; font-size: 13.5px; line-height: 1.55; color: var(--texto); }

/* ---- fotos del hueco en el formulario */
.fotos-hueco { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.fotos-hueco figure { position: relative; margin: 0; width: 74px; height: 74px; border-radius: 10px; overflow: hidden; background: var(--fondo); }
.fotos-hueco img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fotos-hueco button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: rgba(20, 24, 28, .75); color: #fff; display: grid; place-items: center; font-size: 13px; line-height: 1; }
.fotos-hueco label { width: 74px; height: 74px; border-radius: 10px; border: 1.5px dashed #b9c0c6; display: grid; place-items: center; color: var(--gris); cursor: pointer; font-size: 11.5px; font-weight: 650; text-align: center; line-height: 1.2; padding: 4px; }
.fotos-hueco label:hover { border-color: var(--marca); color: var(--marca); }

/* ---- descuento por cantidad, aceptar y estado del pedido */
.empujon { display: flex; align-items: center; gap: 9px; padding: 10px 13px; border-radius: 11px; background: var(--marca-suave); color: var(--marca-oscuro); font-size: 13px; font-weight: 600; margin-top: 12px; }
.empujon svg { width: 17px; height: 17px; flex: none; }
.pasos-pedido { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; margin: 14px 0 6px; }
.pasos-pedido div { position: relative; text-align: center; font-size: 11.5px; font-weight: 650; color: var(--tenue); padding-top: 26px; line-height: 1.25; }
.pasos-pedido div::before { content: ""; position: absolute; top: 6px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #fff; border: 2.5px solid #cfd5da; z-index: 1; }
.pasos-pedido div::after { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2.5px; background: #cfd5da; }
.pasos-pedido div:first-child::after { display: none; }
.pasos-pedido div.hecho { color: var(--marca-oscuro); }
.pasos-pedido div.hecho::before { background: var(--marca); border-color: var(--marca); }
.pasos-pedido div.hecho::after { background: var(--marca); }
.pasos-pedido div.ahora { color: var(--tinta); }
.pasos-pedido div.ahora::before { box-shadow: 0 0 0 4px var(--marca-suave); }
.caja-pedido { border: 1.5px solid var(--marca-suave); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; background: linear-gradient(180deg, var(--marca-suave), #fff 80%); }
.caja-pedido h3 { font-size: 15px; color: var(--tinta); }
.caja-pedido p { font-size: 13px; color: var(--gris); margin-top: 2px; }
.firma { border: 1.5px dashed #b9c0c6; border-radius: 12px; background: #fff; position: relative; touch-action: none; }
.firma canvas { display: block; width: 100%; height: 150px; border-radius: 12px; cursor: crosshair; touch-action: none; }
.firma span { position: absolute; left: 14px; bottom: 9px; font-size: 12px; color: var(--tenue); pointer-events: none; }
.firma button { position: absolute; right: 8px; top: 8px; font-size: 12px; font-weight: 650; color: var(--gris); padding: 4px 9px; border-radius: 8px; background: var(--fondo); }

/* ---- modo tienda */
.portada-tienda { position: fixed; inset: 0; z-index: 90; display: grid; place-content: center; justify-items: center; gap: 18px; text-align: center; padding: 30px; color: #fff; background: radial-gradient(circle at 50% 35%, rgba(31, 111, 80, .55), rgba(10, 13, 16, .93) 70%); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); cursor: pointer; }
.portada-tienda h1 { font-size: clamp(30px, 5vw, 56px); letter-spacing: -.03em; line-height: 1.05; max-width: 16ch; }
.portada-tienda p { font-size: clamp(15px, 1.8vw, 20px); color: rgba(255, 255, 255, .8); max-width: 44ch; }
.portada-tienda .boton { height: 62px; padding: 0 38px; font-size: 18px; border-radius: 62px; }
.aviso-tienda { position: fixed; z-index: 95; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #fff; border-radius: 20px; padding: 26px 30px; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); width: min(420px, calc(100% - 32px)); }
.aviso-tienda h2 { font-size: 22px; color: var(--tinta); }
.aviso-tienda p { color: var(--gris); margin: 6px 0 16px; }
.tienda .privacidad { display: none; }

/* ---- antes y después en el fotomontaje */
.montaje-luz.comparar input { width: 130px; }

@media (max-width: 1180px) { #btnMedir .largo { display: none; } }
@media (max-width: 920px) {
  .guia-medir { grid-template-columns: 1fr; }
  .rejilla.modelos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .contadores { grid-template-columns: 1fr; }
  .pasos-pedido div { font-size: 10.5px; }
}

/* con el panel al lado y poco ancho, la marca se queda en su icono para que quepan los botones */
@media (min-width: 921px) and (max-width: 1100px) { .marca-texto { display: none; } }


/* ================= v4 ================= */
/* cabecera de avance: dónde estás, cuánto llevas y cómo moverte */
.pasos { display: block; overflow: visible; padding: 12px 18px 11px; }
.avance { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 38px; gap: 11px; align-items: center; }
.avance .ir { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--tinta); border: 1px solid #cfd5da; transition: background .15s, transform .15s, border-color .15s; }
.avance .ir svg { width: 18px; height: 18px; }
.avance .ir:hover:not(:disabled) { border-color: var(--tinta); transform: scale(1.05); }
.avance .ir.sig { background: var(--tinta); color: #fff; border-color: var(--tinta); }
.avance .ir:disabled { opacity: .3; cursor: default; }
.donde { min-width: 0; line-height: 1.15; }
.donde small { display: block; font-size: 11.5px; font-weight: 650; color: var(--tenue); letter-spacing: .02em; }
.donde b { display: block; font-size: 16.5px; font-weight: 700; color: var(--tinta); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cuanto { text-align: right; line-height: 1.15; }
.cuanto b { display: block; font-size: 17px; font-weight: 750; color: var(--marca-oscuro, var(--marca)); font-variant-numeric: tabular-nums; }
.cuanto small { display: block; font-size: 11px; font-weight: 600; color: var(--tenue); }
.tramos { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; margin-top: 11px; }
.tramo { padding: 3px 0 0; text-align: center; font-size: 10.5px; font-weight: 650; color: var(--tenue); line-height: 1.2; cursor: pointer; }
.tramo i { display: block; height: 6px; border-radius: 6px; background: #e1e5e8; margin-bottom: 5px; transition: background .2s, box-shadow .2s; }
.tramo span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tramo.hecho { color: var(--gris); }
.tramo.hecho i { background: color-mix(in srgb, var(--marca) 55%, #fff); }
.tramo.activo { color: var(--tinta); }
.tramo.activo i { background: var(--marca); box-shadow: 0 0 0 3px var(--marca-suave); }
.tramo:hover { color: var(--tinta); }
.tramo:hover i { background: color-mix(in srgb, var(--marca) 75%, #fff); }
.tramo.activo:hover i { background: var(--marca); }

/* botón para volver a la ventana entera después de un acercamiento */
.entera { position: absolute; z-index: 5; left: 50%; bottom: 78px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px 0 13px; border-radius: 38px; font-size: 13.5px; font-weight: 650; color: var(--tinta); background: rgba(255, 255, 255, .94); box-shadow: 0 6px 22px rgba(10, 14, 18, .28); white-space: nowrap; animation: entra-entera .25s ease-out; }
.entera:hover { background: #fff; }
@keyframes entra-entera { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* casillas del menú de luz y ambiente */
.menu-flotante button svg { width: 18px; height: 18px; flex: none; }
.menu-flotante button i { flex: none; }
.menu-flotante[data-tipo="luz"] { min-width: 240px; }
.menu-flotante i.cas { border-radius: 5px; display: inline-grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 800; line-height: 1; color: var(--tinta); }
.menu-flotante button.activo i.cas { background: #fff; border-color: #fff; }

@media (max-width: 920px) {
  .pasos { padding: 10px 14px 9px; }
  .avance { grid-template-columns: 34px minmax(0, 1fr) auto 34px; gap: 9px; }
  .avance .ir { width: 34px; height: 34px; }
  .donde b { font-size: 15.5px; }
  .cuanto b { font-size: 15.5px; }
  .tramos { gap: 3px; margin-top: 9px; }
  .tramo { font-size: 10px; }
  .entera { bottom: 70px; height: 36px; font-size: 13px; }
}
@media (max-width: 380px) { .tramo span { font-size: 9px; letter-spacing: -.01em; } }
