/* Visor 3D — herramienta de computador (nov-2026). Mismos tokens y letras que Baldosa AR y el
   dashboard. En el celular solo se ve el aviso y el texto informativo (body.es-movil). */
:root {
    --bg: #09090b; --surface: #111113; --surface2: #18181c; --surface3: #1f1f25;
    --border: #27272e; --border2: #32323c;
    --text: #f0f0f5; --text2: #a1a1b5; --muted: #8e8ea2;
    --primary: #6366f1; --accent: #818cf8; --accent-light: #a5b4fc;
    --boton-a: #4f46e5; --boton-b: #7c3aed;
    color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background: var(--bg); color: var(--text); min-height: 100vh;
    font-family: 'DM Sans', system-ui, sans-serif; line-height: 1.5; overflow-x: hidden;
}
body::before {
    content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 70% 45% at 50% 0%, rgba(99,102,241,0.14), transparent 60%),
        linear-gradient(rgba(99,102,241,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,102,241,0.035) 1px, transparent 1px);
    background-size: 100% 100%, 48px 48px, 48px 48px;
}
main, .footer { position: relative; z-index: 1; }
[hidden] { display: none !important; }
a { color: var(--accent-light); }

/* ── Encabezado ── */
.header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(9,9,11,0.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 0.7rem 1.25rem; display: flex; align-items: center; gap: 0.8rem;
}
.header-marca { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.header-marca img { height: 32px; width: auto; border-radius: 8px; }
.header-logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -0.4px; line-height: 1.1; }
.header-logo span { color: #2563eb; }
.header-logo .rmark { color: var(--text2); }
.rmark { font-size: 0.5em; font-weight: 600; vertical-align: super; line-height: 0; margin-left: 1px; letter-spacing: 0; }
.header-sub { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; color: var(--accent-light); letter-spacing: 0.08em; }
.header-acciones { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }
.header-link { color: var(--text2); text-decoration: none; font-size: 0.88rem; font-weight: 500; padding: 0.4rem 0.6rem; border-radius: 8px; }
.header-link:hover { color: var(--text); background: var(--surface2); }
.btn-instalar {
    display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer;
    background: linear-gradient(135deg, var(--boton-a), var(--boton-b)); color: #fff; border: none;
    border-radius: 999px; padding: 0.5rem 1rem; font: 600 0.86rem 'DM Sans', sans-serif;
    box-shadow: 0 6px 18px rgba(99,102,241,0.3);
}
.btn-instalar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Título ── */
.hero { max-width: 1400px; margin: 0 auto; padding: 1.1rem 1.25rem 0.8rem; }
.hero h1 { font-family: 'Syne', sans-serif; font-size: 1.45rem; font-weight: 800; letter-spacing: -0.5px; }
.hero p { color: var(--text2); font-size: 0.93rem; margin-top: 0.15rem; }
.hero strong { color: var(--text); }

/* ── Visor + panel ── */
.app {
    max-width: 1400px; margin: 0 auto; padding: 0 1.25rem 1.5rem;
    display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem;
    height: calc(100vh - 150px); min-height: 540px;
}
.lienzo {
    position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--border);
    background: radial-gradient(ellipse at center, rgba(99,102,241,0.12), #111116 72%);
    min-height: 0;
}
.lienzo.claro { background: radial-gradient(ellipse at center, #ffffff, #d9dae3 80%); }
.lienzo model-viewer { width: 100%; height: 100%; display: block; background: transparent; --poster-color: transparent; }
.lienzo:not(.con-modelo) model-viewer { visibility: hidden; }
.lienzo:fullscreen { border-radius: 0; border: none; }

.vacio { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.lienzo.con-modelo .vacio { display: none; }
.vacio-caja {
    width: min(460px, 100%); text-align: center; padding: 2.2rem 1.6rem;
    border: 1.5px dashed var(--border2); border-radius: 18px; background: rgba(255,255,255,0.015);
    display: flex; flex-direction: column; align-items: center; gap: 0.55rem;
}
.vacio-icono { width: 54px; height: 54px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; margin-bottom: 0.3rem; }
.vacio-titulo { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.12rem; }
.vacio-sub { color: var(--muted); font-size: 0.82rem; }

.soltar {
    position: absolute; inset: 10px; border-radius: 14px; border: 2px dashed var(--accent);
    background: rgba(79,70,229,0.18); display: none; align-items: center; justify-content: center;
    font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.2rem; z-index: 5; pointer-events: none;
}
.soltar.activo { display: flex; }
.cargando {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4;
    background: rgba(17,17,19,0.92); border: 1px solid var(--border2); border-radius: 999px;
    padding: 0.6rem 1.1rem; font-size: 0.9rem; font-weight: 600; color: var(--accent-light); display: none;
}
.cargando.activo { display: block; }
.spinner {
    display: inline-block; width: 15px; height: 15px; border: 2px solid var(--accent);
    border-top-color: transparent; border-radius: 50%; animation: girar 0.7s linear infinite;
    vertical-align: -2px; margin-right: 6px;
}
@keyframes girar { to { transform: rotate(360deg); } }

.btn-lienzo {
    position: absolute; right: 12px; top: 12px; z-index: 3; width: 38px; height: 38px; border-radius: 10px;
    background: rgba(17,17,19,0.85); border: 1px solid var(--border2); color: var(--text); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.btn-lienzo:hover { border-color: var(--accent); }
.btn-lienzo svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
input[type="file"] { display: none; }

.panel { display: flex; flex-direction: column; gap: 0.8rem; overflow-y: auto; min-height: 0; padding-right: 2px; }
.card {
    background: linear-gradient(180deg, rgba(24,24,28,0.92), rgba(17,17,19,0.95));
    border: 1px solid var(--border); border-radius: 16px; padding: 1rem 1.1rem;
}
.card-label {
    font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; font-weight: 600; color: var(--accent-light);
    text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.7rem;
}
.sin-archivo { color: var(--muted); font-size: 0.86rem; margin-bottom: 0.8rem; }
.datos { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 0.8rem; font-size: 0.84rem; margin-bottom: 0.8rem; }
.datos dt { color: var(--muted); }
.datos dd { color: var(--text); text-align: right; overflow-wrap: anywhere; }
#datoMedidas { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; }
.nota-aviso {
    font-size: 0.8rem; color: #fcd34d; background: rgba(250,204,21,0.08); border: 1px solid rgba(250,204,21,0.25);
    border-radius: 10px; padding: 0.55rem 0.7rem; margin-bottom: 0.8rem;
}

.vistas { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.vistas + .vistas { margin-top: 0.45rem; }
.chip {
    background: var(--surface2); color: var(--text); border: 1px solid var(--border2); border-radius: 999px;
    padding: 0.38rem 0.8rem; font: 500 0.82rem 'DM Sans', sans-serif; cursor: pointer;
}
.chip:hover:not(:disabled) { border-color: var(--accent); }
.chip:disabled { color: #5c5c6e; cursor: not-allowed; }

.texto { font-size: 0.86rem; color: var(--text2); margin-bottom: 0.7rem; }
.texto strong { color: var(--text); }
.nota { font-size: 0.75rem; color: var(--muted); margin-top: 0.55rem; }

.btn-principal {
    background: linear-gradient(135deg, var(--boton-a), var(--boton-b)); color: #fff; border: none;
    border-radius: 12px; padding: 0.7rem 1.2rem; font: 700 0.92rem 'Syne', sans-serif; cursor: pointer;
    box-shadow: 0 8px 22px rgba(99,102,241,0.28); transition: transform 0.15s, box-shadow 0.15s;
}
.btn-principal:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(99,102,241,0.42); }
.btn-principal:disabled { background: #3a3a45; color: #9a9aab; box-shadow: none; cursor: not-allowed; }
.btn-sec {
    display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
    background: var(--surface2); color: var(--text); border: 1px solid var(--border2); border-radius: 12px;
    padding: 0.6rem 1rem; font: 600 0.86rem 'DM Sans', sans-serif; cursor: pointer;
}
.btn-sec:hover { border-color: var(--accent); }
.btn-texto { background: none; border: none; color: var(--accent-light); font: 500 0.84rem 'DM Sans', sans-serif; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; margin-top: 0.3rem; }
.btn-whatsapp {
    display: flex; align-items: center; justify-content: center; text-decoration: none;
    background: #25d366; color: #062e16; border-radius: 12px; padding: 0.7rem 1rem;
    font: 700 0.92rem 'DM Sans', sans-serif; margin-bottom: 0.5rem;
}
.btn-whatsapp:hover { filter: brightness(1.06); }
.ancho { width: 100%; }
.fila-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

.qr-fila { display: flex; gap: 0.8rem; align-items: center; margin-bottom: 0.8rem; }
.qr { background: #fff; padding: 6px; border-radius: 10px; flex-shrink: 0; line-height: 0; }
.qr img, .qr canvas { width: 112px; height: 112px; }
.qr-fila .texto { margin: 0; }

.card-instalar ol { padding-left: 1.1rem; font-size: 0.84rem; color: var(--text2); margin-bottom: 0.6rem; }
.card-instalar li { margin-bottom: 0.25rem; }
.card-instalar strong { color: var(--text); }
.card-instalar p { font-size: 0.84rem; color: var(--text2); margin-bottom: 0.6rem; }

/* ── Texto informativo (también lo lee Google) ── */
.info { max-width: 1400px; margin: 0 auto; padding: 1rem 1.25rem 2.5rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.info-bloque { background: rgba(17,17,19,0.7); border: 1px solid var(--border); border-radius: 16px; padding: 1.2rem 1.3rem; }
.info h2 { font-family: 'Syne', sans-serif; font-size: 1.05rem; font-weight: 700; margin-bottom: 0.55rem; }
.info h3 { font-size: 0.88rem; font-weight: 700; margin: 0.7rem 0 0.15rem; }
.info p, .info li { font-size: 0.86rem; color: var(--text2); }
.info strong { color: var(--text); }
.info ol { padding-left: 1.1rem; }
.info li { margin-bottom: 0.35rem; }
/* ── Inicio de sesión ── */
.modal { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.65); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-caja {
    position: relative; width: min(380px, 100%); text-align: center; background: var(--surface);
    border: 1px solid var(--border2); border-radius: 20px; padding: 2rem 1.6rem 1.4rem;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.modal-cerrar { position: absolute; right: 12px; top: 8px; background: none; border: none; color: var(--text2); font-size: 1.6rem; cursor: pointer; line-height: 1; }
.login-logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.5rem; }
.login-logo span { color: #2563eb; }
.login-logo .rmark { color: var(--text2); }
.login-titulo { font-weight: 700; margin-top: 0.4rem; }
.login-sub { font-size: 0.86rem; color: var(--text2); margin: 0.3rem 0 1.1rem; }
.login-boton { display: flex; justify-content: center; min-height: 44px; }
.login-legal { font-size: 0.72rem; color: var(--muted); margin-top: 1rem; }

.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); z-index: 400;
    background: #1f1f25; color: var(--text); border: 1px solid var(--border2); border-radius: 12px;
    padding: 0.7rem 1.1rem; font-size: 0.88rem; max-width: min(560px, calc(100vw - 32px));
    box-shadow: 0 12px 30px rgba(0,0,0,0.45); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.activo { opacity: 1; transform: translateX(-50%) translateY(0); }

.footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 1.2rem 1rem 2rem; border-top: 1px solid var(--border); }
.footer span { color: #2563eb; font-weight: 700; }
.footer .rmark { color: var(--muted); font-weight: 600; }
.footer a { color: var(--text2); }

/* Ventana angosta del computador: el panel pasa debajo del visor */
@media (max-width: 980px) {
    .app { grid-template-columns: 1fr; height: auto; }
    .lienzo { height: 62vh; min-height: 420px; }
    .panel { overflow: visible; }
    .info { grid-template-columns: 1fr; }
}

/* Abierta como app instalada: solo el visor, sin el texto de la página */
@media (display-mode: standalone) {
    .hero, .info, .footer, .header-link { display: none; }
    .app { height: calc(100vh - 72px); padding-top: 1rem; }
}

/* ── Celular: aviso en lugar del visor ── */
.aviso-movil { display: none; }
body.es-movil .app { display: none; }
body.es-movil .aviso-movil {
    display: block; margin: 0 1rem 1rem; padding: 1.4rem 1.3rem; text-align: center;
    background: linear-gradient(180deg, rgba(24,24,28,0.92), rgba(17,17,19,0.95));
    border: 1px solid var(--border); border-radius: 18px;
}
.aviso-movil-icono { font-size: 2rem; margin-bottom: 0.3rem; }
.aviso-movil h2 { font-family: 'Syne', sans-serif; font-size: 1.1rem; margin-bottom: 0.5rem; }
.aviso-movil p { font-size: 0.9rem; color: var(--text2); margin-bottom: 1rem; }
.aviso-movil-botones { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
body.es-movil .hero { padding: 1.1rem 1rem 0.9rem; }
body.es-movil .hero h1 { font-size: 1.3rem; }
body.es-movil .info { grid-template-columns: 1fr; padding: 0 1rem 2rem; }
body.es-movil .btn-instalar { display: none !important; }
