:root {
  --navy: #1f2a5c;
  --navy-active: #3b4693;
  --orange: #ee8a2f;
  --fondo: #f5f6f8;
  --card: #ffffff;
  --borde: #e5e7eb;
  --texto: #1f2433;
  --texto-suave: #6b7280;
  --stock-hay: #1f8a4c;
  --stock-camino: #ee8a2f;
  --stock-sin: #9ca3af;
  --sel: #f0f2fa;
  --radio: 12px;
  --sidebar: 76px;
  --topbar: 64px;
  --fuente: "Inter", "Segoe UI", sans-serif;
}

/* Login gate */
html.auth-locked .shell { visibility: hidden; }
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(59, 70, 147, 0.18), transparent 55%),
    linear-gradient(160deg, #eef0f6 0%, #f7f8fb 45%, #ebe7df 100%);
}
.auth-gate[hidden] { display: none !important; }
.auth-card {
  width: min(100%, 22rem);
  background: var(--card);
  border: 1px solid var(--borde);
  border-radius: 16px;
  padding: 1.5rem 1.35rem 1.35rem;
  box-shadow: 0 18px 40px rgba(31, 42, 92, 0.08);
  display: grid;
  gap: 0.65rem;
}
.auth-logo { margin: 0 auto 0.15rem; display: block; }
.auth-card h1 {
  margin: 0;
  text-align: center;
  font-size: 1.25rem;
  color: var(--navy);
  font-weight: 800;
}
.auth-sub {
  margin: -0.25rem 0 0.35rem;
  text-align: center;
  color: var(--texto-suave);
  font-size: 0.9rem;
}
.auth-label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
}
.auth-label input {
  min-height: 2.6rem;
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  background: #fff;
}
.auth-error {
  margin: 0;
  color: #b42318;
  font-size: 0.86rem;
  text-align: center;
}
.auth-submit { width: 100%; min-height: 2.7rem; margin-top: 0.2rem; }
.btn-logout {
  border: 0;
  background: transparent;
  color: var(--texto-suave);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
}
.btn-logout:hover { color: var(--navy); background: var(--sel); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--fuente);
  color: var(--texto);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(31, 42, 92, 0.28);
  outline-offset: 2px;
}

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.85rem 0.4rem 1rem;
  z-index: 30;
}
.sidebar-logo {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; object-position: center;
  background: transparent;
  border: 0;
  margin-bottom: 1rem;
  display: block;
}
.sidebar-nav {
  display: flex; flex-direction: column; gap: 0.35rem; width: 100%;
  flex: 1;
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  width: 100%;
  border: 0; background: transparent; color: rgba(255,255,255,.78);
  border-radius: 10px; padding: 0.55rem 0.2rem;
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.01em;
  text-decoration: none;
}
.nav-btn svg { opacity: 0.95; }
.nav-btn.is-active, .nav-btn[aria-current="page"] {
  background: var(--navy-active); color: #fff;
}
.nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.nav-lock { margin-top: auto; }

.main {
  min-width: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex: none;
  height: var(--topbar);
  background: #fff;
  border-bottom: 1px solid var(--borde);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.1rem;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title {
  font-size: 1rem; color: var(--texto-suave);
}
.topbar-title strong {
  color: var(--navy); font-weight: 800; font-size: 1.05rem;
}
.agent-chip {
  display: flex; align-items: center; gap: 0.55rem;
  font-weight: 600; color: var(--navy);
}
.agent-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--navy); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.9rem;
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(300px, 1.2fr) minmax(260px, 0.95fr);
  gap: 0.85rem;
  padding: 0.85rem;
  align-items: stretch;
}

