/* Витрина Bodymanual: воспроизводит дизайн действующего магазина своими средствами. */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/montserrat-var-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/montserrat-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212, U+FEFF;
}

:root {
  --text: #212121;
  --muted: #757575;
  --green: #00ac6e;
  --green-dark: #009860;
  --orange: #ff6015;
  --line: #e2e2e2;
  --bg-soft: #f5f5f5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* hidden должен скрывать элемент даже там, где класс задаёт display */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: "Montserrat", -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
}

.btn {
  display: inline-block;
  background: var(--green);
  color: #fff;
  border: 2px solid var(--green);
  border-radius: 8px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-decoration: none;
  text-align: center;
  padding: 14px 32px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.secondary {
  background: #fff;
  color: var(--green);
}
.btn.secondary:hover { background: var(--bg-soft); }
.btn.ghost {
  background: none;
  border-color: transparent;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.btn.ghost:hover { background: none; color: var(--text); }

/* ---------- Hero ---------- */

/* Само изображение подключается инлайном в HTML — с версией, чтобы замена
   баннера сразу доходила до браузеров и Telegram WebView. */
.hero {
  background-color: #d7efe4;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  border-radius: 0 0 24px 24px;
}
.hero-inner {
  padding-top: 56px;
  padding-bottom: 56px;
}
.hero-title {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.4;
}
.hero-title span { font-weight: 600; }
.hero-btn {
  margin-top: 28px;
  font-size: 14px;
  padding: 13px 26px;
}

/* ---------- Каталог ---------- */

.section-block { padding-top: 40px; }
.section-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.products {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  padding: 28px 0 24px;
}
.product-card {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-bottom: 8px;
}
.sale-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  padding: 3px 8px;
}
.product-image-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.product-image {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  transition: transform 0.25s ease;
}
.product-image.portrait { aspect-ratio: 420 / 622; object-fit: contain; }
.product-image-btn:hover .product-image { transform: scale(1.03); }
.product-image-btn:active .product-image { transform: scale(0.99); }
.product-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}
.price {
  font-size: 16px;
  font-weight: 600;
}
.price del { color: #999; margin-right: 8px; }
.price ins { text-decoration: none; }
.order-btn { min-width: 166px; margin-top: auto; }

/* ---------- Текстовые блоки ---------- */

.welcome {
  text-align: center;
  padding: 48px 0 24px;
}
.welcome h2 { font-size: 24px; font-weight: 700; margin-bottom: 20px; }
.welcome p { line-height: 1.7; margin-bottom: 16px; }
.welcome-note { font-weight: 600; }

.info {
  text-align: center;
  padding: 32px 0 48px;
}
.info h2 { font-size: 24px; font-weight: 700; margin-bottom: 32px; line-height: 1.4; }
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
.info-item img { width: 80px; height: 80px; margin-bottom: 14px; }
.info-item p { line-height: 1.6; }

.footer {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 28px 0 36px;
  font-size: 14px;
  color: var(--muted);
}
.footer a { color: var(--green); }
.copyright { margin-top: 10px; }

/* ---------- Описание товара ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 8;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

.product-modal {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px 20px 0 0;
  max-height: 90vh;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.22);
  animation: slide-up 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 640px) {
  .product-modal {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 520px;
    border-radius: 20px;
    max-height: 86vh;
    animation: modal-in 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  }
  @keyframes modal-in {
    from { opacity: 0; transform: translate(-50%, -46%) scale(0.97); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }
}

.modal-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px;
}
.modal-top {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: flex-end;
  padding: 14px 14px 0;
}
.modal-close {
  border: none;
  background: rgba(0, 0, 0, 0.05);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.modal-close:hover { background: rgba(0, 0, 0, 0.1); color: var(--text); }

.modal-photo {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 16px;
  background: var(--bg-soft);
}
.modal-title { font-size: 19px; font-weight: 700; line-height: 1.35; margin-bottom: 8px; }
.modal-price { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.modal-price del { color: #999; font-weight: 600; font-size: 15px; margin-right: 8px; }
.modal-text p { font-size: 14.5px; line-height: 1.65; margin-bottom: 12px; }
.modal-text p:last-child { margin-bottom: 0; }

.modal-footer {
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
  border-radius: 0 0 20px 20px;
}
.modal-footer .btn { width: 100%; padding: 14px 16px; }

/* ---------- Панель оформления заказа ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10;
}
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 11;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
  animation: slide-up 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 640px) {
  .sheet {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 480px;
    border-radius: 20px;
    bottom: 5vh;
  }
}

.sheet h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.sheet-head h3 { margin-bottom: 0; }
.sheet-close {
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: #b6bdc4;
  cursor: pointer;
  padding: 0 2px;
}
.sheet-close:hover { color: var(--text); }

/* Компактные строки «Доставка» и «Оплата» с маленькой ссылкой «Изменить» */
.info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--bg-soft);
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  color: var(--text);
}
button.info-row { cursor: pointer; }
button.info-row:hover .row-edit { text-decoration: underline; }
.info-row .row-body { flex: 1; line-height: 1.5; min-width: 0; }
.info-row .row-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin-bottom: 3px;
}
.info-row .row-main { font-weight: 600; }
.info-row .row-edit {
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  align-self: center;
}
.sheet-product {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}
.sheet-product img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
}
.sheet-product .name { font-weight: 600; font-size: 15px; line-height: 1.35; }
.sheet-product .sum { font-weight: 700; margin-top: 4px; }

.sheet-question { font-weight: 600; margin: 6px 0 14px; }

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.sheet-actions .btn { width: 100%; padding: 14px 16px; font-size: 14px; }

.option-list { list-style: none; margin-bottom: 14px; }
.option-list li { margin-bottom: 10px; }
.option-btn {
  width: 100%;
  text-align: left;
  background: var(--bg-soft);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 13px 14px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}
.option-btn:hover { border-color: var(--green); }
.option-btn .tag {
  display: inline-block;
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  margin-left: 6px;
}

.sheet form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0 5px;
}
.sheet form input, .sheet form textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
}
.sheet form input:focus, .sheet form textarea:focus {
  outline: none;
  border-color: var(--green);
}
.sheet form .btn { margin-top: 18px; }

.sheet-status {
  text-align: center;
  padding: 24px 0;
}
.sheet-status .icon { font-size: 44px; margin-bottom: 12px; }
.sheet-status .title { font-weight: 700; font-size: 17px; margin-bottom: 8px; }
.sheet-status .detail { color: var(--muted); font-size: 14px; line-height: 1.6; }

.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 14px;
  border: 4px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-error {
  color: #d9534f;
  font-size: 13px;
  margin-top: 10px;
  min-height: 17px;
}

/* ---------- Мобильная раскладка ---------- */

@media (max-width: 900px) {
  .products { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .info-grid { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 560px) {
  .hero-inner { padding-top: 32px; padding-bottom: 36px; }
  .hero-title { font-size: 24px; }
  .products { grid-template-columns: repeat(2, 1fr); padding-top: 28px; }
  .product-title { font-size: 14px; }
  .price { font-size: 14px; }
  .order-btn { min-width: 0; width: 100%; padding: 12px 10px; font-size: 13px; }
  .welcome h2, .info h2, .section-title { font-size: 20px; }
  .section-block { padding-top: 28px; }
  .welcome p, .info-item p { font-size: 14px; }
}
