/* ══════════════════════════════════════════
             TOKENS — sistema de diseño NikoMoto
          ══════════════════════════════════════════ */
:root {
  --red: #FF6B00;
  --red-dark: #E05500;
  --red-light: #FFF1E6;
  --amber: #ef9f27;
  --amber-dark: #854f0b;
  --teal: #5dcaa5;
  --blue: #85b7eb;
  --purple: #afa9ec;
  --offer: #e91e63;
  --offer-dark: #ad1457;

  --bg-900: #111111;
  --bg-800: #1a1a1a;
  --bg-700: #1e1e1e;
  --bg-600: #222222;
  --bg-500: #2a2a2a;
  --bg-400: #2e2e2e;
  --bg-300: #333333;

  --text-primary: #e0e0e0;
  --text-secondary: #888888;
  --text-muted: #555555;

  --border: 1px solid #2e2e2e;
  --border-light: 1px solid #222222;
  --border-hover: 1px solid #3a3a3a;

  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
}

/* ══════════════════════════════════════════
             MODO CLARO — paleta clara acorde a repuestos de moto
          ══════════════════════════════════════════ */
html[data-theme="light"] {
  --bg-900: #f2efe9;
  --bg-800: #ffffff;
  --bg-700: #f8f6f2;
  --bg-600: #ebe6de;
  --bg-500: #e2ddd3;
  --bg-400: #d6cfc3;
  --bg-300: #c9c1b3;

  --text-primary: #18170f;
  --text-secondary: #5a564e;
  --text-muted: #8a8577;

  --border: 1px solid #e6e1d8;
  --border-light: 1px solid #ece7de;
  --border-hover: 1px solid #d6cfc3;
}
[data-theme="light"] .ctx-icon,
[data-theme="light"] .ctx-dismiss:hover,
[data-theme="light"] .af-chip,
[data-theme="light"] .pc-badge-sale {
  background: var(--red-light);
  border-color: #f3caca;
}
[data-theme="light"] .pc-badge-new {
  background: #e7f1fc;
  border-color: #cfe3fa;
  color: #1565c0;
}
[data-theme="light"] .pc-badge-offer {
  background: var(--offer);
  border-color: var(--offer-dark);
  color: #fff;
}
[data-theme="light"] .pc-badge-hot,
[data-theme="light"] .pc-badge-low,
[data-theme="light"] .pc-stock-low {
  background: #fff3df;
  border-color: #ffe3ae;
}
[data-theme="light"] .pc-btn-detail,
[data-theme="light"] .pl-btn-detail,
[data-theme="light"] .plbv {
  color: #1565c0;
}
[data-theme="light"] .pc-btn-detail:hover,
[data-theme="light"] .pl-btn-detail:hover,
[data-theme="light"] .plbv:hover {
  background: #e7f1fc;
  border-color: #1565c0;
}
[data-theme="light"] .pc-stock-ok {
  background: #e6f7ef;
  border-color: #c9ecd9;
  color: #1e7a4c;
}
[data-theme="light"] #sidebar,
[data-theme="light"] #cartDrawer,
[data-theme="light"] #sidebar-filters,
[data-theme="light"] #sidebar .sidebar-head,
[data-theme="light"] #cartDrawer .cart-head,
[data-theme="light"] #cartDrawer .cart-footer,
[data-theme="light"] .sf-mobile-head,
[data-theme="light"] .nav,
[data-theme="light"] #sidebar .sb-divider {
  border-color: #e6e1d8;
}
[data-theme="light"] #sidebar .sb-item:hover {
  background: var(--red-light);
}
[data-theme="light"] .nav-link {
  color: var(--text-secondary);
}
[data-theme="light"] .nav-link:hover {
  background: var(--bg-600);
  color: var(--text-primary);
}
[data-theme="light"] .nav-link.active {
  color: var(--red);
}
[data-theme="light"] .toast {
  background: #e8f7e9;
  border-color: #bfe6c2;
  color: #1f6b2c;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  background: var(--bg-900);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ══════════════════════════════════════════
             PÁGINA DE CATÁLOGO
          ══════════════════════════════════════════ */
.catalog-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Breadcrumb */
.nk-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.nk-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.nk-breadcrumb a:hover {
  color: var(--red);
}
.nk-breadcrumb .bc-sep {
  color: var(--bg-300);
  font-size: 10px;
}
.nk-breadcrumb .bc-active {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ── Layout principal sidebar + contenido ── */
.catalog-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  .catalog-grid {
    grid-template-columns: 1fr;
  }

  /* La sidebar de filtros pasa a ser un panel off-canvas: no ocupa
     espacio en el grid y por lo tanto no se sobrepone a los productos. */
  #sidebar-filters {
    position: fixed;
    top: 0;
    left: -100%;
    width: min(320px, 88vw);
    height: 100%;
    z-index: 220;
    background: var(--bg-800);
    border-right: 1px solid #333;
    padding: 0 0 1.25rem;
    overflow-y: auto;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  #sidebar-filters.mobile-open {
    left: 0;
  }
  #sidebar-filters .sb-card {
    margin: 0 1rem;
  }
}

/* ══════════════════════════════════════════
             SIDEBAR FILTROS
          ══════════════════════════════════════════ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 72px;
}

/* Encabezado del panel de filtros (título + cerrar), solo visible en el
   modo off-canvas móvil) */
.sf-mobile-head {
  display: none;
}
@media (max-width: 900px) {
  .sf-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    margin-bottom: 10px;
    border-bottom: 1px solid #333;
    background: var(--bg-700);
    position: sticky;
    top: 0;
  }
  .sf-mobile-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
  }
  .sf-mobile-title i {
    color: var(--red);
    font-size: 13px;
  }
}

.sb-card {
  background: var(--bg-800);
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.sb-head {
  padding: 10px 1rem;
  border-bottom: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sb-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.sb-clear {
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.sb-clear:hover {
  color: var(--red);
}

.sb-body {
  padding: 10px 1rem;
}

.filter-search {
  width: 100%;
  background: var(--bg-900);
  border: var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}
.filter-search:focus {
  border-color: var(--red);
}
.filter-search::placeholder {
  color: var(--text-muted);
}

.filter-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}
.filter-opt:hover {
  background: var(--bg-500);
}

.fo-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.fo-check {
  width: 15px;
  height: 15px;
  border: 1px solid var(--bg-300);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.fo-check.on {
  background: var(--red);
  border-color: var(--red);
}
.fo-check.on::after {
  content: "";
  display: block;
  width: 7px;
  height: 4px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

.fo-label {
  font-size: 12px;
  color: var(--text-secondary);
  transition: color 0.15s;
}
.filter-opt:hover .fo-label {
  color: var(--text-primary);
}

.fo-count {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-600);
  padding: 1px 7px;
  border-radius: 10px;
}

/* Rango de precio */
.price-range-vals {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.price-range-vals span {
  font-weight: 600;
  color: var(--text-primary);
}

input[type="range"] {
  width: 100%;
  height: 4px;
  accent-color: var(--red);
  margin-bottom: 6px;
  cursor: pointer;
}

/* ══════════════════════════════════════════
             MAIN — toolbar + grid/lista
          ══════════════════════════════════════════ */
.main-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Banner contextual (categoría o marca activa) */
.ctx-banner {
  background: var(--bg-800);
  border: var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 12px 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ctx-icon {
  width: 34px;
  height: 34px;
  background: #2a0a0a;
  border: 1px solid #3a1515;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--red);
  font-size: 14px;
}
.ctx-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.ctx-sub {
  font-size: 11px;
  color: var(--text-muted);
}
.ctx-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}
.ctx-dismiss:hover {
  color: var(--red);
  background: #2a0a0a;
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.t-search {
  flex: 1;
  max-width: 280px;
  background: var(--bg-800);
  border: var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}
.t-search:focus {
  border-color: var(--red);
}
.t-search::placeholder {
  color: var(--text-muted);
}

.t-count {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.sort-select {
  background: var(--bg-800);
  border: var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}
.sort-select:focus {
  border-color: var(--red);
}

.view-btns {
  display: flex;
  gap: 4px;
}
.view-btn {
  background: none;
  border: var(--border);
  border-radius: 7px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  color: var(--text-muted);
}
.view-btn:hover {
  background: var(--bg-500);
  color: var(--text-primary);
}
.view-btn.active {
  background: var(--bg-500);
  border-color: var(--bg-300);
  color: var(--text-primary);
}

/* Chips filtros activos */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.af-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1a0808;
  border: 1px solid #2a1515;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-secondary);
}
.af-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}
.af-chip button:hover {
  color: var(--red);
}

/* ══════════════════════════════════════════
             GRID DE PRODUCTOS
          ══════════════════════════════════════════ */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.prod-card {
  background: var(--bg-800);
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    border-color 0.2s,
    transform 0.2s;
  cursor: pointer;
}
.prod-card:hover {
  border-color: #3a3a3a;
  transform: translateY(-2px);
}

.pc-img {
  height: 170px;
  background: var(--bg-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  border-bottom: var(--border-light);
  position: relative;
  overflow: hidden;
}
.pc-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pc-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.pc-badge-sale {
  background: #2a0a0a;
  color: var(--red);
  border: 1px solid #3a1515;
}
.pc-badge-new {
  background: #0a1525;
  color: var(--blue);
  border: 1px solid #0c2040;
}
.pc-badge-offer {
  background: var(--offer-dark);
  color: #fff;
  border: 1px solid var(--offer);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
}
.pc-badge-hot {
  background: #1a1200;
  color: var(--amber);
  border: 1px solid #3a2800;
}
.pc-badge-low {
  background: #1a1200;
  color: var(--amber);
  border: 1px solid #3a2800;
}

.pc-body {
  padding: 10px 12px;
}
.pc-brand {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 700;
  margin-bottom: 3px;
}
.pc-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 3px;
}
.pc-cat {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.pc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pc-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--amber);
}
.pc-stock-ok {
  font-size: 10px;
  background: #0d2a0d;
  color: var(--teal);
  border: 1px solid #1e4a1e;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}
.pc-stock-low {
  font-size: 10px;
  background: #1a1200;
  color: var(--amber);
  border: 1px solid #3a2800;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}
.pc-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  border-top: var(--border-light);
  padding-top: 8px;
}
.pc-btn-detail {
  flex: 1;
  background: none;
  border: var(--border);
  border-radius: 6px;
  padding: 5px 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  text-decoration: none;
  display: block;
}
.pc-btn-detail:hover {
  background: #0a1525;
  border-color: var(--blue);
}
.pc-btn-cart {
  background: var(--red);
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  transition: all 0.2s;
  flex-shrink: 0;
}
.pc-btn-cart:hover {
  background: var(--red-dark);
  transform: scale(1.05);
}
.pc-btn-cart:disabled,
.plbc:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ══════════════════════════════════════════
             VISTA LISTA
          ══════════════════════════════════════════ */
.prod-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pl-row {
  background: var(--bg-800);
  border: var(--border);
  border-radius: var(--radius);
  padding: 12px 1rem;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 110px 100px 80px auto;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s;
  cursor: pointer;
}
.pl-row:hover {
  border-color: var(--bg-300);
}

.pl-img {
  width: 56px;
  height: 56px;
  background: var(--bg-600);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.pl-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 2px;
}
.pl-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.pl-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--amber);
  text-align: right;
}
.pl-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}
.pl-btn-detail {
  background: none;
  border: var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.pl-btn-detail:hover {
  background: #0a1525;
  border-color: var(--blue);
}
.pl-btn-cart {
  background: var(--red);
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  transition: all 0.2s;
  flex-shrink: 0;
}
.pl-btn-cart:hover {
  background: var(--red-dark);
}

/* ══════════════════════════════════════════
             PAGINACIÓN
          ══════════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 0;
}
.pg-btn {
  background: none;
  border: var(--border);
  border-radius: 7px;
  width: 32px;
  height: 32px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.pg-btn:hover {
  background: var(--bg-500);
  color: var(--text-primary);
}
.pg-btn.cur {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.pg-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.pg-ellipsis {
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 4px;
}

/* ══════════════════════════════════════════
             EMPTY STATE
          ══════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--bg-800);
  border: var(--border);
  border-radius: var(--radius-lg);
}
.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.3;
}
.empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.empty-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════
             MOBILE FILTER TOGGLE
          ══════════════════════════════════════════ */
.mobile-filter-btn {
  display: none;
  background: var(--bg-800);
  border: var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.mobile-filter-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

@media (max-width: 900px) {
  .mobile-filter-btn {
    display: flex;
  }
}

.plcard {
  background: var(--bg-800);
  border: var(--border);
  border-radius: var(--radius);
  padding: 12px 1rem;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.15s;
  cursor: pointer;
}
.plcard:hover {
  border-color: var(--bg-300);
}
.plimg {
  width: 54px;
  height: 54px;
  background: var(--bg-600);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
}
.plimg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.plinfo {
  flex: 1;
  min-width: 0;
}
.plname {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.plmeta {
  font-size: 11px;
  color: var(--text-muted);
}
.plstock {
  flex-shrink: 0;
}
.plprice {
  font-size: 14px;
  font-weight: 800;
  color: var(--amber);
  white-space: nowrap;
  flex-shrink: 0;
}
.placts {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.plbv {
  background: none;
  border: var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.plbv:hover {
  background: #0a1525;
}
.plbc {
  background: var(--red);
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.plbc:hover {
  background: var(--red-dark);
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7); /* más opaco */
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.overlay.show {
  opacity: 1;
  pointer-events: all;
}

/* Sidebar lateral izquierdo */
#sidebar {
  position: fixed;
  left: -280px;
  top: 0;
  width: 280px;
  height: 100%;
  background: var(--bg-800); /* sólido */
  border-right: 1px solid #333;
  z-index: 200;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
#sidebar.open {
  left: 0;
}

#sidebar .sidebar-head {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-700);
}
#sidebar .sidebar-brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
#sidebar .sidebar-brand span {
  color: var(--red);
}

#sidebar .close-sb {
  background: none;
  border: 1px solid #444;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
#sidebar .close-sb:hover {
  color: var(--red);
}

#sidebar .sb-menu {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}
#sidebar .sb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
#sidebar .sb-item:hover {
  background: var(--bg-600);
  color: var(--text-primary);
  border-left-color: var(--red);
}
#sidebar .sb-item i {
  width: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
#sidebar .sb-item:hover i {
  color: var(--red);
}

#sidebar .sb-divider {
  height: 1px;
  background: #333;
  margin: 8px 1.5rem;
}
#sidebar .sb-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 12px 1.5rem 4px;
  text-transform: uppercase;
}

/* Cart Drawer lateral derecho */
#cartDrawer {
  position: fixed;
  right: -320px;
  top: 0;
  width: 320px;
  height: 100%;
  background: var(--bg-800); /* sólido */
  border-left: 1px solid #333;
  z-index: 200;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
#cartDrawer.open {
  right: 0;
}

#cartDrawer .cart-head {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-700);
}
#cartDrawer .cart-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}
#cartDrawer .cart-title span {
  background: var(--red);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}

#cartDrawer .cart-items {
  flex: 1;
  padding: 1rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#cartDrawer .cart-item {
  background: var(--bg-700);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}
#cartDrawer .ci-icon {
  width: 42px;
  height: 42px;
  background: var(--bg-600);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
#cartDrawer .ci-info {
  flex: 1;
}
#cartDrawer .ci-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}
#cartDrawer .ci-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--amber);
  margin-top: 2px;
}
#cartDrawer .ci-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px;
  transition: color 0.15s;
}
#cartDrawer .ci-remove:hover {
  color: var(--red);
}

#cartDrawer .cart-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid #333;
  background: var(--bg-700);
}
#cartDrawer .cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
#cartDrawer .cart-total-label {
  font-size: 13px;
  color: var(--text-secondary);
}
#cartDrawer .cart-total-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--amber);
}
#cartDrawer .checkout-btn {
  width: 100%;
  background: var(--red);
  border: none;
  color: #fff;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
#cartDrawer .checkout-btn:hover {
  background: var(--red-dark);
}

/* Navbar superior */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-800); /* sólido */
  border-bottom: 1px solid #333;
  padding: 0 1.5rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cart-btn {
  background: none;
  border: 1.5px solid var(--red);
  color: var(--red);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  position: relative;
  font-size: 14px;
  transition: all 0.2s;
}
.cart-btn:hover {
  background: var(--red);
  color: #fff;
}
.cart-count {
  position: absolute;
  top: -7px;
  right: -7px;
  background: var(--amber);
  color: var(--amber-dark);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.brand span {
  color: var(--red);
}
.menu-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  transition: color 0.2s;
}
.menu-btn:hover {
  color: var(--text);
}
.theme-toggle-btn {
  background: none;
  border: 1.5px solid var(--amber);
  color: var(--amber);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle-btn:hover,
.theme-toggle-btn.active {
  background: var(--amber);
  color: var(--amber-dark);
}

/* ══════════════════════════════════════════
             FOOTER
          ══════════════════════════════════════════ */
.nk-footer {
  background: var(--bg-800);
  border-top: var(--border);
  padding: 12px 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}
.nk-footer-brand {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}
.nk-footer-brand span {
  color: var(--red);
}
.nk-footer-copy {
  font-size: 11px;
  color: var(--text-muted);
}
.nk-social {
  display: flex;
  gap: 6px;
}
.nk-social-btn {
  width: 26px;
  height: 26px;
  background: var(--bg-700);
  border: var(--border);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.nk-social-btn:hover {
  background: #2a0a0a;
  border-color: var(--red);
  color: var(--red);
}
html[data-theme="light"] .nk-social-btn:hover {
  background: var(--red-light);
}

/* Estilos de los enlaces del sidebar */
#sidebar .sb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 1.5rem;
  color: var(--text-primary); /* texto visible */
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
#sidebar .sb-item:hover {
  background: var(--bg-600);
  color: var(--red); /* resalta al pasar el mouse */
  border-left-color: var(--red);
}
#sidebar .sb-item i {
  width: 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}
