/* ================================================================
   Mundosensores — app.css
   Tema: Industrial técnico · oscuro · acento naranja
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;500;600;700;800&family=DM+Sans:wght@300;400;500&family=DM+Mono:wght@400;500&display=swap');

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --bg-base:      #0a0c10;
  --bg-surface:   #10131a;
  --bg-elevated:  #161b24;
  --bg-border:    #1e2535;
  --bg-hover:     #1a2030;

  --accent:       #ff6b2b;
  --accent-dim:   #cc4d18;
  --accent-glow:  rgba(255, 107, 43, 0.15);
  --cyan:         #00d4ff;
  --cyan-dim:     rgba(0, 212, 255, 0.1);

  --text-primary:   #eef0f4;
  --text-secondary: #8892a4;
  --text-muted:     #4a5568;
  --text-accent:    #ff6b2b;

  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar custom ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--bg-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ── Tipografía ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

.mono { font-family: var(--font-mono); }

/* ── Textura de fondo (grid técnico) ────────────────────────── */
.bg-grid {
  background-image:
    linear-gradient(var(--bg-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-border) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center;
}

/* ── Botones ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 32px rgba(255, 107, 43, 0.3);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--bg-border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 14px;
}
.btn-ghost:hover { color: var(--text-primary); }

.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 17px; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), transform var(--transition);
}
.card:hover {
  border-color: rgba(255, 107, 43, 0.3);
  transform: translateY(-2px);
}

/* ── Inputs ─────────────────────────────────────────────────── */
.input, .textarea, .select {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.textarea { resize: vertical; min-height: 120px; }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.form-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-accent  { background: var(--accent-glow);  color: var(--accent); border: 1px solid rgba(255,107,43,0.2); }
.badge-cyan    { background: var(--cyan-dim);      color: var(--cyan);   border: 1px solid rgba(0,212,255,0.2); }
.badge-success { background: rgba(34,197,94,0.1);  color: #4ade80;       border: 1px solid rgba(34,197,94,0.2); }
.badge-warning { background: rgba(234,179,8,0.1);  color: #facc15;       border: 1px solid rgba(234,179,8,0.2); }
.badge-neutral { background: rgba(148,163,184,0.1);color: var(--text-secondary); border: 1px solid var(--bg-border); }

/* ── Precio ─────────────────────────────────────────────────── */
.price {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.price-original {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
}

/* ── Product card ───────────────────────────────────────────── */
.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  border-color: rgba(255, 107, 43, 0.4);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,107,43,0.1);
  transform: translateY(-3px);
}
.product-card-img {
  aspect-ratio: 4/3;
  background: var(--bg-elevated);
  overflow: hidden;
  position: relative;
}
.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: transform 400ms ease;
}
.product-card:hover .product-card-img img { transform: scale(1.04); }
.product-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.product-card-marca {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.product-card-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  flex: 1;
  margin-bottom: 12px;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 12, 16, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bg-border);
  transition: border-color var(--transition);
}
.navbar.scrolled { border-bottom-color: rgba(255,107,43,0.2); }

/* ── Section divider ────────────────────────────────────────── */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}
.section-tag::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* ── Flash messages ─────────────────────────────────────────── */
.flash {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.flash-success { background: rgba(34,197,94,0.1);  border: 1px solid rgba(34,197,94,0.2);  color: #4ade80; }
.flash-error   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.2);  color: #f87171; }
.flash-info    { background: var(--cyan-dim);       border: 1px solid rgba(0,212,255,0.2);  color: var(--cyan); }

/* ── Loader de página ───────────────────────────────────────── */
.page-enter { animation: fadeUp 0.35s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Divisor decorativo ─────────────────────────────────────── */
.divider-accent {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.3;
  margin: 0;
}

/* ── Responsive utils ───────────────────────────────────────── */
.container-ms {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 640px) {
  .container-ms { padding: 0 16px; }
}

/* ── Estado vacío ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

/* ── Table ──────────────────────────────────────────────────── */
.table-ms { width: 100%; border-collapse: collapse; }
.table-ms th {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--bg-border);
}
.table-ms td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--bg-border);
  font-size: 14px;
  color: var(--text-secondary);
}
.table-ms tr:hover td { background: var(--bg-hover); }
.table-ms tr:last-child td { border-bottom: none; }

/* ── Estado de cotización colores ───────────────────────────── */
.estado-borrador  { color: var(--text-muted); }
.estado-enviada   { color: var(--cyan); }
.estado-vista     { color: #a78bfa; }
.estado-aceptada  { color: #4ade80; }
.estado-rechazada { color: #f87171; }
.estado-vencida   { color: var(--text-muted); }
