/* ============================================================
   YardProfitOS — Mobile-First Lookup CSS
   Built for one-handed yard-floor use in sunlight.
   ============================================================ */

/* ── STICKY HEADER ── */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 56px;
  background: #0a0a0a;
  border-bottom: 2px solid #f59e0b;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.sticky-logo {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: #f2f2f2;
  text-decoration: none;
  flex-shrink: 0;
}
.sticky-context {
  flex: 1;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #f59e0b;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}
.sticky-change-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f59e0b;
  background: transparent;
  border: 1.5px solid #f59e0b;
  border-radius: 3px;
  padding: 5px 10px;
  cursor: pointer;
  min-height: 36px;
  min-width: 64px;
  flex-shrink: 0;
}
.sticky-change-btn:active { opacity: 0.7; }

/* ── GPS BANNER ── */
.gps-banner {
  position: sticky;
  top: 56px;
  z-index: 190;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #0a1628;
  border-bottom: 1px solid #1d4ed8;
  font-size: 15px;
  color: #93c5fd;
}
.gps-banner-icon { font-size: 18px; flex-shrink: 0; }
.gps-banner-text { flex: 1; }
.gps-banner-text strong { color: #fff; }
.gps-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.gps-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  min-height: 48px;
  min-width: 72px;
}
.gps-btn--confirm {
  background: #2563eb;
  color: #fff;
}
.gps-btn--dismiss {
  background: transparent;
  color: #94a3b8;
  border: 1.5px solid #334155;
}
.gps-btn:active { opacity: 0.8; }

/* ── VEHICLE SELECTOR ── */
.vehicle-section {
  padding: 16px 16px 0;
  background: #0a0a0a;
}
.vehicle-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.vehicle-selects { display: flex; flex-direction: column; gap: 10px; }

