/* Витрина тура (тип бизнеса tour), блок T4 плана docs-project/tours/PLAN.md.
   Свои классы с префиксом tour-, цвета - общие токены витрины из
   showcase.html (--color-*-rgb, --accent-color), тёмная тема - body.theme-dark. */
#tour-root {
  --tour-line: rgb(226 232 240);
  --tour-soft: rgb(var(--color-surface-2-rgb));
  --tour-cta: var(--gradient-cta, var(--accent-color, #6A35D6));
  --tour-cta-ink: #fff;
  color: rgb(var(--color-text-rgb));
}
body.theme-dark #tour-root { --tour-line: rgb(72 72 72); }

.tour-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.tour-head-place { display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: 0.8rem; min-width: 0; }
.tour-head-chip { background: var(--tour-soft); border-radius: 999px; padding: 0.25rem 0.7rem; font-weight: 600; }
.tour-link-btn { border: 0; background: none; color: rgb(var(--accent-text-rgb, 106 53 214)); font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; padding: 0.4rem 0.1rem; white-space: nowrap; }
.tour-link-btn[hidden] { display: none; }

/* Блок о гиде */
.tour-guide { display: flex; gap: 0.9rem; align-items: flex-start; border: 1px solid var(--tour-line); background: rgb(var(--color-surface-rgb)); border-radius: 1rem; padding: 0.9rem; margin-bottom: 1.1rem; }
.tour-guide-photo { flex: none; width: 4.5rem; height: 4.5rem; border-radius: 999px; overflow: hidden; background: var(--tour-soft); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 700; color: rgb(var(--color-text-muted-rgb)); }
.tour-guide-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tour-guide-main { min-width: 0; flex: 1; }
.tour-guide-name { font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }
.tour-guide-meta { display: flex; flex-wrap: wrap; gap: 0.3rem 0.45rem; font-size: 0.78rem; margin: 0.35rem 0; }
.tour-guide-meta span { background: var(--tour-soft); border-radius: 999px; padding: 0.2rem 0.6rem; font-weight: 600; }
.tour-guide-about { font-size: 0.88rem; line-height: 1.5; white-space: pre-line; color: rgb(var(--color-text-muted-rgb)); margin: 0.3rem 0 0; overflow-wrap: anywhere; }

/* Карточки предложений */
.tour-section { margin-bottom: 1.25rem; }
.tour-section-title { font-size: 1rem; font-weight: 700; margin: 0.6rem 0; }
.tour-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.8rem; }
@media (min-width: 640px) { .tour-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .tour-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tour-card { display: flex; flex-direction: column; text-align: left; border: 1px solid var(--tour-line); background: rgb(var(--color-surface-rgb)); color: inherit; border-radius: 1rem; padding: 0; font: inherit; cursor: pointer; min-width: 0; overflow: hidden; }
.tour-card-photo { display: block; aspect-ratio: 16 / 10; background: var(--tour-soft); width: 100%; }
.tour-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tour-card-nophoto { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 2rem; font-weight: 700; color: rgb(var(--color-text-muted-rgb)); }
.tour-card-body { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.7rem 0.85rem 0.85rem; min-width: 0; }
.tour-card-title { font-size: 0.98rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.tour-card-meta, .tour-card-date { font-size: 0.8rem; color: rgb(var(--color-text-muted-rgb)); }
.tour-card-price { font-size: 1rem; font-weight: 800; margin-top: 0.2rem; }
/* Блок T10: рейтинг предложения на карточке и блок «Отзывы» на экране предложения. */
.tour-card-rating { font-size: 0.8rem; color: rgb(var(--color-text-rgb)); }
.tour-card-rating b { color: var(--accent-color, #FF7A00); }
.tour-reviews .rv-summary { margin-bottom: 0.7rem; }
.tour-reviews .rv-item { text-align: left; }
.tour-booking-review { margin-top: 0.6rem; }
.tour-booking-review .rv-rate-btn { margin-top: 0; }
.tour-card-price small { font-size: 0.75rem; font-weight: 600; color: rgb(var(--color-text-muted-rgb)); }
.tour-empty { text-align: center; color: rgb(var(--color-text-muted-rgb)); font-size: 0.9rem; padding: 1.5rem 0; }
.tour-empty a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* Экраны */
.tour-screen { position: fixed; inset: 0; z-index: 1060; display: flex; flex-direction: column; background: rgb(var(--color-surface-rgb)); color: rgb(var(--color-text-rgb)); }
.tour-screen[hidden], .tour-toast[hidden] { display: none; }
.tour-screen-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.5rem; padding: calc(0.6rem + env(safe-area-inset-top)) 1rem 0.6rem; border-bottom: 1px solid var(--tour-line); }
.tour-screen-head > :first-child { justify-self: start; }
.tour-screen-head > :last-child { justify-self: end; }
.tour-screen-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 1rem; width: 100%; max-width: 720px; margin: 0 auto; box-sizing: border-box; }
.tour-screen-foot { padding: 0.75rem 1rem calc(0.9rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--tour-line); width: 100%; max-width: 720px; margin: 0 auto; box-sizing: border-box; }
.tour-screen-foot[hidden] { display: none; }
body.tour-screen-open { overflow: hidden; }

/* Экран предложения */
.tour-gallery { display: flex; gap: 0.5rem; overflow-x: auto; scroll-snap-type: x mandatory; margin-bottom: 0.9rem; border-radius: 0.9rem; }
.tour-gallery img { flex: none; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 0.9rem; scroll-snap-align: start; }
.tour-gallery img:not(:only-child) { width: 86%; }
.tour-title { font-size: 1.25rem; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.tour-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.55rem 0; font-size: 0.78rem; }
.tour-chips span { background: var(--tour-soft); border-radius: 999px; padding: 0.22rem 0.65rem; font-weight: 600; }
.tour-price { font-size: 1.15rem; font-weight: 800; margin: 0.2rem 0 0.7rem; }
.tour-price small { font-size: 0.8rem; font-weight: 600; color: rgb(var(--color-text-muted-rgb)); }
.tour-text { font-size: 0.92rem; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; margin: 0 0 0.6rem; }
.tour-block { margin-top: 1.1rem; }
.tour-block-title { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.4rem; }
.tour-list { list-style: none; padding: 0; margin: 0; font-size: 0.9rem; line-height: 1.5; }
.tour-list li { position: relative; padding-left: 1.4rem; margin-bottom: 0.2rem; overflow-wrap: anywhere; }
.tour-list li::before { content: "✓"; position: absolute; left: 0; font-weight: 800; color: rgb(var(--color-success-strong-rgb)); }
.tour-list--no li::before { content: "×"; color: rgb(var(--color-danger-rgb)); }
.tour-video { position: relative; aspect-ratio: 16 / 9; border-radius: 0.9rem; overflow: hidden; background: #000; margin-bottom: 0.5rem; }
.tour-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tour-day { border-left: 3px solid var(--tour-line); padding: 0 0 0.9rem 0.85rem; margin-left: 0.3rem; }
.tour-day-number { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; color: rgb(var(--color-text-muted-rgb)); }
.tour-day-title { font-size: 0.95rem; font-weight: 700; margin: 0.1rem 0 0.25rem; overflow-wrap: anywhere; }
.tour-day img { width: 100%; max-width: 420px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 0.75rem; margin-top: 0.4rem; display: block; }

/* Форма брони */
.tour-form { border-top: 1px solid var(--tour-line); margin-top: 1.25rem; padding-top: 0.25rem; }
.tour-form-title { font-size: 1rem; font-weight: 700; margin: 1rem 0 0.6rem; }
.tour-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
@media (min-width: 640px) { .tour-dates { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tour-date { display: flex; flex-direction: column; gap: 0.1rem; text-align: left; border: 1.5px solid var(--tour-line); background: rgb(var(--color-surface-rgb)); color: inherit; border-radius: 0.8rem; padding: 0.55rem 0.7rem; font: inherit; cursor: pointer; min-width: 0; }
.tour-date-label { font-size: 0.86rem; font-weight: 700; overflow-wrap: anywhere; }
.tour-date-note { font-size: 0.72rem; color: rgb(var(--color-text-muted-rgb)); }
.tour-date.is-active { border: 2px solid transparent; background: linear-gradient(rgb(var(--color-surface-rgb)), rgb(var(--color-surface-rgb))) padding-box, var(--tour-cta) border-box; }
.tour-field { margin-bottom: 0.75rem; }
.tour-field label { display: block; font-size: 0.8rem; font-weight: 700; color: rgb(var(--color-text-muted-rgb)); margin-bottom: 0.3rem; }
.tour-field--row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; margin-bottom: 0.2rem; }
.tour-field--row label { margin: 0; font-size: 0.95rem; color: inherit; }
.tour-input { width: 100%; box-sizing: border-box; border: 1px solid var(--tour-line); background: rgb(var(--color-surface-rgb)); color: inherit; border-radius: 0.8rem; padding: 0.7rem 0.85rem; font: inherit; font-size: 0.95rem; }
.tour-input:focus { outline: 2px solid rgb(var(--accent-text-rgb, 106 53 214)); outline-offset: 1px; }
textarea.tour-input { resize: vertical; }
.tour-qty { display: inline-flex; align-items: center; gap: 0.2rem; flex: none; background: var(--tour-soft); border-radius: 999px; padding: 0.2rem; }
.tour-qty button { width: 2.2rem; height: 2.2rem; border-radius: 999px; border: 0; background: rgb(var(--color-surface-rgb)); color: inherit; font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.tour-qty button:disabled { opacity: 0.4; cursor: not-allowed; }
.tour-qty span { min-width: 1.8rem; text-align: center; font-weight: 700; font-size: 0.95rem; }
.tour-hint { font-size: 0.8rem; color: rgb(var(--color-text-muted-rgb)); margin: 0.3rem 0 0.8rem; }
.tour-totals { border-top: 1px solid var(--tour-line); margin-top: 1rem; padding-top: 0.75rem; }
.tour-totals > div { display: flex; justify-content: space-between; gap: 1rem; font-weight: 800; font-size: 1.05rem; }
.tour-totals > div > :first-child { font-weight: 600; font-size: 0.9rem; }
.tour-error { font-size: 0.88rem; font-weight: 600; color: rgb(var(--color-danger-rgb)); margin: 0.6rem 0 0; }
.tour-note { background: rgb(var(--color-danger-rgb) / 0.08); border: 1px solid rgb(var(--color-danger-rgb) / 0.25); border-radius: 0.75rem; padding: 0.7rem 0.9rem; font-size: 0.85rem; line-height: 1.45; margin: 0.6rem 0; }
.tour-note--info { background: rgb(106 53 214 / 0.1); border-color: rgb(106 53 214 / 0.25); }
.tour-error[hidden], .tour-note[hidden], #tour-form-fields[hidden] { display: none; }

.tour-btn { display: block; width: 100%; box-sizing: border-box; text-align: center; border: 0; border-radius: 0.9rem; padding: 0.9rem 1rem; background: var(--tour-cta); color: var(--tour-cta-ink); font: inherit; font-weight: 700; font-size: 0.95rem; cursor: pointer; text-decoration: none; }
.tour-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.tour-btn--ghost { background: transparent; color: inherit; border: 1.5px solid var(--tour-line); margin-top: 0.75rem; }
.tour-btn--danger { background: transparent; color: rgb(var(--color-danger-rgb)); border: 1.5px solid rgb(var(--color-danger-rgb) / 0.4); margin-top: 0.75rem; }

/* Бронь: подтверждение, статус, «Мои брони» */
.tour-done { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.5rem; }
.tour-booking { border: 1px solid var(--tour-line); background: rgb(var(--color-surface-rgb)); border-radius: 1rem; padding: 0.9rem; margin-bottom: 0.8rem; }
.tour-booking-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.tour-booking-number { font-weight: 800; }
.tour-booking-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; overflow-wrap: anywhere; }
.tour-badge { display: inline-block; border-radius: 999px; padding: 0.3rem 0.8rem; font-size: 0.78rem; font-weight: 700; background: var(--tour-soft); }
.tour-badge[data-status="pending"] { background: rgb(217 119 6 / 0.18); }
.tour-badge[data-status="confirmed"], .tour-badge[data-status="completed"] { background: rgb(var(--color-success-strong-rgb) / 0.2); }
.tour-badge[data-status="cancelled"], .tour-badge[data-status="no_show"] { background: rgb(var(--color-danger-rgb) / 0.14); }
.tour-line { display: flex; justify-content: space-between; gap: 1rem; padding: 0.2rem 0; font-size: 0.9rem; }
.tour-line > :first-child { color: rgb(var(--color-text-muted-rgb)); flex: none; }
.tour-line > :last-child { text-align: right; overflow-wrap: anywhere; min-width: 0; }
.tour-line--total { font-weight: 800; border-top: 1px solid var(--tour-line); margin-top: 0.4rem; padding-top: 0.5rem; }
.tour-line--total > :first-child { color: inherit; }
.tour-meeting { background: var(--tour-soft); border-radius: 0.8rem; padding: 0.7rem 0.85rem; font-size: 0.88rem; line-height: 1.45; margin-top: 0.6rem; overflow-wrap: anywhere; }
.tour-meeting b { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: rgb(var(--color-text-muted-rgb)); margin-bottom: 0.15rem; }
.tour-meeting--exact { background: rgb(var(--color-success-strong-rgb) / 0.14); }

.tour-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(110px + env(safe-area-inset-bottom)); z-index: 1100; background: rgb(var(--color-ink-fixed-rgb) / 0.92); color: #fff; border-radius: 999px; padding: 0.55rem 1.1rem; font-size: 0.85rem; font-weight: 600; max-width: calc(100vw - 2rem); text-align: center; }

/* Блок T6: вопрос гиду до брони - ссылки в шапке, «Вопросы и ответы», форма, «Мои вопросы» */
.tour-head { flex-wrap: wrap; }
.tour-head-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 0.9rem; margin-left: auto; }
.tour-qa { border: 1px solid var(--tour-line); background: rgb(var(--color-surface-rgb)); border-radius: 0.9rem; padding: 0.75rem 0.85rem; margin-bottom: 0.6rem; }
.tour-qa-q, .tour-qa-a, .tour-answer { font-size: 0.9rem; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.tour-qa-q b, .tour-qa-a b { display: block; font-size: 0.78rem; font-weight: 700; color: rgb(var(--color-text-muted-rgb)); margin-bottom: 0.1rem; }
.tour-qa-a { background: var(--tour-soft); border-radius: 0.7rem; padding: 0.55rem 0.7rem; margin-top: 0.5rem; }
.tour-counter { font-size: 0.75rem; color: rgb(var(--color-text-muted-rgb)); text-align: right; margin: 0.25rem 0 0; }
.tour-badge[data-status="waiting"] { background: rgb(217 119 6 / 0.18); }
.tour-badge[data-status="answered"] { background: rgb(var(--color-success-strong-rgb) / 0.2); }
#tour-question-form[hidden], #tour-question-done[hidden] { display: none; }

/* Блок T8: уведомления туристу в MAX (кнопка и состояние «подключено» в карточке брони и вопроса). */
.tour-notify { margin-top: 0.2rem; }
.tour-notify .tour-hint { margin: 0.5rem 0 0; }
.tour-notify-done { font-weight: 600; }
.tour-notify-stop {
  margin-top: 0.35rem; padding: 0.35rem 0; min-height: 2rem;
  background: none; border: 0; cursor: pointer; font: inherit; font-size: 0.82rem;
  color: rgb(var(--color-text-muted-rgb)); text-decoration: underline; text-underline-offset: 0.15em;
}
.tour-notify-stop:disabled { opacity: 0.6; cursor: default; }
