/* Секция «Баннеры» на /price: список мест + окно со скриншотом страницы, которое само
   прокручивается к выбранному месту. Подключается только на этой странице (libs/_add.php). */

.bn { scroll-margin-top: calc(var(--price-head, 97px) + 13px); }
.bn__lead { font-size: 15px; line-height: 1.55; color: #4A5254; margin: 0 0 16px; max-width: 62ch; }
.bn__note { font-size: 13px; color: #7C8286; line-height: 1.5; margin: 14px 0 0; }
.bn__terms { margin: 16px 0 12px; }
.bn [hidden] { display: none !important; }

/* ── Сегментные переключатели ──────────────────────────────────────── */
.bn-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bn-switch__hint { font-size: 12.5px; color: #8A9092; }
.bn-seg { display: inline-flex; background: #E4E9E9; border-radius: 22px; padding: 3px; max-width: 100%; }
.bn-seg__btn {
	font: inherit; font-size: 13.5px; font-weight: 600; color: #4A5254; background: transparent; border: 0; cursor: pointer;
	padding: 8px 15px; border-radius: 19px; white-space: nowrap; transition: background .16s ease, color .16s ease;
}
.bn-seg__btn[aria-pressed="true"] { background: #fff; color: #000; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.bn-seg__btn:focus-visible { outline: 2px solid #00A7B0; outline-offset: 1px; }

/* ── Список мест и окно ────────────────────────────────────────────── */
.bn-tour { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.bn-tour__group { font-size: 15px; line-height: 20px; font-weight: 700; color: #000; margin: 20px 0 0; }
.bn-tour__list > .bn-tour__group:first-child { margin-top: 0; }
.bn-rows { margin-top: 8px; }
.bn-tour__sticky { background: #fff; border-radius: 16px; padding: 12px; }
.bn-tour__caption { font-size: 13px; color: #4A5254; line-height: 1.4; margin: 10px 2px 0; min-height: 2.8em; }
.bn-tour__caption b { color: #000; }
.bn-panel__top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }

/* строка места */
.bn-row__num { flex: none; min-width: 40px; text-align: center; font-size: 13px; font-weight: 700; color: #fff; background: #0D4B52; border-radius: 14px; padding: 6px 8px; }
.bn-row.is-hot { background: #F4F7F7; }
.bn-row .price-item__name { font-size: 16px; }
/* у строки места слева ещё номер — на телефоне цена без этого уезжала на отдельную строку */
.bn-row .price-item__text { flex-basis: 130px; }
@media (max-width: 699px) { .bn-row { padding: 14px 8px; gap: 8px 10px; } .bn-row .price-item__price { font-size: 18px; } }

.bn-play { font: inherit; font-size: 13.5px; font-weight: 700; color: #fff; background: #0D4B52; border: 0; border-radius: 20px; padding: 9px 15px 9px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.bn-play:focus-visible { outline: 2px solid #00A7B0; outline-offset: 2px; }
.bn-play__ico { width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent #fff; }
.bn-play[aria-pressed="true"] { background: #00A7B0; }
.bn-play[aria-pressed="true"] .bn-play__ico { width: 8px; height: 10px; border: 0; border-left: 3px solid #fff; border-right: 3px solid #fff; }

/* ── Окно со страницей ─────────────────────────────────────────────── */
.bn-frame { position: relative; border-radius: 14px; overflow: hidden; background: #DDE3E3; border: 1px solid #D3DADA; margin: 0 auto; transition: max-width .3s ease; }
.bn-frame__bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: #EEF1F1; }
.bn-frame__bar i { width: 9px; height: 9px; border-radius: 50%; background: #C9D0D0; flex: none; }
.bn-frame__bar span { margin-left: 8px; flex: 1; min-width: 0; font-size: 12px; color: #7C8286; background: #fff; border-radius: 10px; padding: 4px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bn-frame__view { height: min(440px, 46vh); overflow-y: auto; overscroll-behavior: contain; background: #F2F2F2; position: relative; scrollbar-width: thin; cursor: zoom-in; }
.bn-frame__view:focus-visible { outline: 2px solid #00A7B0; outline-offset: -2px; }
.bn[data-device="mob"] .bn-frame { max-width: 330px; border-radius: 30px; border: 7px solid #1B1D20; }
.bn[data-device="mob"] .bn-frame__bar { display: none; }

@media (max-width: 859px) {
	/* на телефоне окно прилипает под шапкой сайта (--price-head из price.js), список мест идёт под ним */
	.bn-tour__viewer { order: -1; position: sticky; top: calc(var(--price-head, 60px) + 8px); z-index: 5; }
	.bn-tour__sticky { box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
	.bn-frame__view { height: 30vh; }
	.bn[data-device="mob"] .bn-frame { max-width: 240px; border-width: 5px; border-radius: 22px; }
	/* прилипшее окно отнимает экран у списка — оставляем в нём только нужное: кнопка тура
	   без подписи, чтобы встала в строку с переключателем, и без дублирующей строку подписи места */
	.bn-tour__sticky:not(.is-zoom) { padding: 10px; }
	.bn-tour__sticky:not(.is-zoom) .bn-panel__top { flex-wrap: nowrap; margin-bottom: 10px; }
	.bn-tour__sticky:not(.is-zoom) .bn-play { padding: 12px 13px; }
	.bn-tour__sticky:not(.is-zoom) [data-bn-play-text],
	.bn-tour__sticky:not(.is-zoom) .bn-tour__caption { display: none; }
	.bn-tour__caption { min-height: 0; }
	/* место занимает почти всё окно, и кнопка в нижнем углу закрывала его цену */
	.bn-tour__sticky:not(.is-zoom) .bn-zoom { top: 8px; left: 8px; right: auto; bottom: auto; width: 36px; height: 36px; background-size: 17px; }
}
@media (min-width: 860px) {
	.bn-tour { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
	/* окно встаёт вровень с первой плашкой списка, а не с её заголовком: 20px строка заголовка + 8px отступ */
	.bn-tour__viewer { height: 100%; padding-top: 28px; }
	/* под шапкой сайта с тем же отступом, что у заявки справа */
	.bn-tour__sticky { position: sticky; top: calc(var(--price-head, 97px) + 16px); }
	.bn-row .price-item__name { font-size: 15px; }
	.bn-row { padding: 13px 12px; gap: 6px 12px; }
	.bn-row .price-item__price { font-size: 18px; }
}

/* кадр: видим только активную страницу и выбранное устройство */
.bn-shot { position: relative; display: none; }
.bn-shot img { display: block; width: 100%; height: auto; filter: saturate(.45) contrast(.96); }   /* страница — фон для мест, поэтому приглушена */
.bn[data-device="pc"] .bn-shot.is-on[data-bn-shot-device="pc"],
.bn[data-device="mob"] .bn-shot.is-on[data-bn-shot-device="mob"] { display: block; }

/* ── Окно во весь экран ────────────────────────────────────────────── */
.bn-zoom {
	position: absolute; right: 12px; bottom: 12px; z-index: 3; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M12 3h5v5M17 3l-6 6M8 17H3v-5M3 17l6-6' stroke='%230D4B52' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
	box-shadow: 0 3px 12px rgba(0, 0, 0, .28); transition: transform .16s ease;
}
@media (hover: hover) { .bn-zoom:hover { transform: scale(1.08); } }
.bn-zoom:focus-visible { outline: 2px solid #00A7B0; outline-offset: 2px; }
.bn-zoom[aria-pressed="true"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 5l10 10M15 5L5 15' stroke='%230D4B52' stroke-width='2.2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }

.bn-veil { position: fixed; inset: 0; z-index: 10055; background: rgba(6, 30, 34, .74); }
/* выше шапки сайта (30), куки-баннера (9999) и вуали; родитель поднимаем вместе с окном —
   липкая колонка на телефоне создаёт свой слой, и без этого вуаль легла бы поверх окна */
.bn .is-zoom-host { z-index: 10060; }
.bn .bn-tour__sticky.is-zoom {
	position: fixed; z-index: 10060; left: 50%; top: 50%; transform: translate(-50%, -50%);
	width: min(1180px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); padding: 12px;
	display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}
.bn .is-zoom .bn-frame { width: 100%; }
.bn .is-zoom .bn-frame__view { height: calc(100dvh - 170px); cursor: auto; }
.bn .is-zoom .bn-tour__caption { min-height: 0; }
.bn[data-device="mob"] .bn-tour__sticky.is-zoom { width: min(470px, calc(100vw - 20px)); }
.bn[data-device="mob"] .is-zoom .bn-frame { max-width: 430px; border-width: 7px; border-radius: 30px; }

/* ── Рекламное место на кадре ──────────────────────────────────────── */
.bn-spot {
	position: absolute; padding: 0; border: 0; cursor: pointer; overflow: hidden; border-radius: 8px;
	background: #0D4B52 center / cover no-repeat; color: #fff; font: inherit; text-align: left;
	container-type: size;
	box-shadow: 0 0 0 0 rgba(0, 167, 176, .55); animation: bn-pulse 2.6s ease-out infinite;
	transition: transform .18s ease, box-shadow .18s ease;
}
.bn-spot_tall  { background-image: url(../images/price/ph-tall.webp); }
.bn-spot_wide  { background-image: url(../images/price/ph-wide.webp); }
.bn-spot_strip { background-image: url(../images/price/ph-strip.webp); }
@keyframes bn-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(0, 167, 176, .55); }
	70%  { box-shadow: 0 0 0 10px rgba(0, 167, 176, 0); }
	100% { box-shadow: 0 0 0 0 rgba(0, 167, 176, 0); }
}
.bn-spot:focus-visible { outline: 3px solid #000; outline-offset: 2px; }
/* показанное место остаётся одно в свете: тень накрывает всю остальную страницу в окне */
.bn-spot.is-hot { transform: scale(1.035); animation: none; z-index: 2; box-shadow: 0 0 0 3px #fff, 0 0 0 6px #00A7B0, 0 0 0 9999px rgba(6, 30, 34, .6); }
.bn-spot[aria-pressed="true"]:not(.is-hot) { animation: none; box-shadow: 0 0 0 3px #fff, 0 0 0 6px #00A7B0; }

/* надпись на плейсхолдере: три строки в высоком формате, две в широком, одна в полосе */
.bn-spot__text { position: absolute; left: 9cqw; top: 30%; font-size: 9.6cqw; font-weight: 700; line-height: 1.12; letter-spacing: -.02em; pointer-events: none; }
.bn-spot__text span { display: block; }
.bn-spot_wide .bn-spot__text { left: 6.5cqw; top: 31%; font-size: 6.8cqw; }
.bn-spot_wide .bn-spot__text span:first-child { display: inline; }
.bn-spot_strip .bn-spot__text { left: 9.5cqw; top: 50%; transform: translateY(-50%); font-size: min(2.7cqw, 30cqh); white-space: nowrap; }
.bn-spot_strip .bn-spot__text span { display: inline; }

/* подпись места: кегль считается от самого слота, поэтому читается и в мелком окне */
.bn-spot__bar {
	position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 4cqw;
	padding: 9cqw 5cqw 4.5cqw; font-size: clamp(8px, 6.6cqw, 17px); line-height: 1; white-space: nowrap;
	background: linear-gradient(to top, rgba(4, 28, 32, .94) 30%, rgba(4, 28, 32, 0));
}
.bn-spot__bar b { background: #fff; color: #00787E; font-weight: 700; border-radius: 1em; padding: .32em .6em; }
.bn-spot__size { opacity: .78; font-size: .82em; }
.bn-spot__price { margin-left: auto; font-weight: 700; }
@container (max-width: 150px) { .bn-spot__size { display: none; } }
.bn-spot_strip .bn-spot__bar {
	left: auto; top: 0; padding: 0 3cqw 0 8cqw; gap: 1.6cqw; font-size: clamp(8px, 17cqh, 17px);
	background: linear-gradient(to left, rgba(4, 28, 32, .82) 55%, rgba(4, 28, 32, 0));
}
.bn-spot__check {
	position: absolute; top: 4cqw; right: 4cqw; width: clamp(14px, 11cqw, 30px); height: clamp(14px, 11cqw, 30px); border-radius: 50%;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 10'%3E%3Cpath d='M1 5.2 4.5 8.7 12 1.2' stroke='%2300787E' stroke-width='2.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 54% no-repeat;
	opacity: 0; transform: scale(.5); transition: opacity .16s ease, transform .16s ease;
}
.bn-spot_strip .bn-spot__check { top: 50%; right: auto; left: 1.2cqw; margin-top: clamp(-15px, -9cqh, -7px); width: clamp(14px, 18cqh, 30px); height: clamp(14px, 18cqh, 30px); }
.bn-spot[aria-pressed="true"] .bn-spot__check { opacity: 1; transform: none; }

/* ── Требования к баннеру ──────────────────────────────────────────── */
.bn-req { background: #fff; border-radius: 16px; padding: 18px 20px; margin-top: 18px; }
.bn-req__title { font-size: 15px; font-weight: 700; color: #000; margin: 0 0 10px; }
.bn-req__list { margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.5; color: #4A5254; }
.bn-req__list li { position: relative; padding-left: 16px; margin: 0; }
.bn-req__list li + li { margin-top: 6px; }
.bn-req__list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: #00A7B0; }

@media (prefers-reduced-motion: reduce) {
	.bn-spot, .bn-frame { animation: none; transition: none; }
}
