:root {
  --bg: #f4f6f5;
  --card: #ffffff;
  --text: #15201b;
  --muted: #647067;
  --line: #d6ded9;
  --accent: #087f5b;
  --accent-dark: #066548;
  --danger: #a33a3a;
  --shadow: 0 12px 28px rgba(17, 38, 30, 0.10);
}

* {
  box-sizing: border-box;
}

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

.page {
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 14px 110px;
}

.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 14px;
}

.hero {
  display: flex;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(135deg, #1f322b, #0f6b50);
  color: #fff;
  box-shadow: var(--shadow);
}

.hero__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255,255,255,0.13);
  font-size: 25px;
  flex: 0 0 auto;
}

.hero h1 {
  margin: 0 0 7px;
  font-size: 21px;
  line-height: 1.16;
}

.hero p {
  margin: 0 0 4px;
  font-size: 14px;
  opacity: 0.92;
}

.hero .camera {
  font-weight: 700;
  opacity: 1;
}

.notice {
  margin: 12px 0 18px;
  padding: 13px 15px;
  background: #fff7e6;
  border: 1px solid #f0d7a1;
  border-radius: 16px;
  color: #5e4210;
  font-size: 14px;
}

.scan-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border: 0;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 20px rgba(8, 127, 91, 0.20);
}

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

.scan-toolbar {
  position: sticky;
  top: calc(10px + env(safe-area-inset-top, 0px));
  z-index: 15;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin: 12px 0 16px;
  padding: 8px 10px;
  border-radius: 18px;
  background: rgba(244, 246, 245, 0.78);
  border: 1px solid rgba(214, 222, 217, 0.7);
  box-shadow: 0 10px 24px rgba(17, 38, 30, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.scan-toolbar .scan-button {
  width: auto;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(8, 127, 91, 0.26);
}

.menu .category-title {
  scroll-margin-top: calc(56px + env(safe-area-inset-top, 0px));
}

.category-title {
  margin: 22px 2px 10px;
  font-size: 19px;
}

.product-list {
  display: grid;
  gap: 12px;
}

.product-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  overflow: hidden;
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 8px 18px rgba(17, 38, 30, 0.06);
}

.product-card--out {
  opacity: 0.62;
  filter: grayscale(0.45);
  border-color: #dce4df;
  box-shadow: none;
}

.product-card--out .product-card__body {
  color: var(--muted);
}

.product-card--out h3 {
  color: var(--muted);
}

.product-card--out .qty__btn:not(:disabled) {
  opacity: 0.85;
}

.stock--out {
  color: var(--muted);
  font-weight: 600;
}

.interest {
  min-height: 16px;
  margin-top: 4px;
  font-size: 11px;
  line-height: 16px;
  color: #b45309;
  font-weight: 600;
}

.interest[hidden] {
  display: block;
  visibility: hidden;
}

.product-card__image {
  width: 92px;
  height: 100%;
  object-fit: cover;
  background: #d9e2dd;
}

.product-card__body {
  padding: 13px 13px 12px;
}

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

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

.product-card strong {
  white-space: nowrap;
  font-size: 16px;
}

.stock {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.qty {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 11px;
  margin-top: 13px;
}

.qty__btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #edf5f1;
  color: var(--text);
  font-size: 25px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
}

.qty__btn.plus {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.qty__btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.qty__value {
  min-width: 20px;
  text-align: center;
  font-weight: 800;
  font-size: 18px;
}

.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: rgba(244,246,245,0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}

.bottom-bar .pay-button {
  max-width: 520px;
  margin: 0 auto;
}

.pay-button,
.secondary-button {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 18px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.pay-button {
  display: block;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 20px rgba(8, 127, 91, 0.24);
}

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

.pay-button:disabled {
  background: #9aa6a0;
  box-shadow: none;
  cursor: not-allowed;
}

.secondary-button {
  margin-top: 10px;
  background: #edf0ee;
  color: var(--text);
  border: 1px solid var(--line);
}

.modal[hidden],
.toast[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 19, 15, 0.54);
}

.modal__panel {
  position: relative;
  width: min(520px, calc(100vw - 20px));
  margin-bottom: 10px;
  padding: 20px;
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow);
}

#html5QrReader video {
  width: 100%;
  border-radius: 16px;
}

.modal__panel h2 {
  margin: 0 0 8px;
  font-size: 23px;
}

.modal__question {
  margin: 0 0 14px;
  color: var(--muted);
}

.confirm-items {
  display: grid;
  gap: 9px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8faf9;
}

.confirm-row,
.success-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.confirm-total {
  display: flex;
  justify-content: space-between;
  margin: 15px 0;
  font-size: 20px;
  font-weight: 900;
}

.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 92px;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 14px;
  color: #fff;
  background: var(--danger);
  text-align: center;
  z-index: 30;
  font-weight: 700;
}

.success-card {
  width: 100%;
  padding: 24px;
  border-radius: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}

.success-icon {
  font-size: 44px;
  margin-bottom: 8px;
}

.success-card h1 {
  margin: 0 0 16px;
  font-size: 26px;
}

.success-items {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 14px;
  border-radius: 18px;
  background: #f8faf9;
  border: 1px solid var(--line);
  text-align: left;
}

.success-total {
  margin: 18px 0 10px;
  font-size: 30px;
  font-weight: 900;
}

.success-meta {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 14px;
}

.pickup-callout {
  margin-top: 18px;
  padding: 14px;
  border-radius: 18px;
  background: #e7f6ef;
  border: 1px solid #b9e3cf;
  color: #085f45;
  font-weight: 900;
}

.thanks {
  margin: 18px 0 0;
  font-size: 18px;
  font-weight: 800;
}

.secondary-link-button {
  display: block;
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #edf0ee;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 17px;
  text-align: center;
}

.buy-more {
  margin-top: 16px;
  text-decoration: none;

  display: flex;              /* 👈 ключ */
  align-items: center;        /* вертикально */
  justify-content: center;    /* горизонтально */

  text-align: center;         /* на всякий случай */
}

@media (max-width: 380px) {
  .product-card {
    grid-template-columns: 82px 1fr;
  }

  .product-card__image {
    width: 82px;
  }

  .qty__btn {
    width: 38px;
    height: 38px;
  }
}
