:root {
  --ink: #202124;
  --muted: #626a73;
  --line: #dde3ea;
  --surface: #ffffff;
  --background: #f6f8fb;
  --accent: #c9252d;
  --accent-dark: #9e1e25;
  --teal: #067a75;
  --gold: #bd7b17;
  --shadow: 0 18px 42px rgba(32, 33, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  min-height: 72px;
  padding: 14px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0;
}

.nav-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  white-space: nowrap;
}

.tab.active {
  border-color: var(--teal);
  color: var(--teal);
  font-weight: 700;
}

.cart-toggle,
.icon-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.cart-toggle {
  grid-template-columns: auto auto;
  gap: 7px;
  min-width: 64px;
  height: 42px;
  padding: 0 12px;
}

.cart-icon {
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 24px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 44px) 44px;
}

.catalog {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.payment-badge {
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

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

.product-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(32, 33, 36, 0.06);
}

.product-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e8edf3;
}

.product-content {
  display: grid;
  gap: 10px;
  padding: 14px;
}

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

.category {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.price {
  font-size: 17px;
  font-weight: 800;
}

.product-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.product-card p {
  min-height: 44px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.add-button,
.checkout-button,
.mock-actions a,
.mock-actions button,
.return-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.add-button:hover,
.checkout-button:hover,
.mock-actions a:hover,
.mock-actions button:hover,
.return-actions a:hover {
  background: var(--accent-dark);
}

.checkout-panel {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 10px;
}

.close-cart {
  display: none;
  width: 34px;
  height: 34px;
  font-size: 24px;
}

.cart-items {
  display: grid;
  gap: 12px;
  min-height: 96px;
  padding: 8px 18px 16px;
}

.empty-cart {
  display: grid;
  min-height: 86px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.cart-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

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

.cart-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.cart-name {
  margin: 0 0 4px;
  font-weight: 800;
  line-height: 1.25;
}

.cart-price {
  color: var(--muted);
  font-size: 13px;
}

.quantity {
  display: inline-grid;
  grid-template-columns: 30px 34px 30px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quantity button {
  height: 30px;
  border: 0;
  background: #fff;
  color: var(--ink);
}

.quantity span {
  text-align: center;
  font-weight: 800;
}

.checkout-form {
  display: grid;
  gap: 16px;
  padding: 0 18px 18px;
}

.totals {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.totals strong {
  color: var(--ink);
}

.grand-total {
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.full {
  grid-column: 1 / -1;
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(6, 122, 117, 0.14);
}

.bank-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.bank-options legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bank-options label {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.bank-options input {
  width: 16px;
  min-height: 16px;
}

.message {
  min-height: 20px;
  margin: 0;
  color: var(--teal);
  font-size: 14px;
  font-weight: 700;
}

.message.error {
  color: var(--accent);
}

.checkout-button {
  width: 100%;
  min-height: 48px;
}

.mock-page,
.return-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(201, 37, 45, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(6, 122, 117, 0.16), transparent 40%),
    var(--background);
}

.payment-shell,
.return-shell {
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.payment-hero {
  display: grid;
  gap: 12px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
  background: #fff6f6;
}

.payment-hero h1,
.return-shell h1 {
  margin: 0;
  font-size: 28px;
}

.qr-box {
  display: grid;
  width: 180px;
  height: 180px;
  margin: 24px auto 12px;
  place-items: center;
  border: 10px solid #fff;
  outline: 1px solid var(--line);
  background:
    repeating-linear-gradient(90deg, #111 0 8px, #fff 8px 16px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.35) 0 10px, rgba(0,0,0,0.2) 10px 20px);
  color: var(--accent);
  font-size: 30px;
  font-weight: 900;
}

.mock-summary,
.return-body {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.mock-summary dl,
.result-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.mock-summary div,
.result-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.mock-summary strong,
.result-list strong {
  color: var(--ink);
}

.mock-actions,
.return-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mock-actions .secondary,
.return-actions .secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.mock-actions .secondary:hover,
.return-actions .secondary:hover {
  background: #f1f4f7;
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(6, 122, 117, 0.12);
  color: var(--teal);
  font-weight: 800;
}

.status-pill.failed {
  background: rgba(201, 37, 45, 0.12);
  color: var(--accent);
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav-tabs {
    grid-column: 1 / -1;
    order: 3;
  }

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

  .checkout-panel {
    position: fixed;
    inset: 82px 12px 12px;
    z-index: 30;
    display: none;
    max-height: none;
  }

  .checkout-panel.open {
    display: block;
  }

  .close-cart {
    display: inline-grid;
  }
}

@media (max-width: 620px) {
  .topbar {
    gap: 12px;
    padding-inline: 12px;
  }

  h1 {
    font-size: 28px;
  }

  .layout {
    padding-inline: 12px;
  }

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

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

  .field-grid,
  .bank-options,
  .mock-actions,
  .return-actions {
    grid-template-columns: 1fr;
  }
}
