:root {
  --bg: #f3f3f3;
  --panel: #ffffff;
  --panel-alt: #f9f9f9;
  --nav: #1b6ecf;
  --nav-deep: #145db3;
  --border: #dddddd;
  --line: #e6e6e6;
  --text: #111111;
  --muted: #4d4d4d;
  --muted-soft: #666666;
  --accent: #1f7ae0;
  --danger: #c1272d;
  --danger-bg: #fff1f1;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.topbar {
  background: var(--nav);
  min-height: 60px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 60px;
  padding: 0 12px;
}
.brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 100%;
}
.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 16px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  border-bottom: 2px solid transparent;
}
.nav-item.active {
  background: var(--nav-deep);
  border-bottom-color: rgba(255,255,255,0.7);
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 12px 22px;
}
.announcement-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 24px 24px 18px;
  margin-bottom: 16px;
  border-radius: 0;
}
.announcement-panel h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
}
.announcement-panel p {
  margin: 0 0 10px;
  line-height: 1.5;
  color: var(--text);
  font-size: 0.96rem;
}
.warning-box {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #d9b4b4;
  background: var(--danger-bg);
  color: #6a1a24;
  line-height: 1.5;
  font-size: 0.95rem;
}

.catalog-nav-wrap {
  margin-bottom: 0;
}
.categories {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.categories::-webkit-scrollbar { display: none; }
.categories button {
  appearance: none;
  border: 1px solid var(--border);
  background: #f7f7f7;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 9px 12px;
  min-height: 34px;
  border-radius: 0;
}
.categories button.active {
  background: var(--nav);
  border-color: var(--nav);
  color: #fff;
}

.catalog-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  margin-top: 12px;
  overflow-x: auto;
  overflow-y: hidden;
}
.product-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  table-layout: fixed;
}
.product-table thead th {
  background: #f5f5f5;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.product-table thead th:nth-child(6),
.product-table thead th:nth-child(5),
.product-table thead th:nth-child(4) {
  text-align: right;
}
.product-table tbody td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: normal;
}
.product-table tbody tr:last-child td { border-bottom: none; }
.product-table tbody tr:hover { background: #fafafa; }

.product-name {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.product-description {
  color: var(--muted-soft);
  font-size: 0.8rem;
  line-height: 1.45;
}
.meta-tag {
  display: inline-block;
  padding: 4px 7px;
  border: 1px solid var(--border);
  background: #f6f6f6;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.price-cell, .stock-cell, .action-cell {
  text-align: right;
  white-space: nowrap;
}
.price-cell {
  font-weight: 700;
  color: var(--text);
}
.stock-cell {
  color: var(--muted);
  font-size: 0.82rem;
}
.action-cell .btn {
  min-width: 112px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid var(--nav);
  background: var(--nav);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 0;
}
.btn:hover { background: var(--nav-deep); }

.support-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.support-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
}
.support-link.muted {
  background: #f4f4f4;
}

.footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 12px 26px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.78rem;
}
.footer > span { color: var(--text); font-weight: 700; }

.product-cards {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  justify-items: end;
  background: rgba(13, 13, 13, 0.36);
}
.modal.hidden { display: none; }
.modal-panel {
  width: min(420px, 100%);
  height: 100%;
  background: #fff;
  border-left: 1px solid var(--border);
  padding: 18px 18px 20px;
  overflow-y: auto;
  color: var(--text);
}
.close {
  float: right;
  font-size: 2rem;
  line-height: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
}
.modal-panel h2 {
  margin: 8px 0 18px;
  font-size: 1.45rem;
  font-weight: 700;
}
.checkout-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.summary-name {
  font-weight: 700;
}
.summary-price-wrap { text-align: right; }
.summary-price {
  font-weight: 700;
}
label {
  display: block;
  margin-top: 14px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
}
input, select {
  width: 100%;
  margin-top: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--text);
  padding: 10px 11px;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--nav);
}
.delivery-box {
  margin-top: 14px;
  padding: 10px 11px;
  background: #f7f7f7;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
}
.payment-result {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--border);
  background: #fafafa;
}
.payment-result.hidden { display: none; }
.receipt-box {
  display: grid;
  gap: 10px;
}
.receipt-title {
  font-size: 1rem;
  font-weight: 700;
}
.receipt-note {
  color: var(--muted);
  font-size: 0.76rem;
}
.payment-result img {
  width: 170px;
  max-width: 100%;
  border: 1px solid var(--border);
  background: #f5f5f5;
}
.receipt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.error-box {
  color: #8d1f2b;
}
.empty-state {
  color: var(--muted);
  padding: 18px 14px;
}

@media (max-width: 760px) {
  .nav-inner,
  .page-shell,
  .footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .main-nav {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0;
    height: auto;
    padding: 6px 0 8px;
  }
  .nav-item {
    height: auto;
    min-height: 30px;
    padding: 0 10px;
  }

  .product-table thead {
    display: none;
  }
  .product-table tbody,
  .product-table tr,
  .product-table td {
    display: block;
    width: 100%;
  }
  .product-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
  }
  .product-table tbody tr {
    background: #fff;
  }
  .product-table tbody td:nth-child(1),
  .product-table tbody td:nth-child(2),
  .product-table tbody td:nth-child(3),
  .product-table tbody td:nth-child(4),
  .product-table tbody td:nth-child(5),
  .product-table tbody td:nth-child(6) {
    text-align: left;
  }

  .price-cell, .stock-cell, .action-cell {
    text-align: left;
  }

  .product-cards {
    display: grid;
    gap: 10px;
    margin-top: 12px;
  }
  .product-row-card {
    background: #fff;
    border: 1px solid var(--border);
    padding: 12px 14px;
  }
  .row-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
  }
  .row-price {
    margin-top: 12px;
    font-weight: 700;
  }

  .modal {
    justify-items: stretch;
  }
  .modal-panel {
    width: 100%;
    max-width: 100%;
  }
}
