/* ==========================================================================
   estilo.css — Pensado primero para celular, alto contraste, letra grande
   Todo el tamaño de letra usa "rem": el botón "Letra grande" solo cambia
   el tamaño base (20px -> 28px) y todo crece junto.
   ========================================================================== */
:root {
  --fondo: #000;
  --panel: #0d1218;
  --texto: #fff;
  --amarillo: #ffe600;
  --gris: #2a323c;
}
html { font-size: 20px; -webkit-text-size-adjust: 100%; }
html.letra-grande { font-size: 28px; }

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--fondo); color: var(--texto);
  font: 1rem/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Cabecera ---------- */
.cabecera {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between;
  padding: .6rem .8rem; border-bottom: 3px solid var(--amarillo);
}
h1 { margin: 0; font-size: 1.3rem; color: var(--amarillo); line-height: 1.2; }
h2 { margin: 0 0 .6rem; font-size: 1.35rem; color: var(--amarillo); }
h3 { margin: 0; }

/* ---------- Botones enormes ---------- */
.boton {
  min-height: max(64px, 3.4rem); min-width: max(64px, 3.4rem);
  padding: .5rem 1rem; font: inherit; font-size: 1.1rem; font-weight: 700;
  color: var(--amarillo); background: #000; border: 3px solid var(--amarillo); border-radius: 14px;
  cursor: pointer; touch-action: manipulation;
}
.boton:active { transform: scale(.97); }
.boton.principal { background: var(--amarillo); color: #000; }
.boton.secundario { background: var(--gris); color: #fff; border-color: #fff; }
.boton[aria-pressed="true"]:not(.principal) { background: var(--amarillo); color: #000; }
.boton.principal[aria-pressed="true"] { background: #fff; border-color: #fff; }
.boton:disabled { opacity: .35; cursor: default; }
.boton:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }
.ancho { width: 100%; }

/* ---------- Visor 3D ---------- */
.visor { display: flex; height: 62vh; height: 62dvh; min-height: 340px; background: #0b0f14; }
.caja-3d { position: relative; flex: 1; min-width: 0; }
.caja-3d canvas { display: block; width: 100%; height: 100%; touch-action: none; }

/* Tira al costado con las semanas */
.tira {
  flex: 0 0 6.8rem; display: flex; flex-direction: column; gap: .4rem; padding: .4rem;
  background: #000; border-left: 3px solid var(--amarillo); overflow-y: auto;
}
.tira .boton { width: 100%; min-width: 0; padding: .3rem .2rem; font-size: 1rem; line-height: 1.15; }
.tira-nombre {
  flex: none; text-align: center; font-size: 1.3rem; font-weight: 800; line-height: 1.1;
  color: var(--amarillo); padding: .3rem 0; overflow-wrap: anywhere;
}
.solo-ampliado { display: none; }

/* Título de lo que se ve, arriba de la maqueta */
.rotulo {
  position: absolute; top: .4rem; left: .4rem; right: .4rem; padding: .3rem .5rem;
  font-size: 1rem; font-weight: 700; text-align: center; background: rgba(0,0,0,.72);
  border-radius: 10px; pointer-events: none;
}
.rotulo:empty { display: none; }

/* Lupa: acercar y alejar, sobre la maqueta, abajo */
.zoom { position: absolute; left: .4rem; right: .4rem; bottom: .4rem; display: flex; gap: .4rem; }
.zoom .boton { flex: 1; min-width: 0; padding: .3rem .2rem; font-size: 1rem; background: rgba(0,0,0,.82); }

/* Modo "Ampliar": la maqueta ocupa toda la pantalla */
html.ampliado, html.ampliado body { overflow: hidden; }
html.ampliado .visor { position: fixed; inset: 0; z-index: 50; height: 100vh; height: 100dvh; }
html.ampliado .solo-ampliado { display: block; }
.estado {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 1rem; text-align: center; font-size: 1.3rem; font-weight: 700; background: rgba(0,0,0,.85);
}
.estado[hidden] { display: none; }
.estado.error { color: var(--amarillo); }
noscript .estado { position: static; }

/* ---------- Paneles ---------- */
.resto { padding: .6rem .8rem 2rem; display: grid; gap: .9rem; }
.ayuda { margin: 0; text-align: center; color: var(--amarillo); font-size: 1rem; }
.panel { background: var(--panel); border: 2px solid var(--gris); border-radius: 16px; padding: .8rem; }
.detalle { margin: .6rem 0; font-size: 1.05rem; }
.nuevo { margin: .4rem 0 .8rem; font-weight: 700; color: var(--amarillo); }
.pequeno { font-size: 1rem; font-weight: 400; }

/* Selector con flechas grandes */
.selector { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: center; }
.selector[hidden] { display: none; }
.selector-texto { text-align: center; font-size: 1.5rem; font-weight: 800; line-height: 1.15; }

/* Cuatro vistas: 2 x 2 */
.rejilla-botones { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }

/* ---------- Leyenda ---------- */
.leyenda { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; grid-template-columns: 1fr 1fr; }
.leyenda li { display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; font-weight: 700; line-height: 1.2; }
.muestra { flex: none; width: 2rem; height: 2rem; border-radius: 6px; border: 2px solid #fff; }

/* ---------- Presupuesto ---------- */
.pre-nombre { font-size: 1.2rem; margin: .7rem 0 .3rem; }
.pre-lista { list-style: none; margin: .5rem 0; padding: 0; }
.pre-lista li {
  display: flex; justify-content: space-between; gap: .8rem; padding: .6rem 0;
  border-bottom: 1px solid var(--gris); font-size: 1.05rem;
}
.pre-lista strong { white-space: nowrap; color: var(--amarillo); }
.pre-total {
  display: flex; justify-content: space-between; align-items: baseline; margin: .6rem 0 .9rem;
  font-size: 1.4rem; font-weight: 800; color: var(--amarillo);
}

/* ---------- Pantalla grande (laptop): maqueta a la izquierda, controles a la derecha ---------- */
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 1fr minmax(380px, 34%); grid-template-rows: auto 1fr; height: 100vh; }
  .cabecera { grid-column: 2; grid-row: 1; border-left: 3px solid var(--amarillo); }
  .visor { grid-column: 1; grid-row: 1 / 3; height: 100vh; }
  .resto { grid-column: 2; grid-row: 2; overflow-y: auto; border-left: 3px solid var(--amarillo); }
}
@media (prefers-reduced-motion: reduce) { .boton:active { transform: none; } }
