/* Variables */
:root {
  --bg: #0b0f17;
  --bg-card: #1a202c;
  --bg-hover: #2d3748;
  --text: #e5e7eb;
  --text-dim: rgba(229, 231, 235, 0.6);
  --border: rgba(255, 255, 255, 0.1);
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #10b981;
  --radius: 8px;
}

/* Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
}

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

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Layout */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.logo {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  border-radius: 12px;
  flex-shrink: 0;
}

.brand h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.brand p {
  font-size: 12px;
  color: var(--text-dim);
}

/* Navigation */
.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.pill:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Hero Section */
.hero {
  margin: 30px 0;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.panel h2 {
  font-size: 20px;
  margin-bottom: 12px;
  color: var(--text);
}

.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.badge {
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 6px;
  font-size: 12px;
  color: #d1fae5;
}

.badge.blue {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #dbeafe;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #000;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tag {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.tag.fair {
  background: rgba(251, 191, 36, 0.9);
  color: #78350f;
}

.tag.used {
  background: rgba(59, 130, 246, 0.9);
  color: #1e3a8a;
}

.tag.good {
  background: rgba(16, 185, 129, 0.9);
  color: #064e3b;
}

.body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.title h3 {
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
}

.price {
  font-size: 18px;
  font-weight: 700;
  color: #d1fae5;
  white-space: nowrap;
}

.meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-dim);
}

.desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  flex: 1;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.actions a {
  flex: 1;
  padding: 8px 12px;
  text-align: center;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  text-decoration: none;
}

.actions a:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.actions a.buy {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.actions a.buy:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* Product Page */
.page {
  padding: 20px 0;
}

.crumbs {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-dim);
}

.productPage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.bigimg {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

.bigimg img {
  width: 100%;
  height: auto;
}

.details h2 {
  font-size: 24px;
  margin-bottom: 12px;
  color: var(--text);
}

.lead {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 20px;
  line-height: 1.6;
}

.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px 20px;
  margin-bottom: 20px;
  font-size: 13px;
}

.kv > div:nth-child(odd) {
  color: var(--text-dim);
  font-weight: 500;
}

.kv > div:nth-child(even) {
  color: var(--text);
}

/* Footer */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 30px 0;
}

.footerGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  font-size: 13px;
  color: var(--text-dim);
}

.legal {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Cookie Banner */
.cookieBanner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(26, 32, 44, 0.98);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 20px;
  z-index: 1000;
  display: none;
}

.cookieBanner.show {
  display: block;
}

.cookieBox {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.cookieBox p {
  flex: 1;
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
  min-width: 300px;
}

.cookieActions {
  display: flex;
  gap: 10px;
}

.smallLink {
  color: var(--primary);
  text-decoration: underline;
}

/* Buttons */
button {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.2s;
  font-family: inherit;
}

button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

button.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

button.ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

button.ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    width: 100%;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .productPage {
    grid-template-columns: 1fr;
  }

  .footerGrid {
    grid-template-columns: 1fr;
  }

  .cookieBox {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookieActions {
    width: 100%;
  }

  .cookieActions button {
    flex: 1;
  }
}
/* Cart Button */
.cart-btn {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  cursor: pointer;
  font-weight: 600;
}

.cart-btn:hover {
  background: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
}

/* Cart Modal */
.cart-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.cart-modal.show {
  display: flex;
}

.cart-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.cart-header h2 {
  margin: 0;
  font-size: 20px;
  color: var(--text);
}

.cart-close {
  background: none;
  border: none;
  font-size: 32px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  line-height: 1;
}

.cart-close:hover {
  color: var(--text);
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart-item {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  margin-bottom: 15px;
  border: 1px solid var(--border);
}

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

.cart-item-details {
  flex: 1;
}

.cart-item-details h4 {
  font-size: 15px;
  margin: 0 0 4px;
  color: var(--text);
}

.cart-item-details p {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0 0 6px;
}

.cart-item-price {
  font-size: 16px;
  font-weight: 700;
  color: #d1fae5;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.cart-item-quantity button {
  background: none;
  border: none;
  color: var(--text);
  font-size: 18px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-quantity button:hover {
  color: var(--primary);
}

.cart-item-quantity span {
  min-width: 20px;
  text-align: center;
  color: var(--text);
  font-weight: 600;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  line-height: 1;
}

.cart-item-remove:hover {
  color: #ef4444;
}

.cart-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text);
}

.cart-total span:last-child {
  color: #d1fae5;
  font-size: 24px;
}

.cart-footer button {
  width: 100%;
}

/* Cart Notification */
.cart-notification {
  position: fixed;
  top: 100px;
  right: 20px;
  background: var(--accent);
  color: #064e3b;
  padding: 15px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 3000;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease;
}

.cart-notification.show {
  opacity: 1;
  transform: translateX(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .cart-content {
    max-height: 100vh;
    border-radius: 0;
  }
  
  .cart-item {
    flex-wrap: wrap;
  }
  
  .cart-item img {
    width: 60px;
    height: 45px;
  }
}

/* Checkout Form */
.checkout-content {
  max-width: 700px;
}

.checkout-body {
  max-height: calc(90vh - 140px);
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.checkout-section {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.checkout-section:last-child {
  border-bottom: none;
}

.checkout-section h3 {
  font-size: 16px;
  margin-bottom: 15px;
  color: var(--text);
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
}

.form-group textarea {
  resize: vertical;
}

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

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.radio-label:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.radio-label input[type="radio"] {
  margin-top: 2px;
  cursor: pointer;
}

.radio-label input[type="radio"]:checked + span {
  color: var(--primary);
  font-weight: 600;
}

.radio-label span {
  flex: 1;
  display: block;
  font-size: 14px;
  color: var(--text);
}

.radio-label small {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.order-summary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.summary-item:last-child {
  border-bottom: none;
}

.order-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
  padding: 15px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 6px;
  color: var(--text);
}

.order-total span:last-child {
  color: #d1fae5;
  font-size: 24px;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .checkout-content {
    max-width: 100%;
  }
}