.panel {
  background: var(--card);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  min-height: 0;
  overflow: auto;
  padding: 0.85rem;
}
.panel-ficha, .panel-presupuesto {
  position: sticky;
  top: calc(var(--topbar) + 0.85rem);
  max-height: calc(100dvh - var(--topbar) - 1.7rem);
  align-self: start;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  align-items: start;
}
.ac-field {
  position: relative;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 10px;
}
.ac-field:focus-within {
  border-color: var(--navy);
  outline: 3px solid rgba(31, 42, 92, 0.18);
  outline-offset: 1px;
}
.ac-ghost {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  padding: 0.4rem 0.7rem;
  font-family: inherit;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.25;
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
  color: transparent;
}
.ac-ghost .ac-match { color: transparent; }
.ac-ghost .ac-hint { color: #b0b6c3; }
#q, .chip-filter select, .chip-filter input, .sheet-card input {
  width: 100%;
  min-height: 2.6rem;
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  background: #fff;
  font-weight: 500;
}
#q {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  caret-color: var(--navy);
  outline: none;
}
#q:focus {
  outline: none;
  border-color: transparent;
}
.chip-filter select:focus, .chip-filter input:focus {
  border-color: var(--navy);
}
.ac-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(31, 42, 92, 0.12);
  max-height: 18rem;
  overflow: auto;
  padding: 0.25rem;
}
.ac-item {
  display: grid;
  grid-template-columns: 4.6rem 1fr auto;
  gap: 0.45rem;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--texto);
}
.ac-item:hover, .ac-item.is-active {
  background: var(--sel);
}
.ac-kind {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--texto-suave);
}
.ac-text {
  font-weight: 650;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ac-n {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--fondo);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}
.btn-primary {
  min-height: 2.6rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}
.btn-primary:hover { background: var(--navy-active); }
.btn-ghost {
  margin-top: 0.45rem;
  width: 100%;
  min-height: 2.2rem;
  border: 1px dashed var(--borde);
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font-weight: 600;
}

.filters.chips {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-top: 0.65rem;
}
.chip-filter {
  display: flex; flex-direction: column; gap: 0.15rem;
  font-size: 0.7rem; font-weight: 700; color: var(--texto-suave);
  min-width: 6.5rem; flex: 1 1 6.5rem;
}
.chip-check {
  flex-direction: row; align-items: center; gap: 0.4rem;
  min-height: 2.4rem; padding: 0.2rem 0.45rem;
  border: 1px solid var(--borde); border-radius: 10px; background: #fff;
}
.chip-check input { width: auto; min-height: auto; }
.compare-bar {
  display: flex; gap: 0.4rem; margin-top: 0.45rem;
}
.compare-bar .btn-ghost { margin: 0; width: auto; padding: 0 0.75rem; }
.btn-compare {
  margin-top: 0.35rem;
  border: 1px solid var(--navy);
  background: #fff;
  color: var(--navy);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
}
.compare-sheet { width: min(96vw, 1100px); max-height: 90vh; overflow: auto; }
.compare-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 1fr);
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.35rem 0 0.75rem;
}
.compare-col {
  border: 1px solid var(--borde);
  border-radius: 12px;
  padding: 0.7rem;
  background: #fff;
  position: relative;
}
.compare-col .x {
  position: absolute; top: 0.35rem; right: 0.35rem;
  border: 0; background: #eef0f8; border-radius: 50%;
  width: 1.8rem; height: 1.8rem; font-weight: 700;
}
.compare-col img {
  width: 100%; height: 110px; object-fit: contain; background: #f8f9fb;
  border-radius: 8px;
}
.compare-col h4 { margin: 0.45rem 0 0.2rem; font-size: 0.95rem; color: var(--navy); }
.compare-col dl { margin: 0.4rem 0; font-size: 0.8rem; }
.compare-col dt { color: var(--texto-suave); }
.compare-col dd { margin: 0 0 0.25rem; font-weight: 700; }
.status {
  margin: 0.65rem 0 0.35rem;
  font-size: 0.88rem; font-weight: 600; color: var(--texto-suave);
}

