/* Tema B — Ingenieria (canon JMA): azul MOBA, grises frios, Inter tabular, SIN ambar. */
:root {
  --paper: #f4f6f8;
  --surface: #ffffff;
  --ink: #1a232c;
  --muted: #5d6671;
  --line: #c8cfd6;
  --accent: #1f4e8c;
  --accent-strong: #163a66;
  --accent-soft: #4775ad;
  --accent-fill: #e1eaf4;
  --green: #2f6d51;
  --soft-blue: #e9f1fa;
  --shadow: 0 4px 12px rgba(24, 38, 55, 0.06);
  --shadow-card: 0 8px 18px rgba(24, 38, 55, 0.06);
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "tnum" on, "lnum" on;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  min-height: 100vh;
}

.auth-gate {
  background:
    linear-gradient(135deg, rgba(22, 79, 143, 0.04), rgba(31, 78, 140, 0.035)),
    var(--paper);
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.auth-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 10px;
  box-shadow: 0 22px 60px rgba(24, 38, 55, 0.12);
  display: grid;
  gap: 18px;
  max-width: 520px;
  padding: 34px;
  width: min(100%, 520px);
}

.auth-brandline {
  align-items: center;
  display: flex;
  gap: 14px;
}

.auth-brandline img {
  max-height: 34px;
  max-width: 180px;
  object-fit: contain;
}

.auth-brandline span {
  background: var(--line);
  height: 32px;
  width: 1px;
}

.auth-panel h1 {
  color: var(--ink);
  font-size: 30px;
  line-height: 1.1;
  margin: 0;
}

.auth-panel p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.auth-lede {
  font-size: 17px;
  max-width: 34rem;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  color: var(--ink);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
}

.auth-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  min-height: 48px;
  padding: 0 14px;
}

.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(22, 79, 143, 0.12);
  outline: 0;
}

.auth-form input[aria-invalid="true"] {
  border-color: #9f2d20;
  box-shadow: 0 0 0 3px rgba(159, 45, 32, 0.12);
}

.auth-form button {
  background: var(--accent);
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
  min-height: 48px;
  padding: 0 16px;
}

.auth-form button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.auth-status {
  font-size: 13px;
  font-weight: 700;
  min-height: 18px;
}

.auth-status.is-error {
  color: #9f2d20;
}

.internal-login {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.auth-foot {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 13px;
  gap: 12px;
  justify-content: space-between;
  padding-top: 14px;
}

.topbar {
  align-items: center;
  background: rgba(244, 246, 248, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px);
  position: sticky;
  top: 0;
  z-index: 15;
  backdrop-filter: blur(14px);
}

.brand,
.login-brand {
  align-items: center;
  display: flex;
  gap: 16px;
}

.brand img {
  max-height: 34px;
  max-width: 190px;
  object-fit: contain;
}

.divider {
  background: var(--line);
  height: 32px;
  width: 1px;
}

.top-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.price-freshness {
  background: #eef5fb;
  border: 1px solid #aac5df;
  border-radius: 8px;
  color: #173a5d;
  line-height: 1.45;
  margin: 0 clamp(16px, 4vw, 48px) 20px;
  padding: 12px 16px;
}

.price-freshness[data-kind="warning"] {
  background: #fff6e8;
  border-color: #d5a451;
  color: #66420b;
}

.demo-pill,
.client-pill {
  background: var(--soft-blue);
  border: 1px solid #cfe0f1;
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
  white-space: nowrap;
}

.client-pill {
  background: #f7f9fb;
  border-color: var(--line);
  color: var(--muted);
}

.ghost-button,
.secondary-button,
.icon-button,
.quick-add button,
.card-actions button,
.request-actions button,
.login button {
  border-radius: 6px;
  min-height: 42px;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.ghost-button,
.secondary-button {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0 14px;
}

.ghost-button {
  align-items: center;
  display: inline-flex;
  gap: 9px;
}

.ghost-button.cart-pulse {
  animation: cart-pulse 400ms ease-out;
  background: #e1eaf4;
  border-color: var(--accent);
  box-shadow: 0 0 0 5px rgba(31, 78, 140, 0.14);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

@keyframes cart-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 78, 140, 0.34), 0 0 0 0 rgba(11, 79, 147, 0.18);
    transform: scale(1);
  }
  42% {
    box-shadow: 0 0 0 8px rgba(31, 78, 140, 0.14);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(31, 78, 140, 0);
    transform: scale(1);
  }
}

