/* Bonmie — общий файл стилей витрины и страниц Worker'а. Мобильный в первую очередь.
   Только внешний файл: встроенные стили запрещены политикой безопасности (ТЗ §11). */

:root {
  --bg: #faf6ef;
  --surface: #ffffff;
  --ink: #2b2118;
  --muted: #6b5a4a;
  --brand: #8a4b14;
  --brand-ink: #ffffff;
  --line: #e4d6c2;
  --focus: #1a5fb4;
  --error: #b3261e;
  --ok: #2e6b2e;
  --radius: 12px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
}

a {
  color: var(--brand);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: block;
  line-height: 0;
}

.logo img {
  display: block;
  width: auto;
  height: 36px;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  padding: 24px 16px;
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
}

h1 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 12px;
}

h2 {
  font-size: 1.25rem;
  margin: 0 0 12px;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
}

.muted,
.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.button,
button.button {
  display: inline-block;
  min-height: 48px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.button.button-secondary {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
}

.link-button {
  border: none;
  background: none;
  padding: 8px 0;
  color: var(--brand);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Форма заявки */

.progress-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 4px;
}

progress {
  width: 100%;
  height: 8px;
  margin-bottom: 20px;
  accent-color: var(--brand);
}

.block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin: 0;
}

/* Заголовок блока — внутри рамки, а не на ней. */
.block > legend {
  float: left;
  width: 100%;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  padding: 0;
  margin-bottom: 8px;
}

.block > legend + * {
  clear: both;
}

.choices > legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 6px;
}

.choices > legend + * {
  clear: both;
}

.field {
  margin: 16px 0;
}

.field > label,
.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='search'],
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #b9a78f;
  border-radius: 10px;
  font: inherit;
  background: var(--surface);
  color: var(--ink);
}

textarea {
  min-height: 80px;
}

.choices {
  display: grid;
  gap: 8px;
  border: none;
  padding: 0;
  margin: 0;
}

.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}

.choice input {
  width: 20px;
  height: 20px;
  accent-color: var(--brand);
  flex: none;
}

.error {
  color: var(--error);
  font-size: 0.95rem;
  margin: 6px 0 0;
}

.notice-box {
  border-left: 4px solid var(--brand);
  background: #fff8ee;
  padding: 12px;
  border-radius: 6px;
  margin: 12px 0;
}

.notice-box.warning {
  border-left-color: var(--error);
  background: #fdeeee;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

/* Подсказки адреса и булочных */

.suggestions {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.suggestions li {
  margin: 0;
}

.suggestions button,
.option-button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px;
  min-height: 48px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

.suggestions li:last-child button {
  border-bottom: none;
}

.suggestions button:hover,
.suggestions button:focus-visible,
.option-button[aria-pressed='true'] {
  background: #fff1dd;
}

.option-button .meta {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.selected-box {
  padding: 12px;
  border: 2px solid var(--brand);
  border-radius: 10px;
  background: #fff8ee;
}

/* Корзина */

.products {
  display: grid;
  gap: 12px;
}

.product-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.product-card img {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

.product-card h3 {
  margin: 0;
  font-size: 1rem;
}

.product-card p {
  margin: 2px 0 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.stepper button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  background: var(--surface);
  color: var(--brand);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
}

.stepper output {
  min-width: 2ch;
  text-align: center;
  font-weight: 700;
}

/* Дни недели */

.days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.days button {
  min-width: 48px;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--surface);
  font: inherit;
  cursor: pointer;
}

.days button[aria-pressed='true'] {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-ink);
}

.fee-line {
  font-weight: 600;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Главная */

.hero {
  padding: 32px 0 8px;
}

.hero-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 24px;
  border-radius: var(--radius);
}

.hero h1 {
  font-size: 1.9rem;
}

.steps {
  padding-left: 20px;
}

.steps li {
  margin-bottom: 10px;
}

.section {
  margin: 32px 0;
}

.section.highlight {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
}

.steps-large li {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.button.button-small {
  min-height: 44px;
  padding: 10px 16px;
}

/* Каталог витрины: вся карточка ведёт в форму (ссылка растянута на карточку), без цен */

.catalog-section {
  margin: 20px 0 28px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.catalog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.catalog-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.catalog-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 12px;
}

.catalog-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.card-link {
  color: var(--ink);
  text-decoration: none;
}

.card-link::after {
  content: '';
  position: absolute;
  inset: 0;
}

.catalog-card:hover {
  border-color: var(--brand);
}

.catalog-desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.catalog-unit {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
}

.price-note {
  margin: 4px 0 8px;
  font-size: 0.82rem;
  color: var(--brand);
  font-style: italic;
}

.catalog-card .button {
  position: relative;
  z-index: 1;
  margin-top: auto;
  text-align: center;
}

/* FAQ и юридические страницы */

.faq {
  margin: 0;
}

.faq-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.faq dt {
  font-weight: 700;
}

.faq dd {
  margin: 4px 0 0;
}

.legal h2 {
  margin-top: 28px;
}

.legal-text {
  white-space: pre-line;
  overflow-wrap: anywhere;
}
