/* ============================================================
   Soluciones Ampika — Hoja de estilos principal
   Concepto: "planos de sistema" (blueprint técnico) + terminal
   ============================================================ */

:root {
  /* Paleta */
  --bg:            #0F1B2D;
  --bg-alt:        #0B1522;
  --surface:       #16283F;
  --surface-hi:    #1D3350;
  --grid-line:     rgba(143, 189, 232, 0.09);
  --border:        #24466B;
  --accent:        #E8A33D;   /* ámbar / cobre */
  --accent-hi:     #F5B85B;
  --accent-2:      #4FD1C5;   /* teal, uso puntual */
  --text:          #EAF2FB;
  --text-muted:    #8FA6BF;
  --text-dim:      #5D7690;
  --danger:        #E8654A;
  --success:       #4FD17A;

  /* Tipografía */
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body:    'Inter', 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 12px 30px rgba(0,0,0,0.35);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 42px 42px,
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text);
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
code, .mono { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Barra superior tipo "editor" ---------- */
.topbar {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-dim);
  padding: 6px 0;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar .dots span {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 5px; background: var(--text-dim); opacity: .5;
}
.topbar .dots span:nth-child(1){ background:#E8654A; opacity:.8; }
.topbar .dots span:nth-child(2){ background:#E8A33D; opacity:.8; }
.topbar .dots span:nth-child(3){ background:#4FD17A; opacity:.8; }

/* ---------- Navbar ---------- */
.navbar {
  background: rgba(15,27,45,0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
}
.brand .accent-dot { color: var(--accent); }
.brand small {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 400;
}
.nav-links { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.nav-links a { color: var(--text-muted); font-size: 14.5px; }
.nav-links a:hover { color: var(--accent-hi); text-decoration: none; }
.nav-cart {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text) !important;
}
.nav-cart .count {
  background: var(--accent);
  color: #1a1204;
  border-radius: 999px;
  font-size: 11px;
  padding: 1px 6px;
  margin-left: 6px;
  font-weight: 700;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.btn:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #1a1204; }
.btn-primary:hover { background: var(--accent-hi); }
.btn-outline { background: transparent; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(232,101,74,0.1); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ---------- Hero ---------- */
.hero {
  padding: 86px 0 70px;
  position: relative;
  overflow: hidden;
}
.hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  letter-spacing: .06em;
  margin-bottom: 14px;
}
.hero .eyebrow::before { content: "// "; color: var(--text-dim); }
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  max-width: 760px;
  line-height: 1.12;
}
.hero h1 .hl { color: var(--accent); }
.hero p.lead {
  color: var(--text-muted);
  font-size: 18px;
  max-width: 560px;
  margin: 18px 0 30px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-console {
  margin-top: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 640px;
}
.hero-console .bar {
  display: flex; gap: 6px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); background: var(--bg-alt);
}
.hero-console .bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--text-dim); opacity: .6; }
.hero-console .bar span:nth-child(1){ background:#E8654A; }
.hero-console .bar span:nth-child(2){ background:#E8A33D; }
.hero-console .bar span:nth-child(3){ background:#4FD17A; }
.hero-console pre {
  margin: 0; padding: 20px 22px; font-family: var(--font-mono);
  font-size: 13.5px; color: var(--text-muted); line-height: 1.8; overflow-x: auto;
}
.hero-console .k { color: var(--accent-2); }
.hero-console .s { color: var(--accent-hi); }
.hero-console .cursor { display:inline-block; width:8px; height:14px; background:var(--accent); vertical-align:-2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Secciones ---------- */
.section { padding: 60px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 30px; gap: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: 28px; }
.section-head p { color: var(--text-muted); margin: 6px 0 0; }

/* ---------- Grid de productos ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.product-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.product-card .thumb {
  aspect-ratio: 16/10;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  position: relative;
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .thumb::before {
  content: "</>";
  font-size: 26px;
  color: var(--border);
}
.product-card .thumb img ~ .thumb::before { display:none; }
.product-card .body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.product-card .cat { font-family: var(--font-mono); font-size: 11px; color: var(--accent-2); text-transform: uppercase; letter-spacing: .05em; }
.product-card h3 { font-size: 17px; line-height: 1.35; }
.product-card p { color: var(--text-muted); font-size: 14px; margin: 0; flex: 1; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
}
.price-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.price { font-family: var(--font-mono); font-weight: 700; color: var(--accent-hi); font-size: 17px; }

/* ---------- Detalle de producto ---------- */
.product-detail { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: start; }
@media (max-width: 860px) { .product-detail { grid-template-columns: 1fr; } }
.product-detail .thumb-lg {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--bg-alt); aspect-ratio: 16/10; display:flex; align-items:center; justify-content:center; color: var(--text-dim);
}
.product-detail .thumb-lg img { width: 100%; height: 100%; object-fit: cover; }
.buy-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; position: sticky; top: 90px;
}
.buy-box .price { font-size: 30px; display:block; margin-bottom: 14px; }
.spec-list { list-style: none; margin: 18px 0; padding: 0; font-size: 14px; color: var(--text-muted); }
.spec-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.spec-list li b { color: var(--text); font-weight: 600; }

/* ---------- Formularios ---------- */
.form-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; max-width: 460px; margin: 0 auto;
}
.form-card.wide { max-width: 720px; }
.form-group { margin-bottom: 18px; }
label { display: block; font-size: 13.5px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
input, select, textarea {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
.form-hint { font-size: 12.5px; color: var(--text-dim); margin-top: 6px; }
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }

/* ---------- Alertas / flash ---------- */
.alert { border-radius: var(--radius-sm); padding: 13px 16px; margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.alert-success { background: rgba(79,209,122,0.08); border-color: var(--success); color: var(--success); }
.alert-error   { background: rgba(232,101,74,0.08); border-color: var(--danger); color: var(--danger); }
.alert-info    { background: rgba(79,209,197,0.08); border-color: var(--accent-2); color: var(--accent-2); }

/* ---------- Badges de estado ---------- */
.badge { font-family: var(--font-mono); font-size: 11.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid; text-transform: uppercase; letter-spacing: .04em; }
.badge-pendiente   { color: var(--accent); border-color: var(--accent); }
.badge-en_revision { color: var(--accent-2); border-color: var(--accent-2); }
.badge-pagado      { color: var(--success); border-color: var(--success); }
.badge-cancelado   { color: var(--danger); border-color: var(--danger); }

/* ---------- Tablas ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: rgba(255,255,255,0.015); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap table { margin: 0; }

/* ---------- Carrito ---------- */
.cart-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.cart-row .thumb-sm { width: 74px; height: 50px; border-radius: 6px; background: var(--bg-alt); border: 1px solid var(--border); flex-shrink: 0; overflow: hidden; display:flex; align-items:center; justify-content:center; color: var(--text-dim); font-size:11px;}
.cart-row .thumb-sm img { width: 100%; height: 100%; object-fit: cover; }
.cart-row .info { flex: 1; }
.cart-row .info h4 { font-size: 15px; margin: 0 0 4px; }
.cart-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.cart-summary .line { display: flex; justify-content: space-between; padding: 8px 0; color: var(--text-muted); font-size: 14.5px; }
.cart-summary .line.total { color: var(--text); font-weight: 700; font-size: 17px; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 14px; }

/* ---------- Panel admin ---------- */
.admin-shell { display: flex; min-height: calc(100vh - 130px); }
.admin-sidebar { width: 230px; background: var(--bg-alt); border-right: 1px solid var(--border); padding: 26px 0; flex-shrink: 0; }
.admin-sidebar a {
  display: block; padding: 11px 26px; color: var(--text-muted); font-size: 14px; border-left: 3px solid transparent;
}
.admin-sidebar a:hover, .admin-sidebar a.active { color: var(--text); background: var(--surface); border-left-color: var(--accent); text-decoration: none; }
.admin-main { flex: 1; padding: 34px; overflow-x: auto; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin-bottom: 32px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card .n { font-family: var(--font-mono); font-size: 28px; font-weight: 700; color: var(--accent-hi); }
.stat-card .l { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ---------- Utilidades ---------- */
.empty-state { text-align: center; padding: 70px 20px; color: var(--text-muted); }
.empty-state h3 { color: var(--text); }
.text-muted { color: var(--text-muted); }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:28px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:28px}
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ---------- Footer ---------- */
footer.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 40px 0 26px;
  color: var(--text-dim);
  font-size: 13.5px;
}
footer.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
footer.site-footer a { color: var(--text-muted); }
footer .foot-brand { font-family: var(--font-display); color: var(--text); font-weight: 700; margin-bottom: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .navbar .container { flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border); margin-top: 10px; }
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; padding: 10px; }
  .admin-sidebar a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .admin-sidebar a.active { border-left-color: transparent; border-bottom-color: var(--accent); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
