:root {
  color-scheme: light;
  --bg: #f7f8f4;
  --ink: #17221c;
  --muted: #66706b;
  --line: #dfe5dc;
  --panel: #ffffff;
  --green: #245d43;
  --green-dark: #133728;
  --mint: #dff1e7;
  --amber: #f0bd4a;
  --red: #c9473f;
  --shadow: 0 18px 52px rgba(16, 28, 21, 0.16);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

body {
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.65;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 14px 112px;
}

.top-scene {
  position: relative;
  min-height: 224px;
  margin: 0 -14px 12px;
  padding: max(18px, env(safe-area-inset-top)) 14px 18px;
  overflow: hidden;
  background: #0f1713;
  color: #fff;
}

.scene-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.78;
}

.top-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 18, 14, 0.82), rgba(10, 18, 14, 0.18) 46%, rgba(10, 18, 14, 0.82));
}

.top-bar,
.service-note {
  position: relative;
  z-index: 1;
}

.top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: 32px;
  line-height: 1.02;
}

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

.service-note {
  width: min(420px, 92%);
  margin: 98px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.35;
}

.icon-button {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
  font-size: 22px;
  backdrop-filter: blur(12px);
}

.cart-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

.controls {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: 0 -14px;
  padding: 10px 14px 12px;
  border-bottom: 1px solid rgba(223, 229, 220, 0.78);
  background: rgba(247, 248, 244, 0.94);
  backdrop-filter: blur(18px);
}

.search-box {
  display: flex;
  height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
}

.category-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

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

.tab-button.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.catalog {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.category-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 2px;
}

.category-title h2 {
  font-size: 20px;
}

.category-title span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.product-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

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

.price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.unit-chip {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}

.filter-chip {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.filter-chip.filtered {
  background: #fff0be;
  color: #644300;
}

.filter-chip.unfiltered {
  background: #e7ddff;
  color: #3f2a78;
}

.add-button,
.submit-button,
.qty-button {
  min-height: 42px;
  border-radius: var(--radius);
  border: 0;
  font-weight: 800;
}

.add-button {
  min-width: 86px;
  padding: 0 12px;
  background: var(--green);
  color: #fff;
}

.qty-control {
  display: grid;
  grid-template-columns: 34px 32px 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.qty-button {
  min-height: 36px;
  background: #edf4ef;
  color: var(--green-dark);
}

.qty-value {
  text-align: center;
  font-weight: 800;
}

.cart-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
}

.remove-button {
  width: 36px;
  background: #fae8e6;
  color: var(--red);
}

.empty-state {
  padding: 36px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.cart-panel,
.choice-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
}

.cart-panel.open,
.choice-modal.open {
  display: block;
}

.cart-backdrop,
.choice-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 14, 0.52);
}

.cart-sheet,
.choice-card {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 760px);
  max-height: 90vh;
  margin: 0 auto;
  overflow: auto;
  border-radius: 12px 12px 0 0;
  background: #fff;
  box-shadow: var(--shadow);
}

.cart-sheet {
  padding: 16px 14px max(18px, env(safe-area-inset-bottom));
}

.cart-header,
.cart-total,
.cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-header {
  margin-bottom: 12px;
}

.cart-header .icon-button {
  border-color: var(--line);
  background: #f4f6f2;
  color: var(--ink);
  font-size: 28px;
}

.cart-lines {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.cart-line {
  min-height: 58px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line > div:first-child {
  min-width: 0;
}

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

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

.cart-total {
  padding: 12px;
  border-radius: var(--radius);
  background: #eef5f0;
  font-weight: 900;
}

.checkout {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.manual-weight input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  outline: 0;
  font-size: 16px;
}

.phone-status {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid #b8d8c1;
  border-radius: var(--radius);
  background: #eef7f0;
}

.phone-status.loading,
.phone-status.unverified {
  border-color: #e2c886;
  background: #fff8e6;
}

.phone-status-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.phone-status.unverified .phone-status-icon,
.phone-status.loading .phone-status-icon {
  background: #9d6b12;
}

.phone-status-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.phone-status-copy span,
.phone-status-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.phone-status-copy strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.3;
}

.phone-action {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--green);
  background: #fff;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.phone-status.unverified .phone-action {
  border-color: #9d6b12;
  color: #744b06;
}

.submit-button {
  width: 100%;
  min-height: 48px;
  background: var(--green);
  color: #fff;
}

.submit-button:disabled {
  cursor: not-allowed;
  background: #8a978f;
}

.form-error {
  display: none;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.form-error.show {
  display: block;
}

.choice-card {
  padding: 18px 14px max(18px, env(safe-area-inset-bottom));
}

.choice-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.choice-option {
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7faf6;
  color: var(--ink);
  font-weight: 900;
}

.manual-weight {
  display: none;
  grid-template-columns: 1fr 120px;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
}

.manual-weight.show {
  display: grid;
}

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

.toast {
  position: fixed;
  right: 14px;
  bottom: 18px;
  left: 14px;
  z-index: 40;
  display: none;
  width: min(520px, calc(100% - 28px));
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #17221c;
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 700;
  text-align: center;
}

.toast.show {
  display: block;
}

@media (min-width: 680px) {
  .app-shell {
    padding-right: 20px;
    padding-left: 20px;
  }

  .top-scene,
  .controls {
    margin-right: -20px;
    margin-left: -20px;
    padding-right: 20px;
    padding-left: 20px;
  }

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

  .category-title {
    grid-column: 1 / -1;
  }
}
