/* ==========================================================================
   NexoDigital — Tema de la plataforma (sobre Bootstrap 5.3)
   Paleta: índigo profundo + pizarra, estética SaaS moderna, mobile-first.
   ========================================================================== */

/* ---- Fuente Inter (autoalojada) ----------------------------------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../vendor/inter/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../vendor/inter/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../vendor/inter/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../vendor/inter/inter-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../vendor/inter/inter-latin-800-normal.woff2') format('woff2');
}

/* ---- Tokens -------------------------------------------------------------- */
:root {
  --nx-primary: #4f46e5;
  --nx-primary-hover: #4338ca;
  --nx-primary-soft: #eef2ff;
  --nx-accent: #06b6d4;
  --nx-dark: #0f172a;
  --nx-dark-2: #1e293b;
  --nx-body-bg: #f1f5f9;
  --nx-card-bg: #ffffff;
  --nx-border: #e2e8f0;
  --nx-text: #0f172a;
  --nx-text-muted: #64748b;
  --nx-success: #059669;
  --nx-warning: #d97706;
  --nx-danger: #dc2626;
  --nx-radius: 14px;
  --nx-radius-sm: 10px;
  --nx-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --nx-shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, .25);
  --nx-sidebar-w: 264px;

  --bs-primary: #4f46e5;
  --bs-primary-rgb: 79, 70, 229;
  --bs-link-color: #4f46e5;
  --bs-link-hover-color: #4338ca;
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--nx-body-bg);
  color: var(--nx-text);
  -webkit-font-smoothing: antialiased;
}

/* ---- Botones ------------------------------------------------------------- */
.btn { border-radius: var(--nx-radius-sm); font-weight: 600; padding: .55rem 1.1rem; }
.btn-primary {
  --bs-btn-bg: var(--nx-primary);
  --bs-btn-border-color: var(--nx-primary);
  --bs-btn-hover-bg: var(--nx-primary-hover);
  --bs-btn-hover-border-color: var(--nx-primary-hover);
  --bs-btn-active-bg: var(--nx-primary-hover);
  --bs-btn-active-border-color: var(--nx-primary-hover);
  box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .45);
}
.btn-outline-primary {
  --bs-btn-color: var(--nx-primary);
  --bs-btn-border-color: #c7d2fe;
  --bs-btn-hover-bg: var(--nx-primary-soft);
  --bs-btn-hover-color: var(--nx-primary-hover);
  --bs-btn-hover-border-color: #a5b4fc;
  --bs-btn-active-bg: var(--nx-primary-soft);
  --bs-btn-active-color: var(--nx-primary-hover);
  --bs-btn-active-border-color: #a5b4fc;
}
.btn-light { border-color: var(--nx-border); }

/* ---- Formularios --------------------------------------------------------- */
.form-control, .form-select {
  border-radius: var(--nx-radius-sm);
  border-color: var(--nx-border);
  padding: .55rem .85rem;
}
.form-control:focus, .form-select:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .12);
}
.form-label { font-weight: 600; font-size: .875rem; margin-bottom: .35rem; }
.form-text { color: var(--nx-text-muted); }
.invalid-feedback { font-weight: 500; }

/* ---- Tarjetas ------------------------------------------------------------ */
.card { border: 1px solid var(--nx-border); border-radius: var(--nx-radius); }
.nx-card { border: 1px solid var(--nx-border); border-radius: var(--nx-radius); background: var(--nx-card-bg); box-shadow: var(--nx-shadow); }