.vsel-wrap { position: relative; }
.vsel-label {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #555;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.vsel-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: #1e1e1e;
  border: 2px solid #2a2a2a;
  border-radius: 6px;
  color: #f2f2f2;
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  font-weight: 600;
  padding: 14px 16px;
  cursor: pointer;
  min-height: 56px;
  text-align: left;
  box-sizing: border-box;
}
.vsel-btn:active { border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,0.2); }
.vsel-btn svg { flex-shrink: 0; color: #666; }

.vsel-picker {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 400;
  background: #1a1a1a;
  border: 1.5px solid #f59e0b;
  border-radius: 8px;
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.vsel-pick-item {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: #e2e2e2;
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  font-weight: 500;
  padding: 15px 18px;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid #222;
  min-height: 52px;
}
.vsel-pick-item:last-child { border-bottom: none; }
.vsel-pick-item:active { background: #252525; }

/* ── LOOKUP MAIN ── */
.lookup-main {
  padding: 0 0 80px;
  min-height: calc(100vh - 56px);
}

/* ── YARD SELECTOR SECTION ── */
.lookup-main {
  padding: 0 0 80px;
  min-height: calc(100vh - 56px);
}

.yard-section {
  position: sticky;
  top: 56px;
  z-index: 100;
  background: #0a0a0a;
  padding: 12px 16px;
  border-bottom: 1px solid #2a2a2a;
}
.yard-section-inner {}
.yard-section-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.yard-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: #1e1e1e;
  border: 2px solid #f59e0b;
  border-radius: 6px;
  color: #f2f2f2;
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 600;
  padding: 16px 18px;
  cursor: pointer;
  min-height: 60px;
  text-align: left;
  box-shadow: 0 0 0 0 rgba(245,158,11,0.2);
  transition: box-shadow 0.15s;
}
.yard-btn:active {
  box-shadow: 0 0 0 3px rgba(245,158,11,0.25);
}
.yard-btn svg {
  flex-shrink: 0;
  color: #888;
}
#yard-btn-text { flex: 1; }

/* ── YARD PICKER OVERLAY ── */
.yard-picker {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.yard-picker-inner {
  background: #141414;
  border-top: 2px solid #f59e0b;
  border-radius: 12px 12px 0 0;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.yard-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #2a2a2a;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #f2f2f2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.yard-picker-close {
  background: #1e1e1e;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: #888;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
}
.yard-picker-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}
.yard-picker-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #f2f2f2;
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  font-weight: 500;
  padding: 16px 24px;
  cursor: pointer;
  border-bottom: 1px solid #1e1e1e;
  min-height: 56px;
  transition: background 0.1s;
}
.yard-picker-item:active { background: #1e1e1e; }
.yard-picker-item.active {
  color: #f59e0b;
  font-weight: 700;
}

/* ── MULTIPLIER BANNER ── */
.mult-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}
.mult-banner.mult-high { background: #450a0a; color: #fca5a5; }
.mult-banner.mult-low  { background: #052e16; color: #86efac; }
.mult-banner.mult-mid  { background: #1c1200; color: #f59e0b; }

/* ── RESULTS META ── */
.results-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 16px 16px 8px;
}
#results-yard-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #f2f2f2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.results-count-label {
  font-size: 13px;
  color: #888;
}

/* ── PARTS CONTAINER — card stack ── */
.parts-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 16px 0;
}

/* ── PART CARD ── */
.part-card {
  background: #141414;
  border: 1.5px solid #2a2a2a;
  border-radius: 8px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 120px;
}

/* Card header: name + grade */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.card-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #f2f2f2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}
.card-grade {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #f59e0b;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: #1c1200;
  border: 1px solid #92400e;
  padding: 3px 8px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 4px;
}

/* Card body: vehicle + demand badge */
.card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-vehicle {
  font-size: 14px;
  color: #888;
}
.demand-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  flex-shrink: 0;
  white-space: nowrap;
}
.demand-badge.hot     { background: #450a0a; color: #fca5a5; }
.demand-badge.moderate{ background: #1c1200; color: #f59e0b; }
.demand-badge.slow    { background: #0a1628; color: #93c5fd; }

/* Card prices */
.card-prices {
  display: flex;
  align-items: center;
  gap: 24px;
}
.card-regional,
.card-national {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card-price-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #666;
}
.card-price-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: #f2f2f2;
  letter-spacing: 0.02em;
  line-height: 1;
}
.card-price-muted {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #555;
  letter-spacing: 0.02em;
  line-height: 1;
}

/* Card profit section */
.card-profit {
  border-radius: 6px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-profit.profit-high { background: #052e16; border: 1.5px solid #16a34a; }
.card-profit.profit-mid  { background: #1c1200; border: 1.5px solid #92400e; }
.card-profit.profit-low  { background: #450a0a; border: 1.5px solid #dc2626; }

.profit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.profit-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #888;
}
.profit-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}
.profit-high .profit-val { color: #86efac; }
.profit-mid  .profit-val { color: #f59e0b; }
.profit-low  .profit-val { color: #fca5a5; }

.profit-diff {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.profit-diff.up   { color: #fca5a5; }
.profit-diff.down { color: #86efac; }

/* Empty / error */
.parts-empty,
.parts-error {
  text-align: center;
  padding: 48px 24px;
  font-size: 15px;
  color: #888;
}

/* ── EMPTY STATE ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 40px;
  gap: 16px;
}
.empty-icon { opacity: 0.35; }
.empty-text {
  font-size: 15px;
  color: #666;
  text-align: center;
  line-height: 1.6;
}

/* ── FOOTER ── */
.footer {
  border-top: 1px solid #2a2a2a;
  padding: 24px 16px;
  text-align: center;
}
.footer p {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #555;
  text-transform: uppercase;
}

/* ── DESKTOP OVERRIDES (max-width breakpoint) ── */
@media (min-width: 769px) {
  .sticky-header { padding: 0 32px; }
  .sticky-yard { font-size: 18px; }
  .yard-section { padding: 14px 32px; }
  .gps-banner { padding: 14px 32px; }
  .mult-banner { padding: 10px 32px; }
  .results-meta { padding: 20px 32px 12px; }
  .parts-container { padding: 12px 32px 0; max-width: 720px; margin: 0 auto; width: 100%; }
  .yard-picker-inner { max-width: 600px; margin: 0 auto; border-radius: 12px 12px 0 0; }

  .part-card { flex-direction: row; align-items: center; padding: 20px 24px; gap: 24px; }
  .card-header { flex: 0 0 auto; min-width: 200px; }
  .card-body { flex: 1; }
  .card-prices { flex-direction: row; align-items: center; gap: 32px; }
  .card-price-val { font-size: 36px; }
  .card-profit { flex-direction: row; align-items: center; justify-content: space-between; padding: 14px 18px; }
  .profit-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .profit-val { font-size: 32px; }
}

/* ── SMALL PHONE OVERRIDES ── */
@media (max-width: 380px) {
  .sticky-yard { font-size: 13px; }
  .card-name { font-size: 19px; }
  .card-price-val { font-size: 28px; }
  .profit-val { font-size: 24px; }
}