.badge {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  color: white;
  display: inline-flex;
  font-size: 12px;
  height: 22px;
  justify-content: center;
  min-width: 22px;
  padding: 0 7px;
}

.icon-button {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  display: inline-flex;
  justify-content: center;
  width: 42px;
}

.logout-button {
  min-width: 58px;
}

.intro {
  display: grid;
  gap: 14px;
  justify-items: stretch;
  padding: clamp(18px, 3vw, 28px) clamp(16px, 4vw, 48px) 20px;
  text-align: left;
}

.hero-copy {
  align-items: start;
  display: grid;
  gap: 6px;
  max-width: none;
}

.hero-copy h1 {
  margin-left: 0;
  margin-right: 0;
}

.hero-search {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
  display: grid;
  gap: 10px;
  max-width: none;
  padding: 18px;
  text-align: left;
  width: 100%;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.12;
  margin-bottom: 0;
  max-width: none;
}

h2 {
  font-size: 24px;
  letter-spacing: 0;
  margin-bottom: 4px;
}

h3 {
  font-size: 18px;
  line-height: 1.22;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
}

.product-card h3 {
  display: -webkit-box;
  min-height: 2.44em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.part-name-es {
  color: #5f6670;
  font-size: 13px;
  line-height: 1.32;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}

.part-origin {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.intro-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
  max-width: 840px;
}

.proof-strip {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  padding: 0 clamp(16px, 4vw, 48px) 26px;
}

.proof-strip div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 86px;
  min-width: 0;
  padding: 14px;
}

.proof-strip strong {
  color: var(--accent);
  display: block;
  font-size: 24px;
  line-height: 1;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.proof-strip span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  line-height: 1.3;
}

.quick-add,
.filters,
.drawer-panel,
.login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.quick-add {
  align-self: end;
  border-radius: 8px;
  padding: 18px;
}

.quick-add label,
.search-label,
.request-form label,
.login label {
  color: var(--ink);
  display: grid;
  font-size: 13px;
  font-weight: 600;
  gap: 7px;
}

.quick-add-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 72px 96px;
}

input,
select,
textarea {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

input[readonly] {
  background: #f5f7fa;
  color: var(--muted);
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

textarea {
  min-height: 108px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(31, 78, 140, 0.5);
  outline-offset: 2px;
}

.workspace {
  display: grid;
  gap: 20px;
  grid-template-columns: 260px minmax(0, 1fr);
  padding: 0 clamp(16px, 4vw, 48px) 48px;
}

.filters {
  align-self: start;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  box-shadow: none;
  max-height: calc(100dvh - 104px);
  overflow-y: auto;
  padding: 18px;
  position: sticky;
  scrollbar-gutter: stable;
  top: 83px;
}

.search-label-main {
  font-size: 15px;
}

.hero-search input[data-search] {
  border-color: #bed0e2;
  box-shadow: 0 14px 32px rgba(22, 79, 143, 0.1);
  font-size: 20px;
  min-height: 64px;
}

.search-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.38;
  margin: 0;
}

.sidebar-controls {
  display: grid;
  gap: 10px;
}

.filter-group {
  display: grid;
  gap: 6px;
}

.filter-group p,
.filter-group label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.filter-group select {
  min-height: 40px;
  width: 100%;
}

.segmented {
  display: grid;
  gap: 8px;
}

.segment-button {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 38px;
  padding: 0 12px;
  text-align: left;
}

.segment-button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.toggle {
  align-items: center;
  color: var(--ink);
  display: flex;
  gap: 10px;
}

.toggle input {
  accent-color: var(--accent);
  height: 18px;
  min-height: auto;
  width: 18px;
}

.note {
  background: var(--accent-fill);
  border: 1px solid #ead5c3;
  border-radius: 6px;
  color: #5d4635;
  font-size: 13px;
  line-height: 1.45;
  padding: 12px;
}

.stats-panel {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 88px), 1fr));
}