/* Tarjeta de estadística (KPI) */
.nx-stat { display: flex; align-items: center; gap: 1rem; padding: 1.15rem 1.25rem; }
.nx-stat .nx-stat-icon {
  width: 48px; height: 48px; flex: 0 0 48px;
  display: grid; place-items: center;
  border-radius: 12px; font-size: 1.35rem;
  background: var(--nx-primary-soft); color: var(--nx-primary);
}
.nx-stat .nx-stat-icon.is-success { background: #ecfdf5; color: var(--nx-success); }
.nx-stat .nx-stat-icon.is-warning { background: #fffbeb; color: var(--nx-warning); }
.nx-stat .nx-stat-icon.is-info { background: #ecfeff; color: #0891b2; }
.nx-stat .nx-stat-icon.is-danger { background: #fef2f2; color: var(--nx-danger); }
.nx-stat-value { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.nx-stat-label { color: var(--nx-text-muted); font-size: .82rem; font-weight: 600; }

/* ---- Badges suaves ------------------------------------------------------- */
.badge { font-weight: 600; border-radius: 999px; padding: .38em .75em; }
.nx-badge-soft-success { background: #ecfdf5; color: #047857; }
.nx-badge-soft-warning { background: #fffbeb; color: #b45309; }
.nx-badge-soft-danger { background: #fef2f2; color: #b91c1c; }
.nx-badge-soft-info { background: #ecfeff; color: #0e7490; }
.nx-badge-soft-secondary { background: #f1f5f9; color: #475569; }
.nx-badge-soft-dark { background: #e2e8f0; color: #1e293b; }
.nx-badge-soft-primary { background: var(--nx-primary-soft); color: var(--nx-primary-hover); }

/* ---- Navbar pública ------------------------------------------------------ */
.nx-navbar {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--nx-border);
}
.nx-navbar .navbar-brand { font-weight: 800; font-size: 1.25rem; color: var(--nx-dark); }
.nx-navbar .navbar-brand .nx-logo-dot { color: var(--nx-primary); }
.nx-navbar .nav-link { font-weight: 600; color: #334155; }
.nx-navbar .nav-link:hover, .nx-navbar .nav-link.active { color: var(--nx-primary); }

/* ---- Hero ---------------------------------------------------------------- */
.nx-hero {
  background:
    radial-gradient(1000px 400px at 85% -10%, rgba(79, 70, 229, .35), transparent 60%),
    radial-gradient(700px 300px at 10% 110%, rgba(6, 182, 212, .25), transparent 60%),
    linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  color: #fff;
  padding: 5rem 0 5.5rem;
}
.nx-hero h1 { font-weight: 800; letter-spacing: -.02em; }
.nx-hero .lead { color: #cbd5e1; max-width: 620px; }
.nx-hero .btn-light { color: var(--nx-dark); font-weight: 700; }

/* ---- Secciones tienda ---------------------------------------------------- */
.nx-section { padding: 3.5rem 0; }
.nx-section-title { font-weight: 800; letter-spacing: -.01em; margin-bottom: .35rem; }
.nx-section-sub { color: var(--nx-text-muted); margin-bottom: 2rem; }

.nx-category-card {
  display: block; text-decoration: none;
  background: #fff; border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius); padding: 1.35rem 1.15rem;
  text-align: center; color: var(--nx-text);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  height: 100%;
}
.nx-category-card:hover { transform: translateY(-3px); box-shadow: var(--nx-shadow); border-color: #c7d2fe; color: var(--nx-primary); }
.nx-category-card i { font-size: 1.75rem; color: var(--nx-primary); display: block; margin-bottom: .6rem; }
.nx-category-card .nx-cat-name { font-weight: 700; font-size: .95rem; }

/* Tarjeta de producto */
.nx-product-card {
  background: #fff; border: 1px solid var(--nx-border); border-radius: var(--nx-radius);
  overflow: hidden; height: 100%; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.nx-product-card:hover { transform: translateY(-3px); box-shadow: var(--nx-shadow); }
.nx-product-thumb {
  aspect-ratio: 16 / 10; background: linear-gradient(135deg, #eef2ff, #f8fafc);
  display: grid; place-items: center; color: #a5b4fc; font-size: 2.25rem;
}
.nx-product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.nx-product-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.nx-product-title { font-weight: 700; font-size: .98rem; color: var(--nx-text); text-decoration: none; }
.nx-product-title:hover { color: var(--nx-primary); }
.nx-product-price { font-weight: 800; color: var(--nx-primary); font-size: 1.05rem; }
.nx-product-price .nx-price-old { color: var(--nx-text-muted); text-decoration: line-through; font-weight: 500; font-size: .85rem; margin-left: .4rem; }

/* ---- Footer -------------------------------------------------------------- */
.nx-footer { background: var(--nx-dark); color: #94a3b8; padding: 3rem 0 1.5rem; margin-top: 2rem; }
.nx-footer a { color: #cbd5e1; text-decoration: none; }
.nx-footer a:hover { color: #fff; }
.nx-footer .nx-footer-brand { color: #fff; font-weight: 800; font-size: 1.2rem; }
.nx-footer hr { border-color: #1e293b; opacity: 1; }

/* ---- Auth ---------------------------------------------------------------- */
.nx-auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(800px 300px at 90% -10%, rgba(79, 70, 229, .18), transparent 60%),
    radial-gradient(600px 260px at 5% 110%, rgba(6, 182, 212, .12), transparent 60%),
    var(--nx-body-bg);
}
.nx-auth-card { width: 100%; max-width: 430px; }
.nx-auth-card.nx-auth-card-wide { max-width: 560px; }

/* Selector de tipo de cuenta en el registro (comprar vs vender) */
.nx-pick-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 2px solid var(--bs-border-color, #dee2e6); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; text-align: left;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.nx-pick-card .nx-pick-icon {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 10px;
  display: grid; place-items: center; font-size: 1.25rem;
  background: #eef2ff; color: #4f46e5;
}
.nx-pick-card .nx-pick-title { font-weight: 700; display: block; line-height: 1.2; }
.nx-pick-card .nx-pick-sub { font-size: .8rem; color: #6c757d; display: block; }
.btn-check:checked + .nx-pick-card {
  border-color: #4f46e5; background: #eef2ff;
  box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .12);
}
.btn-check:focus-visible + .nx-pick-card { box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .25); }
.nx-auth-card .card { box-shadow: var(--nx-shadow-lg); border: 0; }
.nx-auth-brand { text-align: center; font-weight: 800; font-size: 1.5rem; color: var(--nx-dark); text-decoration: none; display: block; margin-bottom: 1.25rem; }
.nx-auth-brand .nx-logo-dot { color: var(--nx-primary); }

/* ---- Panel (admin / vendedor / cliente) ---------------------------------- */
.nx-app { min-height: 100vh; }

.nx-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--nx-sidebar-w);
  background: var(--nx-dark); color: #cbd5e1; z-index: 1040;
  display: flex; flex-direction: column;
  transform: translateX(0); transition: transform .2s ease;
}
.nx-sidebar .nx-sidebar-brand {
  display: flex; align-items: center; gap: .5rem;
  padding: 1.15rem 1.25rem; color: #fff; font-weight: 800; font-size: 1.15rem;
  text-decoration: none; border-bottom: 1px solid rgba(148, 163, 184, .12);
}
.nx-sidebar .nx-sidebar-brand .nx-logo-dot { color: #818cf8; }
.nx-sidebar-section { padding: 1rem 1.25rem .35rem; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #64748b; }
.nx-sidebar-nav { list-style: none; margin: 0; padding: .35rem .75rem 1rem; overflow-y: auto; flex: 1; }
.nx-sidebar-nav a {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .75rem; margin-bottom: 2px;
  color: #cbd5e1; text-decoration: none; font-weight: 500; font-size: .92rem;
  border-radius: 10px; transition: background .12s ease, color .12s ease;
}
.nx-sidebar-nav a i { font-size: 1.05rem; width: 22px; text-align: center; color: #94a3b8; }
.nx-sidebar-nav a:hover { background: rgba(148, 163, 184, .1); color: #fff; }
.nx-sidebar-nav a.active { background: var(--nx-primary); color: #fff; box-shadow: 0 6px 16px -8px rgba(79, 70, 229, .8); }
.nx-sidebar-nav a.active i { color: #e0e7ff; }
.nx-sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(148, 163, 184, .12); font-size: .8rem; color: #64748b; }

.nx-main { margin-left: var(--nx-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

.nx-topbar {
  position: sticky; top: 0; z-index: 1030;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--nx-border);
  padding: .65rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.nx-topbar .nx-page-title { font-weight: 700; font-size: 1.02rem; margin: 0; }
.nx-burger { display: none; border: 1px solid var(--nx-border); background: #fff; border-radius: 10px; width: 40px; height: 40px; }

.nx-user-chip {
  display: flex; align-items: center; gap: .6rem;
  border: 1px solid var(--nx-border); background: #fff;
  border-radius: 999px; padding: .3rem .85rem .3rem .3rem;
  cursor: pointer;
}
.nx-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--nx-primary); color: #fff; font-weight: 700; font-size: .85rem;
  display: grid; place-items: center;
}
.nx-user-chip .nx-user-name { font-weight: 600; font-size: .88rem; }

.nx-content { padding: 1.75rem 1.5rem 3rem; flex: 1; }
.nx-content-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.nx-content-header h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.nx-content-header .nx-breadcrumb { color: var(--nx-text-muted); font-size: .85rem; }

/* Tablas de panel */
.nx-table-card { overflow: hidden; }
.nx-table-card .table { margin: 0; }
.nx-table-card .table thead th {
  background: #f8fafc; color: #475569; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .04em; font-weight: 700; border-bottom: 1px solid var(--nx-border);
  padding: .75rem 1rem; white-space: nowrap;
}
.nx-table-card .table tbody td { padding: .8rem 1rem; vertical-align: middle; border-color: #f1f5f9; }
.nx-table-card .table tbody tr:hover { background: #f8fafc; }
.table-responsive { border-radius: var(--nx-radius); }

/* Estado vacío */
.nx-empty { text-align: center; padding: 3.5rem 1.5rem; color: var(--nx-text-muted); }
.nx-empty i { font-size: 2.6rem; display: block; margin-bottom: .85rem; color: #cbd5e1; }
.nx-empty .nx-empty-title { font-weight: 700; color: var(--nx-text); margin-bottom: .25rem; }

/* Alertas */
.alert { border-radius: var(--nx-radius-sm); border: 0; }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info { background: #eff6ff; color: #1e40af; }

/* Dropdowns */
.dropdown-menu { border: 1px solid var(--nx-border); border-radius: 12px; box-shadow: var(--nx-shadow); padding: .4rem; }
.dropdown-item { border-radius: 8px; font-weight: 500; font-size: .92rem; padding: .5rem .75rem; }
.dropdown-item:active { background: var(--nx-primary); }

/* Paginación */
.pagination { --bs-pagination-active-bg: var(--nx-primary); --bs-pagination-active-border-color: var(--nx-primary); --bs-pagination-color: var(--nx-primary); --bs-pagination-border-radius: 10px; }

/* ---- Texto enriquecido (descripciones de producto) ----------------------- */
.nx-rich-text { color: #334155; }
.nx-rich-text h2, .nx-rich-text h3, .nx-rich-text h4 { font-weight: 700; margin: 1.25rem 0 .5rem; }
.nx-rich-text h2 { font-size: 1.25rem; }
.nx-rich-text h3 { font-size: 1.1rem; }
.nx-rich-text h4 { font-size: 1rem; }
.nx-rich-text ul, .nx-rich-text ol { padding-left: 1.4rem; margin-bottom: 1rem; }
.nx-rich-text li { margin-bottom: .25rem; }
.nx-rich-text table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.nx-rich-text th, .nx-rich-text td { border: 1px solid var(--nx-border); padding: .5rem .75rem; font-size: .92rem; }
.nx-rich-text blockquote { border-left: 3px solid var(--nx-primary); padding-left: 1rem; color: var(--nx-text-muted); }
.nx-rich-text pre { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 1rem; overflow-x: auto; }
.nx-rich-text code { font-size: .875em; }

/* List group (filtros de catálogo) */
.list-group-item.active { background: var(--nx-primary); border-color: var(--nx-primary); }
.list-group-item.active .text-muted { color: #e0e7ff !important; }

/* Pills de pestañas del panel */
.nav-pills .nav-link { font-weight: 600; color: #475569; border-radius: 10px; }
.nav-pills .nav-link.active { background: var(--nx-primary); }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 991.98px) {
  .nx-sidebar { transform: translateX(-100%); }
  .nx-sidebar.show { transform: translateX(0); box-shadow: var(--nx-shadow-lg); }
  .nx-main { margin-left: 0; }
  .nx-burger { display: inline-grid; place-items: center; }
  .nx-backdrop {
    position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
    z-index: 1035; opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .nx-backdrop.show { opacity: 1; pointer-events: auto; }
  .nx-hero { padding: 3.5rem 0 4rem; }
}

@media (max-width: 575.98px) {
  .nx-content { padding: 1.25rem 1rem 2.5rem; }
  .nx-topbar { padding: .6rem 1rem; }
  .nx-user-chip .nx-user-name { display: none; }
}
