/* ============================================
   NETSHOP v2 — Additional Components
   ============================================ */

/* ============ DISCOUNT BADGES ============ */

.discount-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--danger);
  color: white;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  z-index: 2;
  letter-spacing: 0.05em;
}

.price-original {
  text-decoration: line-through;
  color: var(--text-mute);
  font-size: 0.85em;
  margin-right: 0.5rem;
  font-weight: 400;
}

.price-final {
  color: var(--accent);
}

/* ============ CART ============ */

.cart-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  cursor: pointer;
}
.cart-icon-wrap:hover { background: var(--surface); }

.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  display: none;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.3s ease-out;
  display: flex;
  flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-head {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.cart-item-img {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  flex-shrink: 0;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }

.cart-item-name { font-weight: 600; font-size: 0.92rem; margin-bottom: 0.25rem; }
.cart-item-price { color: var(--accent); font-family: var(--font-mono); font-size: 0.85rem; }

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0.15rem;
}
.qty-btn {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  background: transparent;
  border-radius: 4px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-dim);
}
.qty-btn:hover { background: var(--bg-elev); color: var(--accent); }
.qty-value {
  min-width: 24px; text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
}

.cart-remove {
  background: none;
  color: var(--text-mute);
  font-size: 0.78rem;
  margin-top: 0.5rem;
  cursor: pointer;
  text-decoration: underline;
}
.cart-remove:hover { color: var(--danger); }

.cart-foot {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-weight: 700;
}
.cart-total .label { color: var(--text-dim); font-weight: 500; }
.cart-total .val { color: var(--accent); font-size: 1.3rem; }

/* ============ CHECKOUT ============ */

.checkout-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  padding: 3rem 0;
}
@media (max-width: 900px) { .checkout-grid { grid-template-columns: 1fr; } }

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  align-self: start;
  position: sticky;
  top: 90px;
}

/* ============ STATUS BADGES ============ */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
}

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ============ TOTP / MFA SETUP ============ */

.mfa-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.qr-display {
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: white;
  border-radius: var(--radius);
  margin: 1.5rem auto;
  max-width: 240px;
}
.qr-display img { width: 200px; height: 200px; display: block; }

.totp-secret {
  font-family: var(--font-mono);
  background: var(--bg-elev);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  word-break: break-all;
  text-align: center;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  border: 1px dashed var(--border-strong);
  margin: 1rem 0;
}

.steps {
  list-style: none;
  counter-reset: step;
  margin: 1rem 0;
}
.steps li {
  counter-increment: step;
  padding: 0.5rem 0 0.5rem 2.5rem;
  position: relative;
  color: var(--text-dim);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 1.75rem; height: 1.75rem;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

/* ============ FILE UPLOAD ============ */

.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.upload-zone.has-image {
  padding: 0;
  border-style: solid;
  overflow: hidden;
  background: var(--bg-elev);
}
.upload-zone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-preview {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
}
.upload-hint {
  color: var(--text-dim);
  font-size: 0.85rem;
}
.upload-hint strong { color: var(--accent); }

.upload-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ============ ROLE BADGES ============ */

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.role-admin {
  background: rgba(0,217,163,0.12);
  color: var(--accent);
  border: 1px solid rgba(0,217,163,0.3);
}
.role-user {
  background: var(--bg-elev);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* ============ TREE LIST (categories) ============ */

.tree {
  list-style: none;
}
.tree-node {
  padding: 0.5rem 0;
}
.tree-children {
  list-style: none;
  margin-top: 0.5rem;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 1px dashed var(--border);
}
.tree-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-elev);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.tree-row .name { font-weight: 600; }
.tree-row .meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-mute); }

/* ============ DISCOUNT PILL ============ */

.discount-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.25);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

/* ============ ORDER ITEMS LIST ============ */

.order-line {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.order-line:last-child { border-bottom: none; }
.order-line-img {
  width: 50px; height: 50px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  overflow: hidden;
}
.order-line-img img { width: 100%; height: 100%; object-fit: cover; }
.order-line-info .name { font-weight: 600; font-size: 0.9rem; }
.order-line-info .meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-mute); }
.order-line-price { font-weight: 600; color: var(--accent); font-family: var(--font-mono); }

/* ============ SIMPLE SPINNER INLINE ============ */
.inline-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

/* ============ BACK LINK ============ */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin: 1rem 0;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }
