/* NBA Card Hunter — Styles */
#nch-app {
  --nch-bg:       #0a0a0f;
  --nch-surface:  #13131a;
  --nch-surface2: #1c1c27;
  --nch-border:   #2a2a3a;
  --nch-gold:     #c9a84c;
  --nch-gold-dim: #8a6e2f;
  --nch-text:     #e8e8f0;
  --nch-dim:      #6b6b80;
  --nch-red:      #e84040;
  --nch-green:    #3dba6f;

  background: var(--nch-bg);
  color: var(--nch-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  border-radius: 12px;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Notice */
.nch-notice {
  background: rgba(201,168,76,.12);
  border: 1px solid var(--nch-gold-dim);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 20px;
  color: var(--nch-gold);
}
.nch-notice a { color: var(--nch-gold); }

/* Search bar */
.nch-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.nch-search-bar input {
  flex: 1;
  background: var(--nch-surface);
  border: 2px solid var(--nch-border);
  border-radius: 8px;
  color: var(--nch-text);
  padding: 13px 18px;
  font-size: 16px;
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
}
.nch-search-bar input:focus { border-color: var(--nch-gold); }
.nch-search-bar input::placeholder { color: var(--nch-dim); }

#nch-btn {
  background: var(--nch-gold);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 13px 28px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  transition: opacity .2s;
  white-space: nowrap;
  font-family: inherit;
}
#nch-btn:hover    { opacity: .85; }
#nch-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Advanced filters row */
.nch-advanced {
  background: var(--nch-surface);
  border: 1px solid var(--nch-border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.nch-advanced-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.nch-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 110px;
}
.nch-field-label {
  font-size: 11px;
  color: var(--nch-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.nch-field-input {
  background: var(--nch-surface2);
  border: 1px solid var(--nch-border);
  border-radius: 7px;
  color: var(--nch-text);
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.nch-field-input:focus { border-color: var(--nch-gold); }
.nch-field-input::placeholder { color: var(--nch-dim); }
/* ocultar flechas number en Chrome/Safari */
.nch-field-input::-webkit-outer-spin-button,
.nch-field-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.nch-field-input[type=number] { -moz-appearance: textfield; }

/* Toggle graduada */
.nch-field-graded { min-width: 90px; flex: 0 0 auto; }
.nch-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 9px 0;
}
.nch-toggle input { display: none; }
.nch-toggle-slider {
  position: relative;
  width: 38px;
  height: 22px;
  background: var(--nch-surface2);
  border: 1px solid var(--nch-border);
  border-radius: 11px;
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
}
.nch-toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: var(--nch-dim);
  border-radius: 50%;
  transition: transform .2s, background .2s;
}
.nch-toggle input:checked + .nch-toggle-slider {
  background: rgba(201,168,76,.2);
  border-color: var(--nch-gold);
}
.nch-toggle input:checked + .nch-toggle-slider::after {
  transform: translateX(16px);
  background: var(--nch-gold);
}
.nch-toggle-label {
  font-size: 14px;
  color: var(--nch-text);
  min-width: 20px;
}

/* Filters pills */
.nch-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.nch-filter-label { font-size: 12px; color: var(--nch-dim); }
.nch-pill {
  background: var(--nch-surface2);
  border: 1px solid var(--nch-border);
  color: var(--nch-dim);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.nch-pill.active             { background: var(--nch-gold); color: #000; border-color: var(--nch-gold); font-weight: 600; }
.nch-pill:hover:not(.active) { border-color: var(--nch-gold-dim); color: var(--nch-text); }

/* Info bar */
.nch-info { font-size: 12px; color: var(--nch-dim); margin-bottom: 12px; min-height: 18px; }
.nch-info strong { color: var(--nch-gold); }

/* State box */
.nch-state-box {
  padding: 60px 24px;
  text-align: center;
  color: var(--nch-dim);
}
.nch-icon { font-size: 52px; margin-bottom: 16px; }
.nch-state-box p     { font-size: 15px; }
.nch-state-box small { font-size: 12px; margin-top: 8px; display: block; }

/* Spinner */
.nch-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--nch-border);
  border-top-color: var(--nch-gold);
  border-radius: 50%;
  animation: nch-spin .7s linear infinite;
  margin: 60px auto 16px;
}
@keyframes nch-spin { to { transform: rotate(360deg); } }

/* Grid — una carta por fila */
.nch-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Card — horizontal, ocupa todo el ancho */
.nch-card {
  display: flex;
  flex-direction: row;
  width: 100%;
  background: var(--nch-surface);
  border: 1px solid var(--nch-border);
  border-radius: 10px;
  overflow: hidden;
  transition: transform .15s, border-color .15s;
  text-decoration: none;
  color: inherit;
}
.nch-card:hover { transform: translateY(-3px); border-color: var(--nch-gold-dim); }

/* Imagen a la izquierda */
.nch-card-img {
  width: 120px;
  min-width: 120px;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: var(--nch-surface2);
  display: block;
}
.nch-card-placeholder {
  width: 120px;
  min-width: 120px;
  aspect-ratio: 3/4;
  background: var(--nch-surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

/* Cuerpo ocupa el resto */
.nch-card-body {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.nch-card-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 10px;
  display: block;
  color: var(--nch-text);
}
.nch-card-meta   { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.nch-card-price  { font-size: 22px; font-weight: 700; color: var(--nch-gold); }
.nch-card-status {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}
.nch-status-auction { background: rgba(201,168,76,.15); color: var(--nch-gold); }
.nch-status-fixed   { background: rgba(61,186,111,.15);  color: var(--nch-green); }
.nch-card-bids   { font-size: 11px; color: var(--nch-dim); margin-top: 6px; }
.nch-card-seller { font-size: 10px; color: var(--nch-dim); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Paginación */
.nch-pagination { margin-top: 24px; }
.nch-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.nch-page-btn,
.nch-page-num {
  background: var(--nch-surface2);
  border: 1px solid var(--nch-border);
  color: var(--nch-dim);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.nch-page-btn:hover:not(:disabled),
.nch-page-num:hover:not(.active) { border-color: var(--nch-gold-dim); color: var(--nch-text); }
.nch-page-num { padding: 8px 13px; min-width: 38px; text-align: center; }
.nch-page-num.active {
  background: var(--nch-gold);
  border-color: var(--nch-gold);
  color: #000;
  font-weight: 700;
  cursor: default;
}
.nch-page-btn:disabled { opacity: .3; cursor: not-allowed; }
.nch-page-prev { margin-right: 4px; }
.nch-page-next { margin-left: 4px; }
.nch-page-numbers { display: flex; gap: 4px; align-items: center; }
.nch-page-ellipsis { color: var(--nch-dim); font-size: 13px; padding: 0 4px; }

/* Mobile */
@media (max-width: 600px) {
  .nch-search-bar { flex-direction: column; }
  .nch-advanced-row { gap: 10px; }
  .nch-field { min-width: calc(50% - 5px); flex: 0 0 calc(50% - 5px); }
  .nch-field-graded { min-width: 100%; flex: 0 0 100%; flex-direction: row; align-items: center; justify-content: space-between; }
  .nch-card { flex-direction: column; }
  .nch-card-img,
  .nch-card-placeholder { width: 100%; min-width: unset; aspect-ratio: 16/9; }
  .nch-grid { gap: 10px; }
  .nch-page-btn,
  .nch-page-num { padding: 7px 10px; font-size: 12px; }
  .nch-page-prev,
  .nch-page-next { padding: 7px 12px; }
}