:root {
  color-scheme: light;
  --bg: #f4f6f1;
  --panel: #ffffff;
  --ink: #18201b;
  --muted: #687067;
  --line: #d9dfd2;
  --green: #1f6f48;
  --green-deep: #164a34;
  --amber: #c8872c;
  --red: #b43d31;
  --shadow: 0 12px 28px rgba(26, 37, 29, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px 16px 36px;
}

.topbar,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  padding: 12px 0 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.04;
}

h2 {
  margin: 0;
  font-size: 24px;
}

.admin-entry,
.showcase-entry,
.primary-button,
.secondary-button,
.add-button {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 16px;
  font-weight: 800;
}

.admin-entry,
.showcase-entry,
.secondary-button {
  background: #e7ecdf;
  color: var(--green-deep);
}

.primary-button,
.add-button {
  background: var(--green);
  color: #fff;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 190px) minmax(120px, 170px);
  gap: 10px;
  align-items: end;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

.catalog-status {
  min-height: 20px;
  margin: 8px 2px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.notice {
  margin: 14px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--amber);
  background: #fff9ed;
  color: #5c4522;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  display: grid;
  grid-template-rows: 230px auto;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.product-image {
  display: grid;
  place-items: center;
  position: relative;
  height: 230px;
  min-height: 230px;
  overflow: hidden;
  padding: 8px;
  background: #f7f8f4;
  color: var(--muted);
  font-weight: 800;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product-body {
  display: grid;
  gap: 10px;
  padding: 12px;
  position: relative;
  z-index: 1;
  background: var(--panel);
}

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

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

.badge {
  flex: 0 0 auto;
  max-width: 120px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf5eb;
  color: var(--green-deep);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.summary {
  margin: 0;
  min-height: 42px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

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

.product-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.pricing-note {
  min-height: 18px;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.product-meta div {
  padding: 7px;
  background: #f7f8f4;
  border-radius: 8px;
}

.product-meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.product-meta dd {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 800;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.price-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.price-row strong,
#cartTotal {
  font-size: 20px;
}

.checkout,
.admin-panel {
  margin-top: 22px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.catalog-empty {
  padding: 22px;
  color: var(--muted);
  text-align: center;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.cart-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.cart-empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: #f7f8f4;
  border-radius: 8px;
}

.cart-shortcut {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 214px;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid #195b3c;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  box-shadow: 0 10px 24px rgba(22, 74, 52, 0.28);
  text-align: left;
}

.cart-shortcut-icon {
  font-size: 20px;
  line-height: 1;
}

.cart-shortcut-copy {
  display: grid;
  gap: 1px;
  flex: 1;
}

.cart-shortcut-label {
  font-size: 12px;
  font-weight: 750;
}

.cart-shortcut-copy strong {
  font-size: 15px;
}

.cart-shortcut-count {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 50%;
  background: #fff;
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 850;
}

.cart-item h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.cart-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.remove-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: #f3dfdc;
  color: var(--red);
  font-size: 22px;
  line-height: 1;
}

.request-form,
.admin-form {
  display: grid;
  gap: 12px;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.form-status.error {
  color: var(--red);
}

.form-status.success {
  color: var(--green);
}

.hidden {
  display: none !important;
}

body.admin-mode #storefront,
body.admin-mode .admin-entry,
body.admin-mode .cart-shortcut {
  display: none !important;
}

body.admin-mode .showcase-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.admin-mode .admin-panel {
  margin-top: 0;
}

@media (max-width: 900px) {
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 14px 12px 28px;
  }

  .topbar {
    align-items: flex-start;
  }

  h1 {
    font-size: 28px;
  }

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

  .toolbar .search-field {
    grid-column: 1 / -1;
  }

  .toolbar label {
    gap: 3px;
  }

  .toolbar input,
  .toolbar select {
    min-height: 38px;
    padding: 7px 8px;
  }

  .catalog-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .product-card {
    grid-template-rows: 230px 1fr;
  }

  .price-row {
    align-items: stretch;
    flex-direction: column;
  }

  .add-button {
    width: 100%;
  }

  .cart-item {
    grid-template-columns: 1fr 38px;
  }

  .cart-shortcut {
    right: 12px;
    bottom: 12px;
    min-width: 196px;
  }
}