.results { display: flex; flex-direction: column; }
.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.2rem;
  gap: 0.35rem 0.65rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--borde);
  border-radius: 0;
  background: transparent;
  padding: 0.75rem 0.55rem;
  position: relative;
  align-items: start;
}
.card:hover { background: #fafbfe; }
.card.is-active {
  background: var(--sel);
  box-shadow: inset 3px 0 0 var(--navy);
}
.card > div:first-child { min-width: 0; }
.card-kicker {
  margin: 0; font-size: 0.72rem; font-weight: 700;
  color: var(--texto-suave); text-transform: uppercase; letter-spacing: 0.02em;
}
.card-model {
  margin: 0.12rem 0 0; font-size: 1.02rem; font-weight: 800; line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc {
  margin: 0.25rem 0 0;
  font-size: 0.84rem; font-weight: 500; color: var(--texto-suave);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-prov {
  margin: 0.3rem 0 0; font-size: 0.78rem; font-weight: 600; color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-side {
  flex: none;
  width: 7.2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  text-align: right;
}
.card-price {
  font-size: 1.15rem;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.stock-dot {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.72rem; font-weight: 700; color: var(--texto-suave);
  white-space: nowrap;
}
.dueno-hint {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--orange);
}
.link-revisar {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
}
.ff-box {
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px dashed var(--orange);
  border-radius: 10px;
  background: #fff8f0;
}
.ff-line {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
}
.ff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.ff-actions .btn-primary,
.ff-actions .btn-ghost {
  width: auto;
  margin: 0;
  min-height: 2.2rem;
  padding: 0 0.85rem;
}
.price-row.is-struck strong {
  text-decoration: line-through;
  color: var(--texto-suave);
  font-weight: 600;
}
.price-ff-row {
  color: var(--navy);
}
.price-ff-row strong {
  color: var(--orange);
  font-size: 1.15rem;
}
.btn-aviso {
  margin-top: 0.45rem;
  border: 0;
  background: transparent;
  color: #9a6b2f;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.15rem 0;
  text-align: left;
}
.btn-aviso:hover { color: #7a521f; text-decoration: underline; }
.aviso-art {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--texto-suave);
}
.aviso-ok {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--stock-hay);
}
.sheet-card textarea,
.sheet-card select {
  width: 100%;
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font: inherit;
  background: #fff;
}
.sheet-card textarea { resize: vertical; min-height: 4.5rem; }
.nav-btn.is-dueno {
  background: var(--orange);
  color: var(--navy);
}
.stock-table .col-coste { white-space: nowrap; }
.stock-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--stock-sin);
}
.stock-dot.hay::before { background: var(--stock-hay); }
.stock-dot.en_camino::before { background: var(--stock-camino); }
.stock-dot.hay { color: var(--stock-hay); }
.stock-dot.en_camino { color: var(--stock-camino); }

.empty, .error, .pane-empty {
  margin: 0; padding: 1.4rem 0.8rem;
  text-align: center; font-weight: 600; color: var(--texto-suave);
}
.error { color: #9b2c2c; }

.btn-back {
  border: 0; background: transparent; color: var(--navy);
  font-weight: 700; margin-bottom: 0.5rem; padding: 0.2rem 0;
}

.ficha-hero {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}
.detail-photo {
  width: 110px; height: 110px;
  border-radius: 12px;
  border: 1px solid var(--borde);
  background: #fff;
  display: grid; place-items: center;
  overflow: hidden; padding: 0.45rem;
  color: var(--texto-suave); font-size: 0.8rem; font-weight: 600;
}
.detail-photo.has-foto { cursor: zoom-in; }
.detail-photo img {
  width: 100%; height: 100%; object-fit: contain; display: block; background: #fff;
}
.detail-photo.is-icon {
  background: linear-gradient(160deg, #eef0f8, #f7f8fc);
  cursor: default;
}
.detail-kicker {
  margin: 0; font-size: 0.75rem; font-weight: 700;
  color: var(--navy-active); text-transform: uppercase; letter-spacing: 0.03em;
}
.ficha-intro h2, #detail-title {
  margin: 0.2rem 0 0; font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 800; color: var(--navy); line-height: 1.15;
}
.detail-desc {
  margin: 0.35rem 0 0; font-size: 0.92rem; font-weight: 500;
  color: var(--texto-suave); line-height: 1.35;
}

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.9rem;
}
.spec-grid div {
  border-bottom: 1px solid var(--borde);
  padding: 0.4rem 0;
  display: flex; justify-content: space-between; gap: 0.5rem;
  font-size: 0.88rem;
}
.spec-grid dt { color: var(--texto-suave); font-weight: 500; }
.spec-grid dd { margin: 0; font-weight: 700; text-align: right; }

.block h3 {
  margin: 0 0 0.45rem; font-size: 0.78rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--navy);
}
.stock-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
.stock-table th, .stock-table td {
  text-align: left; padding: 0.45rem 0.2rem; border-bottom: 1px solid var(--borde);
}
.stock-table th { font-size: 0.72rem; color: var(--texto-suave); font-weight: 700; }
.stock-table tr.mas-barato td { background: #eaf8ef; }
.tag-barato {
  display: inline-block; margin-left: 0.3rem; padding: 0.08rem 0.4rem;
  border-radius: 999px; background: #1f8a4c; color: #fff;
  font-size: 0.65rem; font-weight: 800;
}

.presu-head {
  display: flex; gap: 0.65rem; align-items: flex-start;
  margin-bottom: 0.75rem;
}
.presu-emoji { margin: 0; font-size: 1.6rem; line-height: 1; }
.presu-tipo {
  margin: 0; font-size: 0.75rem; font-weight: 700;
  color: var(--texto-suave); text-transform: uppercase;
}
#presu-titulo {
  margin: 0.15rem 0 0; font-size: 1.05rem; font-weight: 800; color: var(--navy);
  line-height: 1.2;
}
.price-row {
  display: flex; justify-content: space-between; gap: 0.5rem;
  padding: 0.4rem 0; font-weight: 600; font-size: 0.95rem;
  border-bottom: 1px solid var(--borde);
}
.price-row strong { font-weight: 800; }
.gratis { color: var(--stock-hay); }

