:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #7c3aed;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  --header-h: 72px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

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

button, input, select, textarea {
  font: inherit;
}

.container {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
}

.logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  white-space: nowrap;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 900px) {
  .logo {
    font-size: 1.1rem;
    max-width: none;
  }
}

.search-form {
  flex: 1;
  display: flex;
  max-width: 520px;
}

.search-form input {
  flex: 1;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 999px 0 0 999px;
  padding: 0.7rem 1rem;
  background: var(--bg);
}

.search-form button {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  border-radius: 0 999px 999px 0;
  padding: 0 1.1rem;
  cursor: pointer;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  transition: 0.2s;
}

.nav-link:hover, .nav-link.active {
  background: #eff6ff;
  color: var(--primary);
}

.badge {
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  min-width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
}

.main { min-height: calc(100vh - var(--header-h) - 180px); padding: 1.5rem 0 3rem; }

.hero {
  background: linear-gradient(135deg, #1e3a8a, #2563eb 45%, #7c3aed);
  color: #fff;
  border-radius: calc(var(--radius) + 6px);
  padding: 3rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 0 0 0.75rem; }
.hero p { opacity: 0.92; max-width: 560px; margin: 0 0 1.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  transition: 0.2s;
  font-weight: 600;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #eef2ff; color: var(--primary); }
.btn-secondary:hover { background: #dbeafe; }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.9rem; }
.btn-block { width: 100%; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title h2 { margin: 0; font-size: 1.35rem; }

.grid {
  display: grid;
  gap: 1rem;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.product-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.12);
}

.product-card__img {
  aspect-ratio: 1;
  object-fit: cover;
  background: #f8fafc;
}

.product-card__body { padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.product-card__brand { color: var(--muted); font-size: 0.85rem; }
.product-card__title { font-weight: 600; min-height: 2.8rem; }
.product-card__price { font-size: 1.1rem; font-weight: 700; }
.product-card__old { color: var(--muted); text-decoration: line-through; font-size: 0.9rem; margin-left: 0.4rem; font-weight: 400; }
.product-card__actions { display: flex; gap: 0.5rem; margin-top: auto; }

.product-list .product-card {
  flex-direction: row;
}

.product-list .product-card__img {
  width: 180px;
  flex-shrink: 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.filters select, .filters input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  background: var(--surface);
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.view-toggle button {
  border: none;
  background: var(--surface);
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

.view-toggle button.active {
  background: var(--primary);
  color: #fff;
}

.layout-2col {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
}

.sidebar {
  padding: 1rem;
  height: fit-content;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.sidebar h3 { margin-top: 0; font-size: 1rem; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: var(--muted);
}
.sidebar li a:hover, .sidebar li a.active {
  background: #eff6ff;
  color: var(--primary);
}

.product-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.product-page__image {
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
}

.product-page__image img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.product-page__price { font-size: 2rem; font-weight: 700; margin: 0.5rem 0; }
.product-page__meta { color: var(--muted); margin-bottom: 1rem; }
.specs-table { width: 100%; border-collapse: collapse; }
.specs-table td { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.specs-table td:first-child { color: var(--muted); width: 40%; }

.tabs { display: flex; gap: 0.5rem; margin: 2rem 0 1rem; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.35rem; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
}

.cart-table, .admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.cart-table-wrap {
  overflow: hidden;
  border-radius: var(--radius);
  padding: 0;
}

.cart-table-wrap .cart-table {
  border-radius: 0;
}

.cart-table th, .cart-table td, .admin-table th, .admin-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.cart-product {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.cart-product__img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--bg);
  flex-shrink: 0;
}

.cart-product__name {
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.cart-product__name strong {
  display: block;
  line-height: 1.35;
  word-break: break-word;
}

.cart-product__name:hover strong {
  color: var(--primary);
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-stepper__btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-stepper__btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.qty-stepper__value {
  min-width: 2rem;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
}

.cart-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.cart-footer__total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.cart-footer__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cart-balance-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.cart-footer__total strong {
  font-size: 1.3rem;
}

.summary-card { padding: 1.25rem; }
.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.summary-row.total { font-size: 1.2rem; font-weight: 700; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }

.account-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.25rem;
}

.account-nav a {
  display: block;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  color: var(--muted);
}
.account-nav a.active { background: #eff6ff; color: var(--primary); font-weight: 600; }

.compare-table { overflow-x: auto; }
.compare-table table { min-width: 700px; width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td {
  padding: 0.75rem;
  border: 1px solid var(--border);
  background: var(--surface);
  vertical-align: top;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat-card span { color: var(--muted); font-size: 0.9rem; }
.stat-card strong { display: block; font-size: 1.5rem; margin-top: 0.25rem; }

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  height: 180px;
  padding: 1rem;
}
.chart-bar {
  flex: 1;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  border-radius: 6px 6px 0 0;
  min-height: 4px;
}

.footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 2rem 0;
  margin-top: 2rem;
}
.footer a { color: #e2e8f0; }
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1.5rem;
}

.toast-container {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #0f172a;
  color: #fff;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  animation: slideIn 0.25s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: min(440px, 100%);
  box-shadow: var(--shadow);
}
.modal h2 { margin-top: 0; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.rating { color: #f59e0b; }
.status {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-processing { background: #dbeafe; color: #1d4ed8; }
.status-shipped { background: #e0e7ff; color: #4338ca; }
.status-delivered { background: #dcfce7; color: #166534; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

.mobile-menu-btn {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .layout-2col, .product-page, .account-layout, .admin-layout { grid-template-columns: 1fr; }
  .sidebar, .account-nav { position: static; }
}

@media (max-width: 768px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .container { width: calc(100% - 1rem); }
  .search-form { display: none; }
  .mobile-menu-btn { display: inline-flex; }
  .nav-actions { display: none; }
  .nav-actions.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--surface);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }
  .product-list .product-card { flex-direction: column; }
  .product-list .product-card__img { width: 100%; }
  .footer__grid { grid-template-columns: 1fr; }

  .cart-table-wrap { overflow: visible; }

  .cart-table thead { display: none; }

  .cart-table tbody,
  .cart-table tr {
    display: block;
  }

  .cart-table tr {
    position: relative;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .cart-table tr:last-child { border-bottom: none; }

  .cart-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: none;
    text-align: right;
  }

  .cart-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    font-size: 0.85rem;
    flex-shrink: 0;
  }

  .cart-table td.cart-cell-product {
    display: block;
    padding: 0 2.25rem 0.75rem 0;
    text-align: left;
  }

  .cart-table td.cart-cell-product::before { display: none; }

  .cart-table td.cart-cell-remove {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    padding: 0;
    display: block;
  }

  .cart-table td.cart-cell-remove::before { display: none; }

  .cart-table td.cart-cell-qty {
    justify-content: space-between;
  }

  .cart-table td.cart-cell-qty .qty-stepper {
    margin-left: auto;
  }

  .cart-product__img {
    width: 60px;
    height: 60px;
  }

  .cart-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .cart-footer > .btn {
    width: 100%;
    text-align: center;
  }

  .cart-footer__total {
    align-items: stretch;
    width: 100%;
  }

  .cart-footer__actions {
    flex-direction: column;
    width: 100%;
  }

  .cart-footer__actions .btn {
    width: 100%;
  }

  .admin-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .checkout-steps {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .checkout-step {
    flex: 0 0 auto;
    min-width: 4.5rem;
  }

  .checkout-step__label {
    font-size: 0.7rem;
  }

  .product-page.card {
    padding: 1rem !important;
  }

  .product-page {
    grid-template-columns: 1fr !important;
  }
}

.modal--compact {
  width: min(360px, 100%);
  padding: 1.25rem;
  text-align: center;
}

.cart-added-modal__check {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: #dcfce7;
  color: var(--success);
  font-size: 1.5rem;
  line-height: 52px;
  font-weight: 700;
}

.cart-added-modal__title {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.cart-added-modal__img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

.cart-added-modal__name {
  color: var(--muted);
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.cart-added-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal--return {
  width: min(520px, 100%);
}

.return-modal-order {
  color: var(--muted);
  margin: -0.5rem 0 1rem;
  font-size: 0.95rem;
}

.return-modal-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 140px;
  overflow-y: auto;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.return-modal-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.return-modal-item input {
  margin-top: 0.2rem;
}

.form-hint {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.return-photo-preview {
  display: block;
  margin-top: 0.75rem;
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.return-photo-preview.hidden {
  display: none;
}

.return-modal-error {
  color: var(--danger);
  min-height: 1.25rem;
  margin: 0;
}

.return-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.return-card__reason {
  margin: 0.5rem 0;
  white-space: pre-wrap;
}

.return-card__photo {
  margin-top: 0.75rem;
}

.return-card__photo span {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.return-card__photo img {
  max-width: 160px;
  max-height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.admin-table--returns .admin-return-reason {
  max-width: 220px;
  white-space: pre-wrap;
  font-size: 0.9rem;
}

.admin-return-photo {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  vertical-align: middle;
}

.admin-return-photo-link:hover .admin-return-photo {
  opacity: 0.85;
}

.return-photo-missing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 56px;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
  line-height: 1.2;
}

.modal--admin-form {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
}

.admin-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.admin-return-details p {
  margin: 0.35rem 0;
}

.admin-return-details__reason p {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
}

.admin-return-details__photo img {
  display: block;
  margin-top: 0.5rem;
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.admin-return-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-actions-cell {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.admin-order-items {
  margin-top: 0.5rem;
}

.admin-order-item {
  padding: 0.25rem 0;
  font-size: 0.95rem;
}

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

.header-balance {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #047857;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

.header-balance:hover {
  background: #a7f3d0;
}

.checkout-wizard__body {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.checkout-steps {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.checkout-step {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.checkout-step.active {
  border-color: var(--primary);
  color: var(--primary);
  background: #eff6ff;
}

.checkout-step.done {
  border-color: var(--success);
  color: var(--success);
}

.checkout-step__num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: currentColor;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.checkout-step.active .checkout-step__num,
.checkout-step.done .checkout-step__num {
  background: var(--primary);
}

.checkout-step.done .checkout-step__num {
  background: var(--success);
}

.checkout-wizard__main {
  padding: 1.25rem;
}

.checkout-wizard__main h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.15rem;
}

.checkout-wizard__nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.checkout-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.checkout-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

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

.checkout-item__img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--bg);
  flex-shrink: 0;
}

.checkout-item__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.checkout-item__info span {
  color: var(--muted);
  font-size: 0.9rem;
}

.balance-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border: 1px solid #a7f3d0;
  margin-bottom: 1rem;
}

.balance-card__label {
  font-size: 0.85rem;
  color: var(--muted);
}

.balance-card__amount {
  font-size: 1.35rem;
  font-weight: 700;
  color: #047857;
}

.balance-card__toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  cursor: pointer;
}

.balance-card--active {
  border-color: #34d399;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.25);
}

.balance-hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: -0.5rem 0 1rem;
}

.payment-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.payment-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.payment-option input {
  margin-top: 0.2rem;
  accent-color: var(--primary);
}

.payment-option__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.payment-option__title {
  font-weight: 600;
}

.payment-option__hint {
  color: var(--muted);
  font-size: 0.88rem;
}

.payment-option:hover:not(.payment-option--disabled) {
  border-color: #93c5fd;
  background: #f8fbff;
}

.payment-option--active {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.payment-option--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.promo-row {
  display: flex;
  gap: 0.5rem;
}

.promo-row input {
  flex: 1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  margin-top: 0.75rem;
}

.confirm-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.5rem;
  margin: 0;
}

.confirm-list dt {
  color: var(--muted);
  font-weight: 500;
}

.confirm-list dd {
  margin: 0;
}

.summary-row--sm {
  font-size: 0.88rem;
  color: var(--muted);
}

.summary-row--balance {
  color: #047857;
  font-weight: 500;
}

.checkout-summary__balance {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
  font-size: 0.9rem;
  color: var(--muted);
}

.order-payment-tag {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: #047857;
  font-weight: 500;
}

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

@media (max-width: 480px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { padding: 2rem 1.25rem; }
}
