:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18222e;
  background: #f5f7fa;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { touch-action: pan-y; overscroll-behavior-x: none; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; touch-action: pan-y; overscroll-behavior-x: none; background: #f5f7fa; }
.shop { width: min(100%, 620px); margin: 0 auto; padding: 22px 16px calc(110px + env(safe-area-inset-bottom)); }
.header { display: flex; align-items: center; gap: 13px; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px; background: #e6f4ff; font-size: 25px; }
.eyebrow { margin: 0 0 3px; color: #637184; font-size: 10px; font-weight: 750; letter-spacing: .11em; }
h1 { margin: 0; font-size: 23px; line-height: 1.15; }
.intro { margin: 13px 0 19px; color: #687487; font-size: 14px; line-height: 1.4; }
.catalog { display: grid; gap: 10px; }
.product { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 100px; padding: 12px; border: 1px solid #e8edf2; border-radius: 18px; background: #fff; box-shadow: 0 2px 8px #1d2f4210; }
.photo { width: 72px; height: 72px; padding: 6px; overflow: hidden; border-radius: 15px; background: #f1f5f8; }
.photo img { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.product-info { min-width: 0; }
.product-info h2 { margin: 0 0 3px; font-size: 14px; line-height: 1.25; }
.product-info p { margin: 0 0 5px; color: #738095; font-size: 11px; line-height: 1.3; }
.product-info strong { font-size: 14px; }
.stepper { display: flex; align-items: center; height: 36px; border-radius: 11px; background: #f0f3f7; }
.stepper button { display: grid; place-items: center; width: 32px; height: 36px; border: 0; border-radius: 11px; color: #1f2c3b; background: transparent; font-size: 21px; cursor: pointer; }
.stepper button:disabled { color: #aeb7c2; cursor: default; }
.stepper span { min-width: 20px; text-align: center; font-size: 13px; font-weight: 650; }
.checkout-bar { position: fixed; z-index: 2; right: 0; bottom: 0; left: 0; display: flex; align-items: center; gap: 14px; width: min(100%, 620px); margin: 0 auto; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #e5eaf0; background: #ffffffed; backdrop-filter: blur(14px); }
.total { display: grid; gap: 2px; min-width: 78px; }
.total span { color: #778396; font-size: 11px; }
.total strong { font-size: 17px; }
.checkout { flex: 1; min-height: 48px; border: 0; border-radius: 14px; color: #fff; background: #1686f2; font-size: 15px; font-weight: 700; cursor: pointer; }
.checkout:disabled { color: #7d8b9b; background: #e8edf2; cursor: default; }
.notice { margin-top: 14px; padding: 13px 14px; border-radius: 13px; color: #145538; background: #e9f8ef; font-size: 13px; line-height: 1.4; }
.notice.error { color: #8d2e2e; background: #fff0ef; }
dialog { width: min(440px, calc(100vw - 32px)); max-height: 82vh; padding: 20px; border: 0; border-radius: 18px; color: #1f2c3b; box-shadow: 0 16px 48px #10203044; }
dialog::backdrop { background: #10203088; }
dialog form { display: grid; gap: 14px; }
dialog h2, dialog p { margin: 0; }
.address-dialog-button {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: #e8edf2;
  color: #1f2c3b;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.address-dialog-primary { background: #1269b5; color: #fff; }
.delivery-time { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: #eaf4ff; font-size: 18px; font-weight: 700; }
.delivery-time select { width: 100%; min-height: 52px; padding: 8px 12px; border: 1px solid #1269b5; border-radius: 10px; background: #fff; color: #163b5e; font: inherit; }
.district-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.district-choice-list { display: grid; gap: 9px; max-height: 48vh; overflow: auto; }
.district-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid #d9e1e8; border-radius: 12px; cursor: pointer; font-size: 14px; line-height: 1.4; }
.district-option input { flex: 0 0 auto; margin-top: 2px; accent-color: #18864b; }
[hidden] { display: none !important; }

@media (max-width: 380px) {
  .shop { padding-right: 12px; padding-left: 12px; }
  .product { grid-template-columns: 60px minmax(0, 1fr) auto; gap: 9px; padding: 10px; }
  .photo { width: 60px; height: 60px; }
  .stepper button { width: 28px; }
}

.delivery-form { display: grid; gap: 14px; padding: 18px; background: #fff; border: 1px solid #e5eaf0; border-radius: 18px; }
.delivery-form h2, .address-check { margin: 0; }
.delivery-form label { display: grid; gap: 5px; min-width: 0; font-size: 13px; font-weight: 650; }
.delivery-form input, .delivery-form select, .delivery-form textarea {
  box-sizing: border-box; width: 100%; min-width: 0; padding: 10px; font: inherit; font-size: 16px;
  color: #1f2c3b; background: #f5f7fa; border: 1px solid #dce4ee; border-radius: 9px;
}
.apartment-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.back-button { justify-self: start; padding: 6px 0; color: #1269b5; background: none; border: 0; cursor: pointer; }
.address-check { color: #48637a; font-size: 13px; }

.delivery-form .saved-address-hint { color: #36546c; font-size: 15px; line-height: 1.5; font-weight: 400; text-align: center; }
