@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #07111f;
  --surface: #0d1b2b;
  --surface-2: #112338;
  --surface-3: #172b42;
  --border: rgba(148, 163, 184, .14);
  --border-strong: rgba(148, 163, 184, .24);
  --text: #f8fafc;
  --muted: #8ca0b7;
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, .13);
  --green: #22c55e;
  --danger: #f97316;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  overflow: hidden;
}

button, input { font: inherit; }
button { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.app-header {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  background: rgba(7, 17, 31, .96);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.brand strong { color: var(--accent); font-weight: 800; }

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #08111e;
  background: var(--accent);
  border-radius: 10px;
  box-shadow: 0 7px 22px rgba(245, 158, 11, .18);
}

.brand-mark svg { width: 20px; height: 20px; stroke-width: 1.7; }
.brand-mark.small { width: 32px; height: 32px; border-radius: 9px; }

.app-main {
  height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
}

.canvas-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 25px 28px 28px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(7, 17, 31, .76), rgba(7, 17, 31, .88)),
    url('assets/warehouse-backdrop.png') center / cover;
}

.canvas-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, transparent 0, rgba(7,17,31,.36) 70%);
}

.map-heading {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.map-heading h1 { font-size: clamp(20px, 2vw, 28px); letter-spacing: -.04em; }

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  color: #a7f3d0;
  background: rgba(34, 197, 94, .09);
  border: 1px solid rgba(34, 197, 94, .18);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.live-indicator i {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--green);
}

.canvas-shell {
  min-height: 0;
  flex: 1;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 2;
  overflow: hidden;
  background: rgba(8, 20, 35, .58);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28), inset 0 1px rgba(255,255,255,.03);
  backdrop-filter: blur(8px);
}

#warehouse-canvas {
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  border-radius: 13px;
  cursor: grab;
  touch-action: none;
}

.map-controls {
  display: grid;
  grid-template-columns: repeat(3, 38px);
  gap: 6px;
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  padding: 6px;
  background: rgba(5, 14, 26, .84);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
  backdrop-filter: blur(10px);
}

.map-controls button {
  width: 38px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #dce6f1;
  background: rgba(148, 163, 184, .08);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
}

.map-controls button:hover {
  color: #091321;
  background: var(--accent);
  border-color: var(--accent);
}

.map-controls svg {
  width: 17px;
  height: 17px;
}

.map-help {
  position: absolute;
  left: 18px;
  bottom: 17px;
  z-index: 5;
  padding: 7px 10px;
  color: #9eb0c4;
  background: rgba(5, 14, 26, .78);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 9px;
  pointer-events: none;
}

