/* Sasmak - Visor por capas y calculadora de materiales (soluciones constructivas)
   Archivo: /calculadoras/sfc-visor.css  ·  Todas las clases con prefijo sfc- y acotadas a .sfc-app */

.sfc-app {
  --sfc-bg: #f4f2ee;
  --sfc-surface: #ffffff;
  --sfc-ink: #1d2427;
  --sfc-muted: #5b6669;
  --sfc-line: #dcd8d0;
  --sfc-accent: #c11b23;
  --sfc-accent-soft: #fbe9ea;
  --sfc-warn: #8a5a00;
  --sfc-warn-soft: #fbf0d9;
  --sfc-ok: #2f6b3a;
  --sfc-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color: var(--sfc-ink);
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
}
.sfc-app *, .sfc-app *::before, .sfc-app *::after { box-sizing: border-box; }
.sfc-app [hidden] { display: none !important; }
.sfc-app .sfc-mono { font-family: var(--sfc-mono); font-variant-numeric: tabular-nums; }
.sfc-app .sfc-muted { color: var(--sfc-muted); }
.sfc-app .sfc-eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: 12px; font-weight: 700; color: var(--sfc-accent); }
.sfc-app .sfc-card { background: var(--sfc-surface); border-radius: 5px; box-shadow: 0 0 10px rgba(0,0,0,.12); }

/* Datos de la cubierta */
.sfc-app .sfc-inputs { padding: 14px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 16px; margin-bottom: 20px; }
.sfc-app .sfc-field label { display: block; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--sfc-muted); margin: 0 0 4px; }
.sfc-app .sfc-field input[type=number] { width: 100%; font: 500 16px var(--sfc-mono); color: var(--sfc-ink); background: var(--sfc-bg); border: 1px solid var(--sfc-line); border-radius: 4px; padding: 7px 9px; height: auto; }
.sfc-app .sfc-field input:focus, .sfc-app button:focus-visible, .sfc-app select:focus { outline: 2px solid var(--sfc-accent); outline-offset: 1px; }
.sfc-app .sfc-hint { font-size: 12px; color: var(--sfc-muted); margin-top: 3px; }
.sfc-app .sfc-result-val { font: 600 22px var(--sfc-mono); padding-top: 2px; }
.sfc-app .sfc-field label.sfc-toggle { display: flex; gap: 8px; align-items: center; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 13px; margin-top: 6px; cursor: pointer; }

