/* Configurador 3D de cerámica (marca blanca) — estilos */
:root {
  --teal: #1F6F50; --teal-d: #17553d; --teal-bg: #e6f2ec;
  --ink: #121212; --ink-2: #2e3234; --grey: #6f7679; --line: #e3e6e5; --bg: #f4f4f2; --card: #ffffff;
  --bad: #d9453b; --bad-bg: #fdecea; --warn: #d98b1e; --warn-bg: #fff4e3; --ok: #2f9d6c; --ok-bg: #e6f6ee; --note: #4b6a8a; --note-bg: #eaf1f8;
  --radius: 12px; --shadow: 0 6px 24px rgba(20, 30, 32, .10);
  --panel-w: 440px; --top-h: 64px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif; font-size: 14px; color: var(--ink); background: var(--bg); overflow: hidden; }
button { font: inherit; cursor: pointer; } input, textarea, select { font: inherit; }
b { font-weight: 600; } .muted { color: var(--grey); } .small { font-size: 12px; } [hidden] { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Carga */
#loading { position: fixed; inset: 0; z-index: 50; background: var(--ink); color: #fff; display: grid; place-content: center; text-align: center; gap: 16px; transition: opacity .5s; }
#loading.hide { opacity: 0; pointer-events: none; }
#loading .load-logo { height: 44px; margin: 0 auto 6px; }
#loading .spinner { width: 42px; height: 42px; border: 3px solid rgba(255,255,255,.15); border-top-color: #fff; border-radius: 50%; margin: 0 auto; animation: spin 1s linear infinite; }
#loading .err { background: #fff; color: var(--ink); padding: 20px 26px; border-radius: 12px; line-height: 1.6; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Cabecera */
.topbar { height: var(--top-h); background: var(--ink); color: #fff; display: flex; align-items: center; gap: 18px; padding: 0 18px; border-bottom: 1px solid #2c2c2c; }
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.logo { height: 30px; width: auto; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; border-left: 1px solid #3a3a3a; padding-left: 14px; }
.brand-txt b { font-size: 14px; letter-spacing: .3px; } .brand-txt span { font-size: 11px; color: #a9a9a9; }
.menus { display: flex; gap: 4px; margin-left: 8px; }
.menu { position: relative; }
.menu-btn { background: transparent; border: 0; color: #d9d9d9; display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.menu-btn:hover, .menu-btn.open { background: #262626; color: #fff; }
.menu-btn svg { width: 17px; height: 17px; }
.badge { background: var(--teal); color: #fff; border-radius: 999px; font-size: 10px; font-style: normal; padding: 1px 6px; margin-left: 2px; }
.dropdown { position: absolute; top: 100%; left: 0; margin-top: 6px; background: #fff; color: var(--ink); border-radius: 10px; box-shadow: var(--shadow); min-width: 250px; padding: 6px; z-index: 40; display: flex; flex-direction: column; }
.dropdown button { background: transparent; border: 0; text-align: left; padding: 9px 12px; border-radius: 7px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.dropdown button:hover { background: var(--bg); } .dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.dd-title { font-size: 11px; color: var(--grey); text-transform: uppercase; letter-spacing: .5px; padding: 6px 12px 2px; }
.topbar-mid { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 10px; border-radius: 999px; background: #262626; color: #ddd; }
.status.ok { color: #9be3c0; } .status.warn { color: #ffd28a; } .status.bad { color: #ff9a92; }
.status svg { width: 14px; height: 14px; }
.icon-btn { background: transparent; border: 1px solid #3a3a3a; color: #ddd; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; }
.icon-btn:hover { background: #262626; } .icon-btn svg { width: 17px; height: 17px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.price-box { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; margin-right: 6px; }
.price-box b { font-size: 17px; } .price-box span { font-size: 11px; color: #a9a9a9; }
.btn { border-radius: 8px; padding: 9px 14px; font-weight: 600; font-size: 13px; border: 1px solid transparent; white-space: nowrap; }
.btn.primary { background: var(--teal); color: #fff; } .btn.primary:hover { background: var(--teal-d); } .btn.primary:disabled { background: #555; color: #bbb; cursor: not-allowed; }
.btn.ghost { background: transparent; border-color: #3f3f3f; color: #eee; } .btn.ghost:hover { background: #262626; }
.modal .btn.ghost, .panel .btn.ghost, .photo-tool .btn.ghost { color: var(--ink); border-color: var(--line); background: #fff; } .modal .btn.ghost:hover, .panel .btn.ghost:hover { background: var(--bg); }
.btn.small { padding: 6px 10px; font-size: 12px; }
.only-mobile { display: none; }

/* Layout */
.app { display: grid; grid-template-columns: 1fr var(--panel-w); height: calc(100% - var(--top-h)); }
.viewer { position: relative; background: #d8d4cc; overflow: hidden; }
#scene { position: absolute; inset: 0; } #scene canvas { display: block; width: 100% !important; height: 100% !important; }
.overlay { position: absolute; z-index: 5; pointer-events: none; } .overlay > * { pointer-events: auto; }
.overlay.top-left { left: 14px; top: 14px; display: flex; flex-direction: column; gap: 8px; max-width: 52%; }
.overlay.top-right { right: 14px; top: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.overlay.bottom { left: 0; right: 0; bottom: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chip-info { background: rgba(255,255,255,.92); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; box-shadow: var(--shadow); line-height: 1.5; }
.chip-info b { color: var(--ink); }
#overlayIssues { display: flex; flex-direction: column; gap: 6px; }
.issue { background: var(--bad-bg); color: #8a1d16; border-left: 3px solid var(--bad); border-radius: 8px; padding: 7px 10px; font-size: 12px; box-shadow: var(--shadow); }
.issue.warn { background: var(--warn-bg); color: #7a4b05; border-left-color: var(--warn); }
.issue svg, .status svg { width: 14px; height: 14px; vertical-align: -2px; flex: none; }
.seg { display: inline-flex; background: rgba(255,255,255,.92); border-radius: 10px; padding: 3px; box-shadow: var(--shadow); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 11px; border-radius: 8px; font-size: 12.5px; color: var(--ink-2); }
.seg button.active { background: var(--ink); color: #fff; } .seg button:disabled { opacity: .4; cursor: not-allowed; }
.toolbar { display: flex; gap: 4px; background: rgba(255,255,255,.94); border-radius: 12px; padding: 5px; box-shadow: var(--shadow); align-items: center; flex-wrap: wrap; justify-content: center; }
.tool { border: 0; background: transparent; border-radius: 9px; padding: 6px 9px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--ink-2); min-width: 56px; }
.tool svg { width: 20px; height: 20px; } .tool:hover { background: var(--bg); } .tool.active { background: var(--ink); color: #fff; }
.sep { width: 1px; height: 30px; background: var(--line); margin: 0 3px; }
.hint { margin: 0; font-size: 11px; color: #555; background: rgba(255,255,255,.7); padding: 3px 10px; border-radius: 999px; }
.credit { position: absolute; right: 12px; bottom: 10px; z-index: 6; display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.9); border-radius: 999px; padding: 4px 10px 4px 12px; text-decoration: none; color: var(--grey); font-size: 10.5px; font-weight: 600; }
.credit img { height: 20px; }
.present-exit { display: none; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 8; background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 999px; padding: 8px 14px; font-size: 12px; }
body.present .panel, body.present .topbar, body.present .overlay.top-left, body.present .overlay.bottom .hint, body.present .credit { display: none; }
body.present .app { grid-template-columns: 1fr; height: 100%; } body.present .present-exit { display: block; }
body.embed .topbar .menus, body.embed .topbar .brand-txt { display: none; }
.demo-badge { margin-top: 8px; background: rgba(18,18,18,.85); color: #fff; font-size: 11px; border-radius: 999px; padding: 5px 12px; width: max-content; max-width: 100%; backdrop-filter: blur(6px); } .demo-badge b { color: #9fd8bd; }
.dim-label { background: rgba(255,255,255,.92); border-radius: 6px; padding: 2px 7px; font-size: 11px; font-weight: 600; color: var(--ink); white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.dim-label.panel { font-weight: 500; font-size: 10.5px; color: var(--ink-2); }

/* Panel */
.panel { background: var(--card); border-left: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; }
.step { border-bottom: 1px solid var(--line); }
.step > header { display: flex; align-items: center; gap: 12px; padding: 13px 16px; cursor: pointer; user-select: none; }
.step > header:hover { background: #fafaf9; }
.step > header > .num { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.step.done > header > .num { background: var(--teal); }
.step > header b { font-size: 14px; } .step > header small { display: block; color: var(--grey); font-size: 12px; margin-top: 1px; }
.step > header .chev { margin-left: auto; width: 16px; height: 16px; transition: transform .2s; color: var(--grey); }
.step.open > header .chev { transform: rotate(180deg); }
.step .body { display: none; padding: 4px 16px 18px; }
.step.open .body { display: block; }
.field { margin: 12px 0 0; } .field > label, .lbl { display: block; font-size: 12px; color: var(--grey); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; color: var(--ink-2); }
.chip:hover { border-color: #bbb; } .chip.active { background: var(--ink); color: #fff; border-color: var(--ink); } .chip:disabled { opacity: .4; cursor: not-allowed; }
.chip.warn { border-color: var(--warn); color: #7a4b05; }
.dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dims label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--grey); }
.dims input { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; width: 100%; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 5px 0; } .check input { width: 16px; height: 16px; accent-color: var(--teal); }
.surf-list { display: flex; flex-direction: column; gap: 6px; }
.surf-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.surf-row select { border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; font-size: 12px; }
.coll-card { display: grid; grid-template-columns: 82px 1fr; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-top: 12px; background: #fafaf9; }
.coll-card img { width: 82px; height: 82px; object-fit: cover; border-radius: 8px; }
.coll-card .name { font-size: 15px; font-weight: 700; } .coll-card .fam { font-size: 12px; color: var(--grey); }
.coll-card .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag { font-size: 10.5px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; color: var(--ink-2); }
.tag.hi { background: var(--teal-bg); border-color: #cfe4d8; color: var(--teal-d); }
.coll-card .btn { margin-top: 8px; justify-self: start; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.swatch { border: 2px solid transparent; border-radius: 10px; padding: 3px; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-2); }
.swatch img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.swatch.active { border-color: var(--ink); } .swatch:hover img { filter: brightness(1.05); }
.swatch span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmt-list { display: flex; flex-wrap: wrap; gap: 6px; }
.fmt { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 6px 10px; font-size: 12px; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.fmt b { font-size: 13px; } .fmt small { color: var(--grey); } .fmt.active { border-color: var(--ink); background: var(--ink); color: #fff; } .fmt.active small { color: #ccc; }
.jcolors { display: flex; gap: 6px; flex-wrap: wrap; }
.jcolor { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.jcolor.active { box-shadow: 0 0 0 2px var(--ink); }
.amb-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.amb-strip img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.wall-tabs { display: flex; gap: 4px; margin-top: 12px; }
.wall-tabs button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 4px; font-size: 12px; }
.wall-tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); } .wall-tabs button.off { color: #aaa; }
.mat-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 10px; }
.mat-table th { text-align: left; font-size: 11px; color: var(--grey); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.mat-table td { padding: 6px 6px; border-bottom: 1px solid #f0f0ee; vertical-align: top; }
.mat-table th:first-child { width: 46%; }
.mat-table .sw { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.mat-table td.first { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: start; } .mat-table td.num, .mat-table th.num { text-align: right; white-space: nowrap; }
.mat-table tfoot td { font-weight: 700; border-top: 2px solid var(--ink); }
.total-box { background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 14px; margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.total-box b { font-size: 20px; } .total-box span { font-size: 11px; color: #bbb; display: block; }
.notes { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.note { background: var(--note-bg); color: #27425c; border-radius: 8px; padding: 7px 10px; font-size: 12px; border-left: 3px solid var(--note); }
.note.warn { background: var(--warn-bg); color: #7a4b05; border-left-color: var(--warn); } .note.bad { background: var(--bad-bg); color: #8a1d16; border-left-color: var(--bad); }
.range-row { display: grid; grid-template-columns: 1fr 2fr auto; align-items: center; gap: 10px; font-size: 13px; margin-top: 8px; }
.range-row input { accent-color: var(--teal); }
.paints { display: flex; gap: 6px; flex-wrap: wrap; } .paint { width: 30px; height: 30px; border-radius: 8px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; } .paint.active { box-shadow: 0 0 0 2px var(--ink); }
.demo-tag { display: inline-block; background: #fff1d6; color: #8a5a00; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; letter-spacing: .4px; vertical-align: middle; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(10,10,10,.55); z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: min(640px, 100%); max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal.wide { width: min(900px, 100%); } .modal.xl { width: min(1240px, 100%); height: 92vh; }
.modal header { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); } .modal header h2 { margin: 0; font-size: 16px; }
.modal header .x { margin-left: auto; border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--grey); }
.modal-body { padding: 16px 18px; overflow: auto; flex: 1; } .modal footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.modal footer .btn.primary { background: var(--teal); } .modal p { margin: 6px 0; line-height: 1.5; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--grey); }
.form input, .form textarea, .form select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; color: var(--ink); } .form .full { grid-column: 1 / -1; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; opacity: 0; transition: .3s; z-index: 70; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; } .table th, .table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); } .table th { font-size: 11px; color: var(--grey); text-transform: uppercase; }
.table td.num, .table th.num { text-align: right; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; } .kpi { background: var(--bg); border-radius: 10px; padding: 10px 12px; } .kpi b { font-size: 20px; display: block; } .kpi span { font-size: 11px; color: var(--grey); }
.bars { display: flex; flex-direction: column; gap: 5px; margin: 8px 0 14px; } .bar { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 8px; font-size: 12px; } .bar i { display: block; height: 10px; background: var(--teal); border-radius: 5px; } .bar span:last-child { text-align: right; color: var(--grey); }
pre.code { background: var(--ink); color: #e8e8e8; padding: 12px; border-radius: 10px; font-size: 12px; overflow: auto; }

/* Selector de colecciones */
.picker { display: grid; grid-template-columns: 230px 1fr; gap: 16px; height: 100%; }
.picker-filters { display: flex; flex-direction: column; gap: 10px; }
.picker-filters input, .picker-filters select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; width: 100%; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); grid-auto-rows: max-content; gap: 10px; align-content: start; overflow: auto; }
.pcard { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; text-align: left; padding: 0; display: flex; flex-direction: column; }
.pcard img { width: 100%; aspect-ratio: 4/3; object-fit: cover; } .pcard .pc-body { padding: 8px 10px; } .pcard .pc-name { font-weight: 700; font-size: 13px; } .pcard .pc-fam { font-size: 11px; color: var(--grey); }
.pcard .pc-sizes { font-size: 11px; color: var(--ink-2); margin-top: 3px; } .pcard:hover { border-color: var(--ink); } .pcard.active { outline: 2px solid var(--ink); }
.pcard .pc-flags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.picker-detail { border-left: 1px solid var(--line); padding-left: 16px; overflow: auto; }
.picker-detail h3 { margin: 0 0 2px; font-size: 18px; } .picker-detail .amb { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; margin: 8px 0; }
.picker.with-detail { grid-template-columns: 230px 1fr 340px; }
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: 10px; display: block; margin: 0 auto; }

/* Editor de planta */
.plan-tool { display: grid; grid-template-columns: 310px 1fr; gap: 16px; height: 100%; min-height: 520px; }
.plan-side { display: flex; flex-direction: column; gap: 8px; overflow: auto; } .plan-side p { margin: 4px 0; }
.plan-stage { position: relative; background: #fbfbfa; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-height: 420px; }
.plan-stage canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.plan-stage .legend { position: absolute; left: 10px; bottom: 8px; display: flex; gap: 10px; font-size: 11px; background: rgba(255,255,255,.9); border-radius: 8px; padding: 4px 8px; flex-wrap: wrap; } .plan-stage .legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
.seg-table { width: 100%; border-collapse: collapse; font-size: 12px; } .seg-table td { padding: 3px 4px; border-bottom: 1px solid #f0f0ee; } .seg-table input { width: 64px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; text-align: right; } .seg-table select { border: 1px solid var(--line); border-radius: 6px; padding: 3px 4px; font-size: 11.5px; max-width: 120px; }
.seg-table tr.sel td { background: var(--teal-bg); }
@media (max-width: 1000px) { .plan-tool { grid-template-columns: 1fr; } .plan-stage { min-height: 320px; } }

/* Fotomontaje */
.photo-tool { display: grid; grid-template-columns: 300px 1fr; gap: 16px; height: 100%; }
.photo-side { display: flex; flex-direction: column; gap: 8px; overflow: auto; } .photo-side p { margin: 4px 0; }
.photo-stage { position: relative; background: #1a1a1a; border-radius: 10px; overflow: hidden; display: grid; place-items: center; min-height: 420px; }
.photo-stage canvas { max-width: 100%; max-height: 100%; display: block; }
.photo-stage .corner { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--teal); transform: translate(-50%, -50%); cursor: grab; z-index: 3; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.photo-stage svg.quad { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; } .photo-stage svg.quad polygon { fill: rgba(31,111,80,.08); stroke: #1F6F50; stroke-width: 2; stroke-dasharray: 6 4; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.gal-item { border: 2px solid transparent; border-radius: 8px; padding: 0; background: transparent; overflow: hidden; }
.gal-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; border-radius: 6px; } .gal-item span { display: block; font-size: 10.5px; padding: 3px 4px; text-align: left; color: var(--ink-2); }
.gal-item.active { border-color: var(--ink); }
.file { display: inline-block; text-align: center; }
.ar-modal { display: grid; grid-template-columns: 220px 1fr; gap: 18px; } .ar-modal .qr svg { width: 100%; height: auto; } .ar-txt ol { padding-left: 18px; } .ar-txt textarea { width: 100%; font-size: 11px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .compare img { width: 100%; border-radius: 10px; } .compare h4 { margin: 0 0 6px; }
.saved-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; } .saved-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; } .saved-item img { width: 100%; aspect-ratio: 16/10; object-fit: cover; } .saved-item .si-body { padding: 8px 10px; font-size: 12px; }

.price-box b { white-space: nowrap; }
@media (max-width: 1500px) { .brand-txt { display: none; } .menu-btn span { display: none; } .menu-btn svg { width: 19px; height: 19px; } }
@media (max-width: 1250px) { :root { --panel-w: 380px; } .topbar { gap: 10px; padding: 0 12px; } #btnPdf, #btnSample { display: none; } .price-box span { display: none; } }
@media (max-width: 1000px) {
  :root { --panel-w: 100%; --top-h: 58px; }
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .panel { position: fixed; left: 0; right: 0; bottom: 0; top: var(--top-h); z-index: 30; transform: translateY(100%); transition: transform .25s; }
  body.panel-open .panel { transform: none; }
  .only-mobile { display: grid; } .brand-txt, .menus, .topbar-mid, #btnPdf, #btnSample, .price-box { display: none; }
  .tool { min-width: 42px; font-size: 9px; padding: 5px 6px; } .tool svg { width: 18px; height: 18px; } .hint { display: none; } .credit { display: none; }
  .overlay.top-left { top: 62px; max-width: 70%; } .chip-info { display: none; } .overlay.top-right .seg button { padding: 6px 8px; font-size: 12px; }
  .overlay.bottom { bottom: 6px; } .toolbar { gap: 2px; padding: 4px; margin: 0 6px; } .sep { display: none; }
  .picker, .photo-tool, .ar-modal, .compare { grid-template-columns: 1fr; } .picker.with-detail { grid-template-columns: 1fr; } .modal.xl { height: auto; max-height: 92vh; }
  .photo-stage { min-height: 260px; }
}

/* v2 · suelos de lamas */
.kind-seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.kind-seg button { flex: 1; border: 0; background: #fff; padding: 8px 6px; font-size: 12px; color: var(--ink-2); }
.kind-seg button.active { background: var(--ink); color: #fff; }
.layers { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; background: #fafaf9; }
.layers summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.layers ol { margin: 8px 0 2px; padding-left: 18px; color: var(--ink-2); line-height: 1.5; }
.mat-table.extras { margin-top: 6px; } .mat-table.extras th:first-child { width: 72%; }
body.modo-suelos .topbar .brand-txt span { color: #b9c9bf; }
/* v3 (8-oct): las etiquetas 3D con la clase «panel» (rótulos de suelo y paredes con las cotas) heredaban en <= 1000 px el estilo
   del panel lateral (fijo, de lado a lado y hasta abajo, fondo blanco) y tapaban la escena. Vuelven a ser etiquetas. */
.dim-label.panel { top: auto; right: auto; bottom: auto; left: auto; width: auto; height: auto; z-index: auto; transition: none; overflow: visible; border-left: 0; display: block; }

/* ---------- 8-oct (segunda revisión): ayuda táctil y sitio para la insignia de Grup3D */
.hint .h-tactil { display: none; }
@media (pointer: coarse) { .hint .h-raton { display: none; } .hint .h-tactil { display: inline; } }
@media (max-width: 600px) { .hint { display: none; } }   /* en el móvil no cabe junto a la insignia */
@media (min-width: 601px) and (max-width: 900px) { .hint { max-width: calc(100vw - 260px); text-align: center; line-height: 1.35; border-radius: 12px; } }
@media (min-width: 901px) { .overlay.bottom .hint { max-width: 46%; text-align: center; line-height: 1.35; border-radius: 12px; } }   /* el texto largo pisaba la insignia */

/* v5 (8-oct) · móvil */
/* Vale para los dos modos (/ = cerámica, /?modo=suelos = suelos). Solo disposición y tamaños. */
@media (max-width: 1000px) {
  .topbar-right { margin-left: auto; }                 /* en tableta el botón y el menú quedaban pegados al logo (el bloque central va oculto) */
  .topbar .btn { min-height: 36px; } .icon-btn.only-mobile { width: 36px; height: 36px; }
  .overlay.top-right { max-width: calc(100% - 28px); }
  .overlay.top-right .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .overlay.top-right .seg::-webkit-scrollbar { display: none; }
  .overlay.top-right .seg button { min-height: 36px; padding: 6px 10px; font-size: 12.5px; white-space: nowrap; }   /* pestañas de vista pulsables (antes 28 px) */
  .tool { min-height: 36px; }
  .chip, .fmt, .kind-seg button, .wall-tabs button, .tag { min-height: 32px; } .tag { display: inline-flex; align-items: center; }
  .panel .btn, .modal .btn { min-height: 36px; }
  .credit span { display: none; }                      /* la insignia solo con el logo (como cerramientos y piscinas) */
  .dims input, .surf-row select, .form input, .form textarea, .form select, .picker-filters input, .picker-filters select, .seg-table input, .seg-table select, .ar-txt textarea, .modal textarea { font-size: 16px; }   /* el iPhone no hace zoom al tocar */
  .panel .btn { white-space: normal; text-align: left; line-height: 1.3; }   /* «Planta a medida: forma libre…» se salía del panel a 360-390 px */
  .form label.check { flex-direction: row; align-items: flex-start; }        /* casilla de privacidad al lado del texto, no encima */
}
/* Teléfono: la tabla de material del paso 5 (6 columnas) se salía del panel a 360-390 px */
@media (max-width: 600px) {
  .mat-table { font-size: 11.5px; }
  .mat-table th:first-child { width: 36%; }
  .mat-table th, .mat-table td { padding: 6px 4px; }
  .mat-table td.num, .mat-table th.num { white-space: normal; }
  .mat-table .sw { width: 32px; height: 32px; }
  .mat-table td.first { grid-template-columns: 32px 1fr; gap: 6px; }
}
/* Tableta vertical (768–1000 px): la ayuda táctil y la insignia «Desarrollado por Grup3D» vuelven a verse, igual que en
   cerramientos y piscinas; la ayuda ya tiene ancho máximo que deja libre la insignia. */
@media (min-width: 768px) and (max-width: 1000px) {
  .hint { display: block; }
  .credit { display: inline-flex; }
  .overlay.bottom { bottom: 10px; }
}
/* Teléfono: ventanas (elegir suelo / colección, pedir muestra, presupuesto…) a una columna y que caben a 360 px. */
@media (max-width: 600px) {
  .modal-bg { padding: 10px; }
  .modal { max-height: 96vh; }
  .modal header, .modal-body, .modal footer { padding-left: 14px; padding-right: 14px; }
  .modal footer { flex-wrap: wrap; }
  .form { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .picker-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
