:root {
  --ebay-red: #e53238;
  --ebay-blue: #3665f3;
  --ebay-yellow: #f5af02;
  --ebay-green: #86b817;
  --text: #f0f0f0;
  --text-muted: #a3a3a3;
  --border: #3a3a3a;
  --bg: #121212;
  --white: #1e1e1e;
  --surface-elevated: #252525;
  --input-bg: #0f0f0f;
  --radius: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --font: "DM Sans", system-ui, sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}

a {
  color: var(--ebay-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header — eBay-inspired */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  background: #0f0f0f;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.header-top-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 32px;
}

.header-links {
  display: flex;
  gap: 16px;
}

.header-links a {
  color: var(--text-muted);
}

.header-main-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none !important;
  flex-shrink: 0;
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.search-wrap {
  flex: 1;
  display: flex;
  min-width: 280px;
  max-width: 720px;
  border: 2px solid var(--text);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}

.search-wrap select {
  border: none;
  padding: 10px 12px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text);
  max-width: 140px;
  cursor: pointer;
}

.search-wrap input {
  flex: 1;
  border: none;
  padding: 10px 14px;
  font-size: 16px;
  min-width: 0;
  background: var(--white);
  color: var(--text);
}

.search-wrap input:focus {
  outline: none;
}

.btn-search {
  background: var(--ebay-blue);
  color: var(--white);
  border: none;
  padding: 0 24px;
  font-weight: 600;
  cursor: pointer;
  font-size: 15px;
}

.btn-search:hover {
  background: #005bb5;
}

.header-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

.link-sell {
  font-weight: 600;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--ebay-red);
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-categories {
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.category-nav {
  display: flex;
  gap: 20px;
  padding: 10px 16px;
  overflow-x: auto;
  white-space: nowrap;
}

.category-nav a {
  color: var(--text);
  font-weight: 500;
}

.category-nav a.highlight {
  color: var(--ebay-blue);
  font-weight: 700;
}

#app-main {
  padding: 20px 16px 48px;
  min-height: 60vh;
}

/* Hero / discover */
.hero-banner {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  margin-bottom: 28px;
}

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

.hero-main {
  background: linear-gradient(135deg, #0064d2 0%, #003d82 100%);
  color: white;
  border-radius: 12px;
  padding: 32px 36px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-main h1 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.hero-main p {
  margin: 0 0 20px;
  opacity: 0.92;
  max-width: 420px;
}

.hero-side {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 13px;
  cursor: pointer;
}

.chip.active {
  border-color: var(--ebay-blue);
  background: rgba(54, 101, 243, 0.2);
  color: #93b4ff;
  font-weight: 600;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.product-card img,
.product-card .img-placeholder {
  aspect-ratio: 1;
  width: 100%;
  object-fit: cover;
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
}

.product-card-body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-title {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  margin-top: auto;
}

.product-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--ebay-blue);
  color: white;
}

.btn-primary:hover {
  background: #005bb5;
}

.btn-secondary {
  background: transparent;
  color: var(--ebay-blue);
  border: 2px solid var(--ebay-blue);
}

.btn-danger {
  background: var(--ebay-red);
  color: white;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

/* Product detail */
.pdp-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  background: var(--white);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

@media (max-width: 768px) {
  .pdp-layout {
    grid-template-columns: 1fr;
  }
}

.pdp-image {
  border-radius: var(--radius);
  overflow: hidden;
  background: #2a2a2a;
}

.pdp-image img {
  width: 100%;
  display: block;
}

.pdp-title {
  font-size: 1.5rem;
  margin: 0 0 12px;
}

.pdp-price {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.pdp-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
  max-width: 320px;
}

/* Forms */
.page-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  max-width: 720px;
}

.page-card.wide {
  max-width: 960px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.checkout-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.step-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  background: var(--surface-elevated);
  color: var(--text-muted);
}

.step-pill.active {
  background: var(--ebay-blue);
  color: white;
  font-weight: 600;
}

.step-pill.done {
  background: rgba(134, 184, 23, 0.25);
  color: #b8e06a;
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

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

.order-summary {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  position: sticky;
  top: 120px;
}

.order-line {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}

.order-line.total {
  border-top: 2px solid var(--border);
  margin-top: 8px;
  padding-top: 12px;
  font-weight: 700;
  font-size: 18px;
}

.cart-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
}

.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.payment-option.selected {
  border-color: var(--ebay-blue);
  background: rgba(54, 101, 243, 0.15);
}

.payment-option input {
  width: auto;
}

.card-fields {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  background: var(--surface-elevated);
  border-radius: var(--radius);
}

.success-panel {
  text-align: center;
  padding: 48px 24px;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: var(--ebay-green);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 20px;
}

.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--text-muted);
}

.site-footer {
  background: #2d2d2d;
  color: #ccc;
  padding: 32px 0 16px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.footer-grid h4 {
  color: white;
  margin: 0 0 12px;
}

.footer-grid a {
  display: block;
  color: #ccc;
  margin-bottom: 8px;
}

.footer-note {
  font-size: 13px;
  margin: 0;
}

.footer-copy {
  font-size: 12px;
  color: #888;
  border-top: 1px solid #444;
  padding-top: 16px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
  z-index: 200;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.badge-condition {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  background: var(--surface-elevated);
  border-radius: 4px;
  margin-bottom: 8px;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.orders-table th,
.orders-table td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.orders-table th {
  background: var(--surface-elevated);
  font-weight: 600;
}
