/* ============================================================
   COMPONENTS — VOLT edition
   ============================================================ */

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.05em;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--dur-base) var(--ease-out);
}

.btn:active { transform: scale(0.97); }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--clr-accent);
  color: #08090f;
  border-color: var(--clr-accent);
}

.btn-primary:hover {
  background: #c8ff52;
  box-shadow: 0 0 20px var(--clr-accent-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--clr-accent);
  border-color: currentColor;
}

.btn-secondary:hover {
  background: var(--clr-accent-dim);
}

.btn-dark {
  background: var(--clr-surface-2);
  color: var(--clr-text);
  border-color: var(--clr-border-2);
}

.btn-dark:hover {
  background: var(--clr-surface-3);
  border-color: rgba(255,255,255,0.18);
}

.btn-ghost {
  background: transparent;
  color: var(--clr-text-2);
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--clr-text);
}

.btn-accent {
  background: var(--clr-accent-2);
  color: #fff;
  border-color: var(--clr-accent-2);
}

.btn-accent:hover {
  background: #ff2d4a;
  box-shadow: 0 0 20px rgba(255, 69, 96, 0.3);
}

.btn-sm  { padding: 7px 16px; font-size: var(--text-xs); }
.btn-lg  { padding: 14px 32px; font-size: var(--text-base); }
.btn-full { width: 100%; }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

.badge-new        { background: var(--clr-accent); color: #08090f; }
.badge-sale       { background: var(--clr-accent-2); color: #fff; }
.badge-bestseller { background: rgba(245,197,66,0.15); color: #f5c542; border: 1px solid rgba(245,197,66,0.3); }
.badge-toprated   { background: rgba(56,200,255,0.12); color: var(--clr-accent-3); border: 1px solid rgba(56,200,255,0.25); }

/* ── Product Card ── */
.product-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition:
    transform var(--dur-base) var(--ease-out),
    border-color var(--dur-base),
    box-shadow var(--dur-base);
  display: flex;
  flex-direction: column;
  animation: fadeUp var(--dur-enter) var(--ease-out) both;
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: rgba(180, 255, 60, 0.28);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 24px var(--clr-accent-glow);
}

/* Stagger reveal */
.product-card:nth-child(1) { animation-delay:   0ms; }
.product-card:nth-child(2) { animation-delay:  60ms; }
.product-card:nth-child(3) { animation-delay: 120ms; }
.product-card:nth-child(4) { animation-delay: 180ms; }
.product-card:nth-child(5) { animation-delay: 240ms; }
.product-card:nth-child(6) { animation-delay: 300ms; }
.product-card:nth-child(7) { animation-delay: 360ms; }
.product-card:nth-child(8) { animation-delay: 420ms; }

.product-card-img {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--clr-surface-2);
}

.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out);
}

.product-card:hover .product-card-img img { transform: scale(1.05); }

.product-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
}

.product-card-wishlist {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(8,9,15,0.7);
  border: 1px solid var(--clr-border-2);
  color: var(--clr-text-2);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--dur-fast), color var(--dur-fast);
}

.product-card:hover .product-card-wishlist { opacity: 1; }
.product-card-wishlist:hover { color: var(--clr-accent-2); }

.product-card-body {
  padding: 16px 16px 8px;
  flex: 1;
}

.product-card-category {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-text-3);
  margin-bottom: 6px;
  font-family: var(--font-mono);
}

.product-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--clr-text);
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--clr-text-2);
}

.product-card-rating .stars,
.stars { color: var(--clr-accent); letter-spacing: 1px; }

.product-card-footer {
  padding: 12px 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--clr-border);
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.price-current {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--clr-text);
}

.price-original {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--clr-text-3);
  text-decoration: line-through;
}

.price-save {
  font-size: var(--text-xs);
  color: var(--clr-accent);
  font-weight: 600;
}

/* ── Product Grid ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.product-grid-3 { grid-template-columns: repeat(3, 1fr); }
.product-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── List view ── */
.product-grid.list-view { grid-template-columns: 1fr; }

.product-grid.list-view .product-card {
  flex-direction: row;
  min-height: 140px;
}

.product-grid.list-view .product-card-img {
  width: 180px;
  flex-shrink: 0;
  aspect-ratio: unset;
}

.product-grid.list-view .product-card-body { flex: 1; padding: var(--space-5); }

.product-grid.list-view .product-card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: none;
  border-left: 1px solid var(--clr-border);
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  min-width: 150px;
}

/* ── Star rating ── */
.star-rating { display: inline-flex; gap: 1px; }
.star-rating .star       { color: var(--clr-accent); font-size: var(--text-sm); }
.star-rating .star-empty { color: var(--clr-surface-3); font-size: var(--text-sm); }

/* ── Form elements ── */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--clr-text);
}

.form-input {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--clr-border-2);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  background: var(--clr-surface);
  color: var(--clr-text);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--clr-accent);
  box-shadow: 0 0 0 3px var(--clr-accent-dim);
}

.form-input::placeholder { color: var(--clr-text-3); }

/* ── Generic card ── */
.card {
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--clr-border);
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--clr-border);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--clr-text);
}

.card-body   { padding: var(--space-6); }

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--clr-border);
  background: var(--clr-surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── Qty stepper ── */
.qty-stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--clr-border-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-btn {
  width: 40px;
  height: 44px;
  background: var(--clr-surface-2);
  border: none;
  color: var(--clr-text);
  font-size: 18px;
  cursor: pointer;
  transition: background var(--dur-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover { background: var(--clr-surface-3); }

.qty-value {
  width: 52px;
  height: 44px;
  background: var(--clr-surface);
  border: none;
  border-left: 1px solid var(--clr-border);
  border-right: 1px solid var(--clr-border);
  text-align: center;
  color: var(--clr-text);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  outline: none;
}

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--clr-border);
  margin: var(--space-6) 0;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: var(--space-20) var(--space-8);
  color: var(--clr-text-2);
}

.empty-state-icon { font-size: 3.5rem; margin-bottom: var(--space-4); opacity: 0.4; }
.empty-state h3   { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 800; margin-bottom: var(--space-3); color: var(--clr-text); }
.empty-state p    { margin-bottom: var(--space-6); }

/* ── Overlay/Modal ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 200ms ease;
}

.modal {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border-2);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 250ms var(--ease-out);
}

/* ── Code preview ── */
.code-preview {
  background: var(--clr-bg);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
  border: 1px solid rgba(180,255,60,0.12);
}

.code-preview code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--clr-accent);
  line-height: 1.7;
  white-space: pre;
}