body[data-portal-role="client"] [data-internal-stat] {
  display: none;
}

.stats-panel div {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 3px;
  min-height: 58px;
  min-width: 0;
  padding: 9px;
}

.stats-panel strong {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.stats-panel span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.reset-filters {
  width: 100%;
}

.catalog {
  min-width: 0;
}

.catalog-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.catalog-head p {
  color: var(--muted);
  margin-bottom: 0;
}

.catalog-head select {
  max-width: 180px;
}

.product-grid {
  align-items: stretch;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(242px, 1fr));
}

.product-grid.is-empty {
  grid-template-columns: 1fr;
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 22px;
}

.empty-state p {
  margin: 0;
}

.load-more {
  background: var(--ink);
  border-radius: 6px;
  color: white;
  display: block;
  font-weight: 700;
  margin: 18px auto 0;
  min-height: 44px;
  padding: 0 20px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(24, 38, 55, 0.02);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.product-card:hover {
  border-color: #c6d1de;
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.product-media {
  align-items: center;
  aspect-ratio: 3 / 2;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
  border-bottom: 1px solid #e3e8ef;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
  position: relative;
}

.product-media img {
  display: block;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  padding: 0;
  width: 100%;
}

.product-media.is-thumbnail img {
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  width: 100%;
}

.quality-badge {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  left: 50%;
  padding: 5px 8px;
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}

.product-media.is-clickable {
  cursor: zoom-in;
}

.product-media.is-clickable:focus-visible {
  outline: 3px solid rgba(22, 79, 143, 0.34);
  outline-offset: -3px;
}

.product-media .placeholder {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.product-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px 14px 16px;
}

.part-head {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 8px;
  min-width: 0;
}

.part-ref {
  flex: 1 1 76px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 3px 0 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.part-tools {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  max-width: 100%;
  min-width: 0;
}

.part-tools button {
  align-items: center;
  background: #fbfcfe;
  border: 1px solid #d8dee6;
  border-radius: 999px;
  color: #5d6671;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  min-height: 24px;
  padding: 0 7px;
  white-space: nowrap;
}

.part-tools button:hover {
  background: #f7f9fb;
  border-color: #c8d9ee;
  color: #335f8f;
}

.part-tools button.is-confirmed {
  background: #edf7f1;
  border-color: #9ecbb0;
  color: var(--green);
}

.part-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.38;
  margin-bottom: 10px;
}

.part-price {
  color: #12385f;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
}

.part-price.is-missing {
  color: var(--muted);
  font-weight: 600;
}

.part-detail {
  color: #4f4a43;
  display: -webkit-box;
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.part-context,
.related-parts {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.context-label,
.related-parts span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.context-chip,
.related-chip {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  min-height: 26px;
  padding: 5px 8px;
}

.context-chip,
.related-chip {
  background: #eef4fb;
  border: 1px solid #cadced;
  color: #1f4e8c;
}

.context-chip:hover,
.related-chip:hover {
  background: var(--soft-blue);
  border-color: var(--accent);
  color: var(--accent);
}

.card-actions {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 62px minmax(0, 1fr);
  justify-content: start;
  margin-top: auto;
}

.card-actions input,
.card-actions button {
  height: 44px;
  min-height: 44px;
  padding-bottom: 0;
  padding-top: 0;
}

.card-actions input {
  padding-left: 10px;
  padding-right: 10px;
}

.card-actions button {
  font-size: 14px;
  line-height: 1;
  padding-left: 12px;
  padding-right: 12px;
}

.quick-add button,
.request-actions button,
.login button {
  background: var(--accent);
  color: white;
  font-weight: 700;
  padding: 0 15px;
}

.secondary-button {
  font-weight: 600;
}

.card-actions button {
  background: var(--surface);
  border: 1px solid #b9c3cf;
  color: var(--ink);
  font-weight: 700;
}

button:hover {
  transform: translateY(-1px);
}

.ghost-button:hover,
.secondary-button:hover,
.icon-button:hover,
.segment-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.quick-add button:hover,
.card-actions button:hover,
.request-actions button:hover,
.login button:hover {
  background: var(--accent-strong);
}

.load-more:hover {
  background: #27313b;
}

.card-actions button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.login {
  align-items: center;
  background: var(--paper);
  display: flex;
  min-height: 100vh;
  padding: 20px;
}

.login-panel {
  border-radius: 8px;
  margin: 0 auto;
  max-width: 460px;
  padding: clamp(22px, 5vw, 38px);
  width: 100%;
}

.login-brand {
  justify-content: space-between;
  margin-bottom: 34px;
}

.login-brand img {
  max-height: 42px;
  max-width: 180px;
  object-fit: contain;
}

.login h1 {
  font-size: clamp(24px, 4vw, 28px);
  line-height: 1.12;
}

.login-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 18px;
}

.login form {
  display: grid;
  gap: 14px;
}

.error {
  color: #a63224;
  min-height: 20px;
}

.login-status {
  color: var(--green);
  font-size: 13px;
  min-height: 20px;
}

.drawer {
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 30;
}

.drawer[aria-hidden="false"] {
  pointer-events: auto;
}

.drawer-backdrop {
  background: rgba(20, 18, 15, 0.36);
  inset: 0;
  opacity: 0;
  position: absolute;
  transition: opacity 170ms ease;
}

.drawer[aria-hidden="false"] .drawer-backdrop {
  opacity: 1;
}

.drawer-panel {
  border-bottom: 0;
  border-radius: 8px 0 0 8px;
  border-right: 0;
  bottom: 0;
  display: block;
  max-width: 640px;
  overflow: auto;
  padding: 20px;
  position: absolute;
  right: 0;
  top: 0;
  transform: translateX(105%);
  transition: transform 190ms ease;
  width: min(94vw, 640px);
}

.drawer[aria-hidden="false"] .drawer-panel {
  transform: translateX(0);
}

.image-viewer {
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 45;
}

.image-viewer[aria-hidden="false"] {
  pointer-events: auto;
}

.image-viewer-backdrop {
  background: rgba(20, 18, 15, 0.78);
  border: 0;
  border-radius: 0;
  cursor: zoom-out;
  height: 100%;
  inset: 0;
  opacity: 0;
  padding: 0;
  position: absolute;
  transition: opacity 170ms ease;
  width: 100%;
}

.image-viewer[aria-hidden="false"] .image-viewer-backdrop {
  opacity: 1;
}

.image-viewer-panel {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-rows: minmax(0, 1fr) auto;
  height: min(92vh, 980px);
  inset: 50% auto auto 50%;
  margin: 0;
  max-width: min(94vw, 1220px);
  opacity: 0;
  position: absolute;
  transform: translate(-50%, -48%);
  transition: opacity 170ms ease, transform 170ms ease;
  width: min(94vw, 1220px);
  justify-items: center;
}

.image-viewer[aria-hidden="false"] .image-viewer-panel {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.image-viewer-panel img {
  background: #f8f5ef;
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
  height: auto;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  padding: 18px;
  width: auto;
}

.image-viewer.is-thumbnail .image-viewer-panel {
  height: auto;
  grid-template-rows: auto auto;
}

.image-viewer.is-thumbnail .image-viewer-panel img {
  height: auto;
  max-height: min(70vh, 360px);
  max-width: min(88vw, 520px);
  object-fit: contain;
  width: auto;
}

.image-viewer-panel figcaption {
  align-items: center;
  color: #fff;
  display: flex;
  gap: 12px;
  justify-content: center;
  min-height: 34px;
  text-align: center;
}

.image-viewer-panel figcaption strong {
  color: #f3b06b;
}

.image-viewer-close {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  color: #1f252b;
  font-size: 22px;
  min-height: 52px;
  position: absolute;
  right: 18px;
  top: 18px;
  width: 52px;
  z-index: 2;
}

.image-viewer-close:hover {
  background: #ffffff;
  color: var(--accent-strong);
}

.drawer-head {
  align-items: start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.cart-list {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 18px;
}

.route-note {
  background: var(--soft-blue);
  border: 1px solid #cfe0f1;
  border-radius: 6px;
  color: #24435f;
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px;
}

.route-note strong {
  color: var(--accent);
}

.route-note span {
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.cart-empty {
  background: #f7f3ec;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  padding: 16px;
}

.cart-item {
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 78px 42px;
  padding: 12px;
}

.line-note {
  display: grid;
  gap: 6px;
  grid-column: 1 / -1;
}

.line-note input {
  min-height: 38px;
}

.cart-item strong {
  display: block;
}

.cart-item p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 0;
}

.cart-line-price {
  color: #12385f;
  font-size: 12px;
  font-weight: 700;
  margin-top: 5px;
}

.cart-line-context {
  color: #6e4d35;
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}

.cart-item button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 42px;
}

.request-form {
  display: grid;
  gap: 14px;
}

.cart-total {
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #12385f;
  display: flex;
  font-weight: 800;
  justify-content: space-between;
  padding: 12px;
}

.cart-total span {
  color: var(--muted);
  font-weight: 700;
}

.clear-cart {
  margin: -6px 0 18px;
  width: 100%;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.request-type-control {
  border: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
}

.request-type-control legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  grid-column: 1 / -1;
  margin: 0 0 2px;
  text-transform: uppercase;
}

.request-type-control label {
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 9px;
  grid-template-columns: 18px minmax(0, 1fr);
  padding: 11px;
}

.request-type-control input {
  margin-top: 2px;
}

.request-type-control label:has(input:checked) {
  background: var(--soft-blue);
  border-color: #b8d2eb;
}

.request-type-control strong,
.request-type-control small {
  display: block;
}

.request-type-control small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 2px;
}

.request-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.privacy-consent {
  align-items: flex-start;
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 10px;
  grid-template-columns: 18px minmax(0, 1fr);
  line-height: 1.42;
}

.privacy-consent input {
  height: 18px;
  margin-top: 1px;
  width: 18px;
}

.request-status {
  color: var(--green);
  font-size: 13px;
  min-height: 20px;
}

.request-actions button[disabled],
.confirmation-actions button[disabled] {
  cursor: progress;
  opacity: 0.72;
  transform: none;
}

.request-helper {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
  margin-bottom: 0;
}

.request-local-note {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  color: #7c2d12;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  padding: 8px 10px;
}

.orders-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.orders-note,
.orders-empty {
  background: #f7f3ec;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
  padding: 13px;
}

.orders-empty.is-error {
  background: #fff1ee;
  border-color: #e2b6ad;
  color: #8c3327;
}

.orders-alert {
  background: #fff6e8;
  border: 1px solid #e3bd86;
  border-radius: 6px;
  color: #6b3b12;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}

.orders-alert strong {
  color: var(--ink);
}

.orders-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.orders-summary span {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 2px;
  padding: 10px;
}

.orders-summary strong {
  color: var(--ink);
  font-size: 18px;
}

.orders-section {
  display: grid;
  gap: 10px;
}

.orders-section > header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-bottom: 8px;
}

.orders-section h3 {
  color: var(--ink);
  font-size: 15px;
  margin: 0;
}

.orders-section p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin: 3px 0 0;
}

.orders-section > header > span {
  background: var(--soft-blue);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  min-width: 28px;
  padding: 5px 9px;
  text-align: center;
}

.refresh-orders {
  margin-top: 12px;
  width: 100%;
}

.order-card {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.order-card.is-warning {
  border-color: #e3bd86;
}

/* Tema B sin ambar: el tipo se distingue por intensidad de azul, no por color.
   Pedido firme = azul fuerte; presupuesto (preliminar) = azul suave + borde punteado. */
.order-card.is-request-order {
  border-left: 4px solid var(--accent);
}

.order-card.is-quote {
  border-left: 4px dashed var(--accent-soft);
}

.order-card-head,
.order-meta,
.order-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.order-card-head strong {
  color: var(--accent);
  display: block;
}

.order-card-head span,
.order-meta span {
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  background: var(--soft-blue);
  border: 1px solid #cfe0f1;
  border-radius: 999px;
  color: var(--accent) !important;
  font-size: 12px !important;
  font-weight: 700;
  padding: 5px 9px;
  white-space: nowrap;
}

.status-pill.is-warning {
  background: #fff6e8;
  border-color: #e3bd86;
  color: #6b3b12 !important;
}

.status-pill.is-progress {
  background: #eef6ff;
  border-color: #bfd9f3;
}

.status-pill.is-done {
  background: #e9f7ef;
  border-color: #a9d9bb;
  color: #226138 !important;
}

.status-pill.is-error {
  background: #fff1ee;
  border-color: #e2b6ad;
  color: #8c3327 !important;
}

.order-kind {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.order-meta {
  align-items: start;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.order-next-step {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.38;
  margin: -2px 0 0;
}

.order-timeline {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
}

.timeline-step {
  color: var(--muted);
  display: grid;
  gap: 6px;
  min-width: 0;
  position: relative;
}

.timeline-step::before {
  background: #d8e0ea;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
  top: 8px;
}

.timeline-step:first-child::before {
  left: 8px;
}

.timeline-step:last-child::before {
  right: calc(100% - 8px);
}

.timeline-step span {
  background: #d8e0ea;
  border: 2px solid #fbfcfe;
  border-radius: 999px;
  height: 18px;
  position: relative;
  width: 18px;
  z-index: 1;
}

.timeline-step strong {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  min-width: 0;
}

.timeline-step.is-done,
.timeline-step.is-active {
  color: var(--accent);
}

.timeline-step.is-done::before,
.timeline-step.is-done span {
  background: var(--accent);
}

.timeline-step.is-active span {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 79, 143, 0.12);
}

.timeline-step.is-stopped {
  color: #8c3327;
}

.timeline-step.is-stopped span {
  background: #8c3327;
}

.order-rejection {
  color: #8c3327;
  font-weight: 700;
}

.order-shipment {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-shipment span {
  background: #e9f7ef;
  border: 1px solid #a9d9bb;
  border-radius: 999px;
  color: #226138;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}

.order-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.order-actions button {
  background: var(--accent);
  border-radius: 6px;
  color: #fff;
  min-height: 40px;
}

.order-actions .secondary-button {
  background: var(--surface);
  color: var(--ink);
}

.site-footer {
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(31, 78, 140, 0.28);
  box-shadow: none;
  color: var(--muted);
  display: grid;
  gap: 14px 20px;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, auto) minmax(180px, auto);
  margin-top: 24px;
  padding: 12px clamp(16px, 4vw, 42px);
  position: relative;
}

.footer-brandline {
  align-items: center;
  display: flex;
  gap: 14px;
  min-width: 0;
}

.footer-brandline div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.footer-mark {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  display: grid;
  flex: 0 0 84px;
  min-height: 36px;
  padding: 0;
  place-items: center;
}

.footer-mark img {
  display: block;
  max-height: 34px;
  max-width: 100%;
  object-fit: contain;
}

.site-footer strong {
  color: var(--ink);
}

.site-footer span,
.site-footer a {
  color: var(--muted);
  font-size: 13px;
}

.footer-contact-grid {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.footer-contact-grid a {
  background: transparent;
  border: 0;
  border-radius: 0;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 44px;
  min-width: 0;
  padding: 0;
  text-decoration: none;
}

.footer-contact-grid a:hover {
  color: var(--accent);
}

.footer-contact-grid span {
  color: #6d7783;
  font-size: 12px;
  font-weight: 700;
}

.footer-contact-grid strong {
  color: var(--accent);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.footer-legal {
  color: #6d7783;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-self: end;
  text-align: right;
}

.footer-legal a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-legal span + a::before {
  content: "·";
  margin-right: 8px;
}


.confirmation {
  display: grid;
  inset: 0;
  overflow: auto;
  padding: clamp(16px, 4vw, 42px);
  pointer-events: none;
  place-items: center;
  position: fixed;
  z-index: 50;
}

.confirmation[aria-hidden="false"] {
  pointer-events: auto;
}

.confirmation-backdrop {
  background: rgba(20, 18, 15, 0.42);
  border-radius: 0;
  height: 100%;
  inset: 0;
  opacity: 0;
  padding: 0;
  position: absolute;
  transition: opacity 170ms ease;
  width: 100%;
}

.confirmation[aria-hidden="false"] .confirmation-backdrop {
  opacity: 1;
}

.confirmation-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
  max-height: calc(100dvh - 40px);
  max-width: min(92vw, 560px);
  opacity: 0;
  overflow: auto;
  padding: clamp(22px, 4vw, 34px);
  position: relative;
  transform: translateY(14px);
  transition: opacity 170ms ease, transform 170ms ease;
  width: 560px;
}

.confirmation[aria-hidden="false"] .confirmation-panel {
  opacity: 1;
  transform: translateY(0);
}

.confirmation-panel h2 {
  font-size: 24px;
  margin-bottom: 12px;
}

.confirmation-panel p {
  color: var(--muted);
  line-height: 1.45;
}

.confirmation-summary {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 14px;
}

.confirmation-summary div {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.confirmation-summary span {
  color: var(--muted);
}

.confirmation-summary strong {
  color: var(--ink);
  text-align: right;
}

.confirmation-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr);
}

.confirmation-actions button:first-child {
  background: var(--accent);
  border-radius: 6px;
  color: white;
  font-weight: 700;
  min-height: 42px;
  padding: 0 14px;
}

@media (max-width: 900px) {
  .intro,
  .workspace,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .footer-legal {
    justify-self: start;
    text-align: left;
  }

  .proof-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    position: static;
  }

  .segmented {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

}

@media (max-width: 620px) {
  .brand img {
    max-height: 28px;
    max-width: 128px;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
  }

  .brand {
    width: 100%;
  }

  .top-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .top-actions .ghost-button,
  .top-actions .secondary-button {
    font-size: 14px;
    min-height: 44px;
    padding: 0 10px;
  }

  .demo-pill,
  .client-pill {
    font-size: 11px;
    padding: 6px 9px;
  }

  .intro {
    padding-top: 18px;
  }

  .hero-search input[data-search] {
    font-size: 17px;
    min-height: 56px;
  }

  h1 {
    font-size: 26px;
  }

  .quick-add-row,
  .form-grid,
  .request-type-control,
  .orders-summary,
  .cart-item,
  .request-actions,
  .confirmation-actions,
  .stats-panel,
  .proof-strip {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .part-head {
    justify-content: flex-start;
  }

  .part-tools {
    justify-content: flex-start;
  }

  .footer-contact-grid {
    grid-template-columns: 1fr;
  }

  .footer-mark {
    flex-basis: 96px;
  }

.drawer-panel {
    border-radius: 0;
    width: 100vw;
  }
}

.status-banner {
  background: #e1eaf4;
  border: 1px solid #d8b79c;
  border-radius: 8px;
  color: #5d351d;
  font-weight: 700;
  margin: 18px 0;
  padding: 14px 16px;
}

.status-banner[data-kind="ok"] {
  background: #edf7ef;
  border-color: #9acaa2;
  color: #1d5d2d;
}

.status-banner[data-kind="error"] {
  background: #fbefec;
  border-color: #df9b8e;
  color: #8f2f1f;
}

.details-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.details-grid div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.details-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.details-grid dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap code,
#verify-api code,
#verify-api pre {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
