:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-2: #eef6f2;
  --surface-3: #f8fafc;
  --text: #1d2430;
  --muted: #687282;
  --border: #d9ded8;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --warning: #b45309;
  --shadow: 0 8px 28px rgba(20, 30, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  padding: 10px 14px;
}

button:hover {
  background: var(--accent-dark);
}

button.secondary {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
}

button.secondary:hover {
  background: var(--surface-2);
}

button.active {
  background: var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.icon-button {
  min-width: 42px;
  padding: 8px;
}

a {
  color: var(--accent-dark);
  font-weight: 700;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
}

.topbar-link:hover {
  background: var(--surface-2);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lang-switch button {
  min-width: 58px;
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-button {
  width: 100%;
  text-align: left;
}

.content {
  min-width: 0;
}

.status-line {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
}

.status-line.error {
  color: var(--danger);
  border-color: #f3b4ad;
}

.status-line.info {
  color: var(--accent-dark);
  border-color: #8fd0c9;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.section-title,
.block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h2,
.block-header h3 {
  margin: 0;
}

.section-title h2 {
  font-size: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--accent-dark);
  font-weight: 700;
}

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

.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.card h3,
.panel h3 {
  margin: 0 0 10px;
}

.muted {
  color: var(--muted);
}

.warning {
  color: var(--warning);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.orders-toolbar {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 10px;
  margin-bottom: 12px;
}

.checkout-blocks {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.checkout-footer-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  margin-top: 14px;
}

.checkout-block {
  display: none;
  border-width: 2px;
}

.checkout-block.active {
  display: block;
  border-color: var(--accent);
}

.primary-action {
  width: 100%;
}

.order-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-section-title,
.button-row,
.checkbox-line {
  grid-column: 1 / -1;
}

.form-section-title {
  margin-top: 6px;
  font-weight: 700;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  background: #ffffff;
}

.checkbox-line {
  flex-direction: row;
  align-items: center;
}

.checkbox-line input {
  width: 20px;
  min-height: 20px;
}

.saved-addresses-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.saved-column {
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface-3);
}

.mini-title {
  margin-bottom: 10px;
  font-weight: 700;
}

.address-template {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.address-template strong,
.line-title {
  display: block;
  margin-bottom: 6px;
}

.product-actions,
.quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.product-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quantity-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent-dark);
  font-weight: 700;
}

.totals {
  display: grid;
  gap: 8px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  background: #e5e7eb;
  border-radius: 999px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
}

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

.summary-box {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-3);
}

.summary-box.warning-box {
  border-color: #f3b4ad;
  background: #fff3f1;
}

.summary-box.blacklist-box {
  border-color: #f4c95d;
  background: #fff9e8;
}

.option-card {
  border: 2px solid var(--border);
}

.option-card.selected {
  border-color: var(--accent);
  background: var(--surface-2);
}

.totals-list {
  display: grid;
  gap: 10px;
}

.totals-divider {
  height: 1px;
  background: var(--border);
}

.field-disabled {
  opacity: 0.65;
}

.inline-select {
  margin-top: 10px;
}

pre {
  max-width: 100%;
  overflow: auto;
  padding: 12px;
  background: #111827;
  color: #e5e7eb;
  border-radius: 8px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 760px) {
  .topbar,
  .topbar-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .layout,
  .form-grid,
  .saved-addresses-layout,
  .checkout-footer-layout,
  .orders-toolbar {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