.canvas-loading, .graph-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(148, 163, 184, .18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.side-panel {
  padding: 18px;
  overflow-y: auto;
  background: #091524;
  border-left: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.stat-card {
  padding: 12px;
  background: linear-gradient(145deg, rgba(17, 35, 56, .95), rgba(13, 27, 43, .95));
  border: 1px solid var(--border);
  border-radius: 12px;
}

.stat-card span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.stat-card strong { display: block; margin-top: 6px; color: #fff; font-size: 20px; }

.panel-card {
  margin-bottom: 12px;
  padding: 16px;
  background: rgba(13, 27, 43, .92);
  border: 1px solid var(--border);
  border-radius: 15px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-heading.simple { margin-bottom: 12px; }
.section-heading h2 { font-size: 16px; letter-spacing: -.025em; }

.cart-button {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  position: relative;
  background: var(--accent);
  color: #0a1420;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}

.cart-button:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(245,158,11,.22); }
.cart-button svg { width: 21px; height: 21px; stroke-width: 2; }
.cart-button span {
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  position: absolute;
  top: -7px;
  right: -7px;
  padding: 0 5px;
  background: #fff;
  color: #0f172a;
  border: 2px solid #091524;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.order-list {
  max-height: 180px;
  overflow-y: auto;
  padding-right: 3px;
}

.order-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.order-item:last-child { border-bottom: 0; }
.order-item img { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: 8px; }
.order-item img.image-error { opacity: .12; }
.order-item-info { min-width: 0; }
.order-item-info strong { display: block; overflow: hidden; color: #e5edf7; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.order-item-info span { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.order-item > button { background: transparent; border: 0; color: #64748b; cursor: pointer; font-size: 19px; }
.order-item > button:hover { color: var(--danger); }

.order-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-strong);
}

.order-total span { color: var(--muted); font-size: 11px; }
.order-total strong { color: var(--accent); font-size: 19px; letter-spacing: -.04em; }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s, background .2s, border-color .2s, opacity .2s;
}

.btn svg { width: 17px; height: 17px; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .36; }
.btn-primary { background: var(--accent); color: #0a1420; }
.btn-primary:hover:not(:disabled) { background: #fbbf24; }
.btn-secondary { background: #1d4ed8; color: #fff; }
.btn-secondary:hover { background: #2563eb; }
.btn-ghost { background: rgba(148, 163, 184, .06); color: #b8c5d4; border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: rgba(148, 163, 184, .11); border-color: var(--border-strong); }
.btn.loading { color: transparent; position: relative; }
.btn.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  position: absolute;
  border: 2px solid rgba(7,17,31,.3);
  border-top-color: #07111f;
  border-radius: 50%;
  animation: spin .65s linear infinite;
}

.route-card { min-height: 105px; }
.route-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.route-metrics article { padding: 9px 7px; text-align: center; background: rgba(148,163,184,.05); border-radius: 9px; }
.route-metrics strong { display: block; color: var(--accent); font-size: 16px; }
.route-metrics span { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.route-flow { max-height: 64px; display: flex; align-items: center; gap: 5px; margin-top: 10px; overflow: auto; padding-bottom: 4px; }
.route-flow span { flex: 0 0 auto; padding: 4px 6px; color: #b8c5d4; background: rgba(148,163,184,.07); border-radius: 5px; font: 8px Consolas, monospace; }
.route-flow i { color: var(--accent); font-size: 10px; font-style: normal; }

.empty-state { color: var(--muted); text-align: center; font-size: 11px; }
.empty-state.compact { min-height: 58px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 7px; }
.empty-icon { width: 22px; height: 22px; display: grid; place-items: center; border: 1px dashed #52657a; border-radius: 50%; color: #70849a; font-size: 16px; }

.zone-panel { padding: 4px 4px 10px; }
.zone-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.zone-legend-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 7px;
  color: #aebdcd;
  background: rgba(148, 163, 184, .045);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.zone-legend-item i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 3px;
  box-shadow: 0 0 8px color-mix(in srgb, currentColor 35%, transparent);
}
.zone-legend-item b {
  min-width: 0;
  overflow: hidden;
  font-size: 8px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-open { overflow: hidden; }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(2, 8, 16, .82);
  backdrop-filter: blur(8px);
}

.modal-overlay.active { display: flex; animation: fade-in .18s ease-out; }
@keyframes fade-in { from { opacity: 0; } }

.catalog-modal {
  width: min(1420px, 96vw);
  height: min(860px, 93vh);
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  overflow: hidden;
  background: #0a1727;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 35px 100px rgba(0,0,0,.55);
}

.catalog-sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 15px 16px;
  background: #081321;
  border-right: 1px solid var(--border);
}

.catalog-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 19px; }
.catalog-brand .eyebrow { margin-bottom: 3px; }
.catalog-brand strong { font-size: 14px; }

.category-list { flex: 1; overflow-y: auto; }
.category-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
  padding: 10px 11px;
  color: #91a4b9;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}
.category-button:hover { color: #e5edf7; background: rgba(148,163,184,.06); }
.category-button.active { color: #f8fafc; background: var(--accent-soft); border-color: rgba(245,158,11,.2); }
.category-button small { color: #60758c; font-size: 9px; }
.category-button.active small { color: var(--accent); }

.catalog-cart-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 13px;
  padding: 13px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
}
.catalog-cart-note span { color: var(--muted); font-size: 9px; }
.catalog-cart-note strong { color: var(--accent); font-size: 12px; }

.catalog-content {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 25px 16px;
}
.catalog-header h2 { font-size: 23px; letter-spacing: -.04em; }
.catalog-header-actions { display: flex; align-items: center; gap: 10px; }
.catalog-search {
  width: min(330px, 30vw);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.catalog-search:focus-within { border-color: rgba(245,158,11,.48); box-shadow: 0 0 0 3px rgba(245,158,11,.06); }
.catalog-search svg { width: 17px; height: 17px; color: #64748b; }
.catalog-search input { width: 100%; color: #e5edf7; background: transparent; border: 0; outline: 0; font-size: 11px; }
.catalog-search input::placeholder { color: #52657a; }

.modal-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: rgba(148,163,184,.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #91a4b9;
  font-size: 24px;
  cursor: pointer;
}
.modal-close:hover { color: #fff; background: rgba(148,163,184,.11); }

.catalog-meta {
  display: flex;
  justify-content: space-between;
  padding: 0 25px 12px;
  color: var(--muted);
  font-size: 9px;
}
.catalog-meta span:last-child { color: #86efac; }

.product-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 16px;
  overflow-x: hidden;
  overflow-y: scroll;
  padding: 2px 20px 24px 25px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #40566d rgba(8, 19, 33, .5);
  overscroll-behavior: contain;
}

.product-grid::-webkit-scrollbar {
  width: 10px;
}

.product-grid::-webkit-scrollbar-track {
  background: rgba(8, 19, 33, .5);
  border-radius: 999px;
}

.product-grid::-webkit-scrollbar-thumb {
  background: #40566d;
  border: 2px solid #0a1727;
  border-radius: 999px;
}

.product-grid::-webkit-scrollbar-thumb:hover {
  background: #587087;
}

.product-card {
  min-width: 0;
  min-height: 284px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.product-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: 0 15px 30px rgba(0,0,0,.2); }
.product-card.selected { border-color: rgba(245,158,11,.5); box-shadow: inset 0 0 0 1px rgba(245,158,11,.1); }

.product-image {
  height: 164px;
  flex: 0 0 164px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #f8fafc, #dfe7ef);
}
.product-image img { width: 100%; height: 100%; padding: 16px; object-fit: contain; mix-blend-mode: multiply; }
.product-image.image-error::after { content: 'Sin imagen'; color: #64748b; font-size: 10px; }
.stock-pill {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 5px 7px;
  color: #166534;
  background: rgba(220,252,231,.94);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 700;
}

.product-card-body {
  min-height: 118px;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px;
}
.product-category { color: var(--accent); font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.product-card h3 {
  min-height: 38px;
  display: -webkit-box;
  overflow: hidden;
  margin: 8px 0 14px;
  color: #dce6f1;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.product-card-footer > strong { color: #fff; font-size: 15px; letter-spacing: -.035em; }
.add-product {
  padding: 7px 9px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(245,158,11,.2);
  border-radius: 7px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}
.add-product:hover { background: var(--accent); color: #091321; }

.quantity-control {
  display: grid;
  grid-template-columns: 25px 26px 25px;
  align-items: center;
  overflow: hidden;
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.22);
  border-radius: 8px;
}
.quantity-control button { height: 28px; color: var(--accent); background: transparent; border: 0; cursor: pointer; }
.quantity-control button:hover { background: rgba(245,158,11,.13); }
.quantity-control span { color: #fff; font-size: 9px; font-weight: 700; text-align: center; }

.load-more {
  flex: 0 0 auto;
  align-self: center;
  margin: 0 0 12px;
  padding: 8px 14px;
  color: #b8c5d4;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.catalog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 25px;
  background: rgba(8,19,33,.95);
  border-top: 1px solid var(--border);
}
.catalog-footer span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.catalog-footer strong { font-size: 12px; }
.confirm-order { min-width: 178px; }
.confirm-order svg { width: 16px; height: 16px; }

.graph-modal {
  width: min(1120px, 94vw);
  max-height: 92vh;
  overflow: hidden;
  background: #0a1727;
  border: 1px solid var(--border-strong);
  border-radius: 19px;
  box-shadow: 0 35px 100px rgba(0,0,0,.55);
}
.graph-modal > header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.graph-modal h2 { font-size: 19px; }
.graph-stage { min-height: 500px; max-height: calc(92vh - 88px); display: grid; place-items: center; overflow: auto; padding: 18px; background: #e8edf2; }
#matplotlib-img { display: block; max-width: 100%; max-height: calc(92vh - 125px); border-radius: 9px; }
.graph-loading.error {
  max-width: 460px;
  padding: 20px;
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  text-align: center;
}

@media (max-width: 1180px) {
  .app-main { grid-template-columns: minmax(0, 1fr) 350px; }
  .side-panel { padding: 14px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); }
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .app-main { height: auto; grid-template-columns: 1fr; }
  .canvas-panel { min-height: 680px; }
  .side-panel { border-top: 1px solid var(--border); border-left: 0; }
  .catalog-modal { grid-template-columns: 180px minmax(0, 1fr); }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

@media (max-width: 640px) {
  .app-header { padding: 0 16px; }
  .canvas-panel { min-height: 570px; padding: 18px 12px; }
  .map-heading { align-items: flex-start; gap: 12px; }
  .live-indicator { display: none; }
  .modal-overlay { padding: 0; }
  .catalog-modal { width: 100vw; height: 100vh; grid-template-columns: 1fr; border-radius: 0; }
  .catalog-sidebar { display: none; }
  .catalog-header { align-items: flex-start; padding: 17px 14px 12px; }
  .catalog-header-actions { flex: 1; }
  .catalog-search { width: 100%; }
  .catalog-meta { padding: 0 14px 10px; }
  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 2px 10px 18px 14px;
  }
  .product-card { min-height: 248px; }
  .product-image { height: 128px; flex-basis: 128px; }
  .product-card-body { min-height: 116px; padding: 11px; }
  .product-card h3 { font-size: 10px; }
  .catalog-footer { padding: 12px 14px; }
  .catalog-footer > div { display: none; }
  .confirm-order { width: 100%; }
}

/* ─── Header Navigation ─── */
.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.nav-link {
  padding: 8px 14px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  transition: color .2s, background .2s;
}
.nav-link:hover { color: #e5edf7; background: rgba(148,163,184,.08); }
.nav-link.active { color: #f8fafc; background: rgba(148,163,184,.1); }
.btn-nav-accent {
  color: #0a1420 !important;
  background: var(--accent) !important;
  border-radius: 8px;
}
.btn-nav-accent:hover { background: #fbbf24 !important; }

/* ─── Landing Page ─── */
.landing-body { overflow: auto; }
.landing-body .app-header { position: relative; z-index: 10; }

.landing-hero {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    url('assets/warehouse-backdrop.png') center / cover no-repeat;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(7,17,31,.92) 0%, rgba(7,17,31,.7) 50%, rgba(7,17,31,.88) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
  text-align: center;
  padding: 40px 24px;
}
.hero-content h1 {
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -.05em;
  line-height: 1.1;
  margin: 12px 0 18px;
}
.hero-content h1 strong { color: var(--accent); }
.hero-content p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 32px;
}
.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.btn-lg {
  padding: 14px 28px;
  font-size: 14px;
  border-radius: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-lg svg { stroke-width: 2; }

.landing-features {
  padding: 80px 28px;
  background: var(--bg);
}
.features-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.feature-card {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: transform .2s, border-color .2s;
}
.feature-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.feature-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  margin-bottom: 20px;
}
.feature-card h3 { font-size: 18px; margin-bottom: 10px; }
.feature-card p { color: var(--muted); font-size: 13px; line-height: 1.7; margin-bottom: 18px; }
.feature-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.feature-link:hover { text-decoration: underline; }

.landing-stats {
  padding: 60px 28px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stats-row {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.landing-stat strong {
  display: block;
  font-size: 36px;
  letter-spacing: -.04em;
  color: var(--accent);
}
.landing-stat span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.landing-footer {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  background: var(--bg);
}

@media (max-width: 640px) {
  .header-nav { gap: 2px; }
  .nav-link { padding: 6px 10px; font-size: 11px; }
  .hero-content { padding: 24px 16px; }
  .hero-content p { font-size: 14px; }
  .features-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .landing-stat strong { font-size: 28px; }
}

/* ─── Catalog Page ─── */
.catalog-body { overflow: auto; }
.catalog-body .app-header { position: relative; z-index: 10; }

.catalog-page {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  background: var(--bg);
}

.catalog-sidebar-page {
  padding: 28px 18px;
  background: #091524;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: calc(100vh - 64px);
  overflow-y: auto;
}
.sidebar-header { margin-bottom: 20px; }
.sidebar-header h2 { font-size: 18px; }

.category-list-page { display: flex; flex-direction: column; gap: 3px; }
.category-btn-page {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  color: #91a4b9;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.category-btn-page:hover { color: #e5edf7; background: rgba(148,163,184,.06); }
.category-btn-page.active { color: #f8fafc; background: var(--accent-soft); border-color: rgba(245,158,11,.2); }
.category-btn-page small { color: #60758c; font-size: 10px; }
.category-btn-page.active small { color: var(--accent); }

.catalog-summary {
  margin-top: 20px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
}
.catalog-summary span { color: var(--muted); font-size: 10px; }

.catalog-main {
  padding: 28px 32px;
  min-width: 0;
}
.catalog-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.catalog-topbar h1 { font-size: 26px; letter-spacing: -.04em; margin-top: 6px; }
.catalog-topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  height: 42px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 260px;
}
.search-box:focus-within { border-color: rgba(245,158,11,.48); box-shadow: 0 0 0 3px rgba(245,158,11,.06); }
.search-box svg { color: #64748b; flex-shrink: 0; }
.search-box input { width: 100%; color: #e5edf7; background: transparent; border: 0; outline: 0; font-size: 12px; }
.search-box input::placeholder { color: #52657a; }
.result-count { color: var(--muted); font-size: 11px; white-space: nowrap; }

.product-grid-page {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.product-card-page {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.product-card-page:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: 0 15px 35px rgba(0,0,0,.2); }

.product-image-page {
  height: 170px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #f8fafc, #dfe7ef);
}
.product-image-page img { width: 100%; height: 100%; padding: 18px; object-fit: contain; mix-blend-mode: multiply; }
.product-image-page.image-error::after { content: 'Sin imagen'; color: #64748b; font-size: 11px; }
.stock-pill-page {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 8px;
  color: #166534;
  background: rgba(220,252,231,.94);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.product-card-body-page { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.product-cat-page { color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.product-card-body-page h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 8px 0 10px;
  color: #dce6f1;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.product-meta-page {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.product-weight-page, .product-rating-page {
  font-size: 10px;
  color: var(--muted);
}
.product-rating-page { color: #fbbf24; }
.product-footer-page {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.product-footer-page > strong { color: #fff; font-size: 17px; letter-spacing: -.035em; }
.btn-view-sim {
  padding: 7px 12px;
  color: #0a1420;
  background: var(--accent);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s;
}
.btn-view-sim:hover { background: #fbbf24; }

.load-more-page {
  display: none;
  margin: 28px auto 0;
  padding: 10px 20px;
  color: #b8c5d4;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 900px) {
  .catalog-page { grid-template-columns: 1fr; }
  .catalog-sidebar-page {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .category-list-page { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .catalog-main { padding: 20px 16px; }
}

@media (max-width: 640px) {
  .catalog-topbar { flex-direction: column; align-items: flex-start; }
  .search-box { min-width: 100%; }
  .product-grid-page { grid-template-columns: 1fr 1fr; gap: 10px; }
  .product-image-page { height: 130px; }
  .product-card-body-page { padding: 11px; }
  .product-card-body-page h3 { font-size: 11px; }
}