#sidebar .sb-item:hover i {
  color: var(--red);
}

/* Botón de cerrar (sidebar y carrito) */
.close-sb {
  background: none;
  border: 1px solid var(--red);
  color: var(--red);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.close-sb:hover {
  background: var(--red);
  color: #fff;
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-link {
  color: #ccc;
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
  font-weight: 500;
}
.nav-link:hover {
  background: #2e2e2e;
  color: #fff;
}
.nav-link.active {
  color: #FF6B00;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: min(320px, calc(100vw - 40px));
  background: #1e3a1e;
  border: 1px solid #2d5a2d;
  color: #a3d9a5;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  z-index: 300;
  transform: translateX(200px);
  opacity: 0;
  /* Nunca es interactivo (solo notificación) -- sin esto, un nombre de
     producto largo lo hace lo bastante ancho para tapar (aun oculto,
     el translateX no alcanza a sacarlo del todo) el botón "Finalizar
     compra" del drawer del carrito, que queda en la misma esquina. */
  pointer-events: none;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show {
  transform: translateX(0);
  opacity: 1;
}

/* ══════════════════════════════════════════
             RESPONSIVE — TABLET / MÓVIL
          ══════════════════════════════════════════ */
@media (max-width: 768px) {
  /* NAVBAR: en móvil solo queda marca + carrito + hamburguesa */
  .nav {
    padding: 0 1rem;
  }
  .nav-links {
    display: none;
  }
  .brand {
    font-size: 18px;
  }
  .brand .brand-logo {
    height: 42px !important;
  }

  .catalog-page {
    padding: 1rem;
  }

  /* SIDEBAR FILTROS / CARRITO: no exceder el ancho de pantalla en móviles muy angostos */
  #sidebar,
  #cartDrawer {
    width: min(280px, 85vw);
  }
  #cartDrawer {
    width: min(320px, 88vw);
  }
}

/* Botón flotante de WhatsApp -- fijo en todas las páginas del ecommerce */
.wa-float{position:fixed;bottom:22px;right:22px;z-index:1000;width:56px;height:56px;border-radius:50%;background:#25D366;color:#fff;display:flex;align-items:center;justify-content:center;font-size:28px;box-shadow:0 4px 16px rgba(0,0,0,0.35);text-decoration:none;transition:transform 0.2s,background 0.2s}
.wa-float:hover{transform:scale(1.08);background:#1DA851;color:#fff}
@media (max-width:600px){.wa-float{width:50px;height:50px;font-size:24px;bottom:16px;right:16px}}

/* Ícono SVG de categoría como respaldo de productos sin foto (no se estira
   como las fotos: tamaño propio, ver static/js/iconosCategoria.js) */
.pc-img img.prod-fallback,
img.prod-fallback { width: auto; height: auto; max-width: 72px; max-height: 72px; object-fit: contain; }
[data-theme="light"] .cat-ico { filter: brightness(.72) saturate(1.35); }

/* Logo + nombre centrados en la barra (independiente del ancho de los
   botones de cada lado). En celular muy angosto solo queda el logo, para no
   montarse sobre los botones del tema/carrito. */
.nav .brand{position:absolute;left:50%;transform:translateX(-50%);white-space:nowrap}
@media (max-width:420px){.nav .brand b{display:none}}

/* ── Mi moto + sugerencia de página de modelo ── */
.mm-link { display: block; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--red); text-decoration: none; }
.mm-link:hover { text-decoration: underline; }
.moto-sugerida { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding: 12px 16px; border-radius: 10px; background: rgba(255, 107, 0, .08); border: 1px solid rgba(255, 107, 0, .35); color: var(--text-primary); font-size: 13px; }
.moto-sugerida i { color: var(--red); margin-right: 6px; }
.moto-sugerida a { color: var(--red); font-weight: 800; text-decoration: none; white-space: nowrap; }
.moto-sugerida a:hover { text-decoration: underline; }
.moto-sugerida[hidden], .mm-link[hidden] { display: none; }

/* ══════════════════════════════════════════
   VISTA LISTA RESPONSIVE (la cuadrícula no se toca)
   Escritorio: una fila -> imagen | nombre | stock | precio | acciones.
   Tablet/celular: la fila se reacomoda en bloques para que nada se corte.
   ══════════════════════════════════════════ */
.prod-list .plcard {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto auto auto;
  grid-template-areas: "img info stock price acts";
  align-items: center;
  gap: 8px 14px;
}
.prod-list .plimg   { grid-area: img; }
.prod-list .plinfo  { grid-area: info; }
.prod-list .plstock { grid-area: stock; }
.prod-list .plprice { grid-area: price; }
.prod-list .placts  { grid-area: acts; }
.prod-list .plimg img.prod-fallback { width: 40px; height: 40px; object-fit: contain; }

@media (max-width: 760px) {
  .prod-list .plcard {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    grid-template-areas:
      "img info  info"
      "img price stock"
      "img acts  acts";
    padding: 12px;
    gap: 6px 12px;
    align-items: start;
  }
  .prod-list .plimg { width: 64px; height: 64px; }
  /* el nombre ocupa hasta 2 líneas en vez de cortarse en una */
  .prod-list .plname {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
  }
  .prod-list .plprice { align-self: center; font-size: 15px; }
  .prod-list .plstock { align-self: center; justify-self: end; }
  .prod-list .placts  { width: 100%; }
  .prod-list .plbv    { flex: 1; text-align: center; padding: 7px 10px; }
  .prod-list .plbc    { width: 34px; height: 32px; }
}

@media (max-width: 380px) {
  .prod-list .plcard { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .prod-list .plimg  { width: 52px; height: 52px; }
}