.preguntas { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.55rem; }
.pregunta {
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: #fafbfd;
}
.pregunta p {
  margin: 0 0 0.4rem; font-size: 0.88rem; font-weight: 600;
}
.pregunta-ops { display: flex; gap: 0.4rem; }
.pregunta-ops button {
  flex: 1; min-height: 2.2rem; border-radius: 8px;
  border: 1px solid var(--borde); background: #fff; font-weight: 700;
}
.pregunta-ops button.is-on {
  background: var(--navy); color: #fff; border-color: var(--navy);
}
.pregunta-ops button.is-off {
  background: #fff; color: var(--texto-suave);
}
.cargo-line {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.5rem; padding: 0.35rem 0; font-size: 0.9rem; font-weight: 600;
}
.cargo-line button {
  border: 0; background: transparent; color: #b91c1c; font-weight: 700; font-size: 0.8rem;
}

.total-box {
  margin-top: 0.75rem;
  background: var(--navy); color: #fff;
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  display: flex; justify-content: space-between; align-items: baseline;
  font-weight: 700;
}
.total-box strong { font-size: 1.45rem; font-weight: 800; }

.side-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.action-btn {
  display: flex; align-items: center; gap: 0.65rem;
  width: 100%; text-align: left;
  border-radius: 12px; padding: 0.6rem 0.7rem;
  text-decoration: none; color: inherit; background: #fff;
}
.action-ico {
  flex: none; width: 2.4rem; height: 2.4rem; border-radius: 10px;
  display: grid; place-items: center;
}
.action-txt { display: flex; flex-direction: column; gap: 0.05rem; min-width: 0; }
.action-txt strong { font-size: 0.92rem; font-weight: 800; }
.action-txt small { font-size: 0.74rem; font-weight: 500; opacity: 0.85; }
.action-ficha { border: 1px solid var(--navy); color: var(--navy); }
.action-ficha .action-ico { background: rgba(31,42,92,.1); color: var(--navy); }
.action-wa { border: 1px solid #25d366; color: #137a3a; background: #eafbf0; }
.action-wa .action-ico { background: #25d366; border-radius: 50%; }
.action-print { border: 1px solid #f2994a; color: #a0521a; background: #fff4ea; }
.action-print .action-ico { background: #f2994a; }
.action-vender {
  justify-content: center; min-height: 3rem;
  background: var(--orange); border: 0; color: var(--navy);
}
.action-vender strong { font-size: 1.1rem; font-weight: 800; }
.action-web { margin-top: 0.75rem; border: 1px solid var(--navy); color: var(--navy); }
.action-web .action-ico { background: rgba(31,42,92,.1); }

.badge {
  display: inline-block; margin-left: 0.3rem; padding: 0.1rem 0.4rem;
  border-radius: 999px; font-size: 0.65rem; font-weight: 800;
}
.badge-acc { background: #eef0f8; color: var(--navy); }
.badge-color { background: #f3f4f8; color: #4b5568; }

.sheet {
  border: 0; padding: 0; background: transparent;
  max-width: none; max-height: none; width: 100%; height: 100%;
}
.sheet::backdrop { background: rgba(15, 18, 32, 0.45); }
.sheet[open] { display: grid; place-items: center; padding: 1rem; }
.sheet-card {
  width: min(420px, 94vw);
  background: #fff; border-radius: 14px; border: 1px solid var(--borde);
  padding: 1rem 1.05rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.65rem;
}
.sheet-card h3 { margin: 0; color: var(--navy); font-size: 1.1rem; }
.sheet-card label {
  display: flex; flex-direction: column; gap: 0.25rem;
  font-size: 0.78rem; font-weight: 700; color: var(--texto-suave);
}
.sheet-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.sheet-actions .btn-ghost { width: auto; margin: 0; padding: 0 0.9rem; }
.wa-preview {
  margin: 0; padding: 0.75rem; border-radius: 10px;
  background: #e7f8ec; border: 1px solid #b7e4c3;
  white-space: pre-wrap; font-family: var(--fuente);
  font-size: 0.88rem; line-height: 1.4; font-weight: 500;
  max-height: 180px; overflow: auto;
}
.wa-hint { margin: 0; font-size: 0.78rem; color: var(--texto-suave); font-weight: 500; }

.lightbox, .ficha-full {
  border: 0; padding: 0; background: transparent;
  max-width: none; max-height: none; width: 100%; height: 100%;
}
.lightbox::backdrop { background: rgba(10, 12, 20, 0.88); }
.ficha-full::backdrop { background: rgba(12, 16, 28, 0.55); }
.lightbox[open], .ficha-full[open] { display: grid; place-items: center; }
.lightbox-inner {
  position: relative; width: min(92vw, 920px); height: min(88vh, 920px);
  display: grid; place-items: center; padding: 1.25rem;
}
.lightbox-inner img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  background: #fff; border-radius: 0.6rem; padding: 0.75rem;
}
.lightbox-close, .ficha-full-close {
  position: absolute; top: 0.15rem; right: 0.15rem;
  width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.92); font-size: 1.5rem; font-weight: 700; z-index: 2;
}
.ficha-full[open] { padding: 1rem; }
.ficha-full-sheet {
  position: relative; width: min(720px, 96vw);
  max-height: min(92vh, 980px); overflow: auto;
  background: #fff; border: 1px solid var(--borde); border-radius: 14px;
  padding: 1.1rem 1.15rem 1.3rem;
}
.ficha-full-photo {
  width: min(280px, 70%); height: 220px; margin: 0.2rem auto 0.9rem;
  border: 1px solid var(--borde); border-radius: 12px; background: #fff;
  padding: 0.7rem; display: grid; place-items: center; overflow: hidden;
}
.ficha-full-photo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ficha-full-kicker {
  margin: 0; font-size: 0.8rem; font-weight: 800; color: var(--navy); text-transform: uppercase;
}
.ficha-full-sheet h2 { margin: 0.25rem 0 0; color: var(--navy); font-size: 1.45rem; font-weight: 800; }
.ficha-full-desc { margin: 0.35rem 0 0.7rem; font-weight: 500; color: var(--texto-suave); }
.spec-list { margin: 0; display: grid; gap: 0; }
.spec-list div {
  display: grid; grid-template-columns: 1fr auto; gap: 0.75rem;
  padding: 0.5rem 0; border-bottom: 1px solid var(--borde); font-size: 0.95rem;
}
.spec-list dt { color: var(--texto-suave); font-weight: 500; }
.spec-list dd { margin: 0; font-weight: 800; text-align: right; }
.spec-links { margin-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.spec-links a { color: var(--navy); font-weight: 700; font-size: 0.9rem; }
.ficha-full-price {
  margin-top: 0.9rem; display: grid; gap: 0.4rem; padding: 0.85rem;
  border-radius: 12px; background: #f0f2fa;
}
.ficha-full-price div { display: flex; justify-content: space-between; font-weight: 700; }
.ficha-full-price strong { color: var(--navy); font-size: 1.15rem; }

.print-root { display: none; }

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .panel-search { grid-column: 1 / -1; max-height: 42vh; }
  .panel-ficha, .panel-presupuesto {
    position: static; max-height: none;
  }
}

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    height: auto; width: 100%;
    flex-direction: row; justify-content: space-around;
    padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255,255,255,.12);
  }
  .sidebar-logo, .nav-lock span, .nav-btn span { display: none; }
  .sidebar-nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .nav-lock { margin: 0; }
  .main { padding-bottom: 4.2rem; }
  .workspace {
    grid-template-columns: 1fr;
    padding: 0.65rem;
  }
  .panel-search, .panel-ficha, .panel-presupuesto {
    position: static; max-height: none;
  }
  .panel-ficha:has(#ficha[hidden]) { display: none; }
  .panel-presupuesto:has(#presupuesto[hidden]) { display: none; }
  .btn-back { display: inline-flex !important; }
  .ficha-hero { grid-template-columns: 84px 1fr; }
  .detail-photo { width: 84px; height: 84px; }
  .spec-grid { grid-template-columns: 1fr; }
  .topbar-title span { display: none; }
}

@media (min-width: 821px) {
  .btn-back { display: none !important; }
}