/* Zona principal */
.sfc-app .sfc-main { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .sfc-app .sfc-main { grid-template-columns: 1fr; } }
.sfc-app .sfc-viewer { padding: 14px; position: sticky; top: 110px; }
@media (max-width: 900px) { .sfc-app .sfc-viewer { position: static; } }
/* Visor: cabecera, dibujo y mandos */
.sfc-app .sfc-vhead { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 4px; }
.sfc-app .sfc-curname { font-size: 17px; }
.sfc-app .sfc-stage { position: relative; }
.sfc-app .sfc-tip { position: absolute; left: 50%; top: 4px; transform: translateX(-50%); background: var(--sfc-ink); color: #fff; font-size: 13px; padding: 6px 12px; border-radius: 4px; white-space: nowrap; pointer-events: none; transition: opacity .4s; }
.sfc-app .sfc-tip::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--sfc-ink); }
.sfc-app.sfc-touched .sfc-tip { opacity: 0; }
@media (max-width: 480px) { .sfc-app .sfc-tip { white-space: normal; width: 80%; text-align: center; } }
.sfc-app .sfc-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.sfc-app .sfc-ctl { display: flex; align-items: center; gap: 8px; text-align: left; padding: 10px 12px; border-radius: 5px; border: 2px solid var(--sfc-accent); background: var(--sfc-accent); color: #fff; cursor: pointer; font-size: 15px; line-height: 1.25; }
.sfc-app .sfc-ctl svg { flex: none; }
.sfc-app .sfc-ctl small { display: block; font-size: 12px; font-weight: 400; opacity: .9; }
.sfc-app .sfc-ctl:hover:not(:disabled) { background: #9d151c; border-color: #9d151c; }
.sfc-app .sfc-ctl-alt { background: var(--sfc-surface); color: var(--sfc-accent); }
.sfc-app .sfc-ctl-alt:hover:not(:disabled) { background: var(--sfc-accent-soft); color: var(--sfc-accent); }
.sfc-app .sfc-ctl:disabled { border-color: var(--sfc-line); background: var(--sfc-bg); color: var(--sfc-muted); cursor: default; }
.sfc-app:not(.sfc-touched) .sfc-down { animation: sfc-pulse 1.8s ease-in-out 3; }
@keyframes sfc-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(193,27,35,.45); } 50% { box-shadow: 0 0 0 8px rgba(193,27,35,0); } }
@media (max-width: 340px) { .sfc-app .sfc-controls { grid-template-columns: 1fr; } }
.sfc-app .sfc-progress { display: flex; gap: 4px; margin-top: 10px; }
.sfc-app .sfc-progress span { flex: 1; height: 6px; border-radius: 3px; transition: opacity .3s; }
.sfc-app .sfc-progress span.sfc-p-off { opacity: .2; }
.sfc-app .sfc-progress span.sfc-p-cur { box-shadow: 0 0 0 2px var(--sfc-surface), 0 0 0 3px var(--sfc-accent); }
.sfc-app .sfc-help { font-size: 13px; color: var(--sfc-muted); margin: 8px 0 0; }
.sfc-app .sfc-reset { border: 0; background: none; padding: 0; color: var(--sfc-accent); font-weight: 700; text-decoration: underline; cursor: pointer; font-size: 13px; }
.sfc-app .sfc-lyr.sfc-cur:hover { transform: translate(0, -6px); }
.sfc-app svg.sfc-roof { width: 100%; height: auto; display: block; max-width: 100%; }
.sfc-app .sfc-lyr { cursor: pointer; transition: transform .55s cubic-bezier(.3,.7,.2,1), opacity .45s ease; }
.sfc-app .sfc-lyr.sfc-off { transform: translate(30px, -140px); opacity: 0; pointer-events: none; }
.sfc-app .sfc-topface { stroke-width: 0; }
.sfc-app .sfc-lyr.sfc-cur .sfc-topface { stroke: var(--sfc-accent); stroke-width: 2.5; }
.sfc-app .sfc-pin { transition: transform .5s cubic-bezier(.3,.7,.2,1); }
.sfc-app .sfc-pin circle { fill: var(--sfc-accent); stroke: #fff; stroke-width: 2.5; }
.sfc-app .sfc-pin text { fill: #fff; font: 700 13px var(--sfc-mono); text-anchor: middle; dominant-baseline: central; }
.sfc-app .sfc-pin line { stroke: var(--sfc-accent); stroke-width: 2; }
@media (prefers-reduced-motion: reduce) { .sfc-app .sfc-lyr, .sfc-app .sfc-pin { transition: none; } .sfc-app .sfc-down { animation: none !important; } }

.sfc-app .sfc-stack { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.sfc-app .sfc-stack button { width: 100%; display: grid; grid-template-columns: 22px 14px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px; border: 0; border-radius: 4px; background: transparent; color: var(--sfc-ink); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; }
.sfc-app .sfc-stack button:hover { background: var(--sfc-bg); }
.sfc-app .sfc-stack .sfc-n { font: 500 12px var(--sfc-mono); color: var(--sfc-muted); }
.sfc-app .sfc-sw { display: inline-block; width: 14px; height: 14px; border-radius: 2px; }
.sfc-app .sfc-stack .sfc-st { font-size: 12px; color: var(--sfc-muted); }
.sfc-app .sfc-stack li.sfc-cur button { background: var(--sfc-accent-soft); font-weight: 700; }
.sfc-app .sfc-stack li.sfc-cur .sfc-n { color: var(--sfc-accent); }
.sfc-app .sfc-stack li.sfc-gone button { color: var(--sfc-muted); }
.sfc-app .sfc-stack li.sfc-gone .sfc-sw { opacity: .35; }
.sfc-app .sfc-stack li.sfc-gone .sfc-name { text-decoration: line-through; }

/* Ficha de capa */
.sfc-app .sfc-panel { padding: 18px 18px 20px; min-width: 0; }
.sfc-app .sfc-panel h3 { font-size: 26px; margin: 2px 0 0; line-height: 1.15; }
.sfc-app .sfc-lead { margin: 8px 0 0; }
.sfc-app .sfc-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.sfc-app .sfc-facts li { font: 500 12px var(--sfc-mono); background: var(--sfc-bg); border: 1px solid var(--sfc-line); border-radius: 3px; padding: 3px 7px; }
.sfc-app .sfc-prods { display: grid; gap: 10px; margin-top: 16px; }
.sfc-app .sfc-prod { border: 1px solid var(--sfc-line); border-radius: 5px; padding: 12px 14px; display: grid; gap: 8px; }
.sfc-app .sfc-prod.sfc-sel { border-color: var(--sfc-accent); box-shadow: 0 0 0 1px var(--sfc-accent) inset; }
.sfc-app label.sfc-prod-head { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; text-align: left; margin: 0; font-weight: 400; }
.sfc-app .sfc-prod-head input { margin-top: 4px; accent-color: var(--sfc-accent); width: 17px; height: 17px; flex: none; }
.sfc-app .sfc-prod-head .sfc-t { font-weight: 700; }
.sfc-app .sfc-prod-head .sfc-d { font-size: 13px; color: var(--sfc-muted); }
.sfc-app .sfc-opt { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; padding-left: 27px; }
.sfc-app .sfc-opt label { text-align: left; margin: 0; }
.sfc-app .sfc-opt select { font: 500 14px var(--sfc-mono); color: var(--sfc-ink); background: var(--sfc-bg); border: 1px solid var(--sfc-line); border-radius: 4px; padding: 4px 6px; width: auto; height: auto; }
.sfc-app .sfc-calc { margin-left: 27px; background: var(--sfc-bg); border-radius: 4px; padding: 10px 12px; display: grid; gap: 6px; }
.sfc-app .sfc-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.sfc-app .sfc-big { font: 600 20px var(--sfc-mono); }
.sfc-app .sfc-how { font: 400 12px var(--sfc-mono); color: var(--sfc-muted); overflow-wrap: anywhere; }
.sfc-app .sfc-extra { border-top: 1px solid var(--sfc-line); padding-top: 6px; }
.sfc-app .sfc-tag { font-size: 11px; font-weight: 700; color: var(--sfc-warn); background: var(--sfc-warn-soft); padding: 1px 6px; border-radius: 3px; }
.sfc-app .sfc-empty { margin-top: 16px; padding: 14px; border: 1px dashed var(--sfc-line); border-radius: 5px; color: var(--sfc-muted); }

/* Lista de materiales */
.sfc-app .sfc-summary { margin-top: 24px; padding: 18px; }
.sfc-app .sfc-sum-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.sfc-app .sfc-sum-head h3 { font-size: 24px; margin: 2px 0 0; }
.sfc-app .sfc-btn { font-weight: 700; font-size: 14px; background: var(--sfc-accent); color: #fff; border: 0; border-radius: 4px; padding: 10px 16px; cursor: pointer; }
.sfc-app .sfc-btn:hover { background: #9d151c; }
.sfc-app .sfc-copied { font-size: 13px; color: var(--sfc-ok); margin-right: 10px; }
.sfc-app .sfc-tblwrap { overflow-x: auto; }
.sfc-app table.sfc-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; margin: 0; }
.sfc-app .sfc-table th { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--sfc-muted); text-align: left; padding: 8px; border-bottom: 2px solid var(--sfc-line); background: none; }
.sfc-app .sfc-table td { padding: 9px 8px; border-bottom: 1px solid var(--sfc-line); vertical-align: top; text-align: left; }
.sfc-app .sfc-table .sfc-q { font: 600 15px var(--sfc-mono); text-align: right; white-space: nowrap; }
.sfc-app .sfc-table th.sfc-q { font-family: inherit; font-size: 12px; font-weight: 700; }
.sfc-app .sfc-table td .sfc-sw { width: 10px; height: 10px; margin-right: 6px; }
.sfc-app .sfc-notes { margin-top: 14px; font-size: 13px; color: var(--sfc-muted); }
.sfc-app .sfc-error { padding: 16px; border: 1px dashed var(--sfc-accent); border-radius: 5px; color: var(--sfc-accent); }
