/* BOSFORUS prototype — "Boats for sale" (T04): boat cards with gallery, benefits, how to buy, order form. */

/* R86: низкая шапка (правила — base.css, .page-hero--compact); здесь — кадр борта лодки */
.page-hero--compact .page-hero__img[src*="boats-for-sale"] { object-position: 50% 58%; }

/* ---------- catalog ---------- */
.boats-catalog .container { display: grid; gap: 40px; }

.boat {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; align-items: start;
  padding: 32px; background: var(--white); border-bottom: 2px solid var(--sky);
}
.boat > * { min-width: 0; }
@media (max-width: 1023px) { .boat { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 24px; } }
@media (max-width: 767px) { .boat { padding: 16px; gap: 24px; } }

.boat__name { font-size: clamp(34px, 3.6vw, 48px); margin-bottom: .45em; }
.boat__lead { color: var(--navy); margin-bottom: 1.4em; }

/* gallery */
.gallery__stage { position: relative; background: var(--ice); overflow: hidden; }
/* R79: кадры 4:3 и 3:4 — сцена 4:3, фото целиком (вертикальные — с полями), лодку не обрезаем */
/* R91: touch-action: pan-y — горизонтальный свайп листает кадры, вертикальная прокрутка страницы остается */
.gallery__main { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--navy-deep); touch-action: pan-y; -webkit-user-drag: none; user-select: none; }
.gallery__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center;
  width: 48px; height: 48px; padding: 0; border: 0; border-radius: 0; cursor: pointer;
  background: rgba(255, 255, 255, .28); color: var(--white); font-size: 22px; line-height: 1;
  -webkit-backdrop-filter: blur(10px) saturate(160%); backdrop-filter: blur(10px) saturate(160%);
  transition: background .2s var(--ease), color .2s var(--ease);
}
/* стрелки и «на весь экран» — легкое стекло, не спорят с фото (02.11) */
.gallery__arrow:hover { background: rgba(255, 255, 255, .85); color: var(--navy); }
/* R90: «развернуть на весь экран» — в правом верхнем углу кадра */
.gallery__full {
  position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border: 0; border-radius: 0; cursor: pointer; background: rgba(255, 255, 255, .28); color: var(--white);
  -webkit-backdrop-filter: blur(10px) saturate(160%); backdrop-filter: blur(10px) saturate(160%);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.gallery__full:hover { background: rgba(255, 255, 255, .85); color: var(--navy); }
.gallery__full .icon { width: 24px; height: 24px; }
.gallery__arrow--prev { left: 0; }
.gallery__arrow--next { right: 0; }
.gallery__count {
  position: absolute; right: 0; bottom: 0; padding: 6px 12px; background: rgba(12, 34, 51, .78); color: var(--white);
  font: 500 14px/1.2 var(--sans); letter-spacing: .08em;
}
.gallery__thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.gallery__thumb {
  display: block; padding: 0; border: 0; border-bottom: 3px solid transparent; background: var(--ice); cursor: pointer;
  opacity: .72; transition: opacity .2s var(--ease), border-color .2s var(--ease);
}
.gallery__thumb:hover { opacity: 1; }
.gallery__thumb[aria-current="true"] { opacity: 1; border-bottom-color: var(--navy); }
.gallery__thumb img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: var(--navy-deep); }
@media (max-width: 767px) {
  .gallery__thumbs { gap: 4px; } .gallery__arrow { width: 44px; height: 44px; }
  /* вертикальный телефон: галерея на всю ширину экрана, за поля карточки и контейнера (02.11) */
  .boat .gallery { margin: -16px calc(-16px - var(--gutter)) 0; }
}

/* ---------- full-screen viewer (R90): тёмный фон, кадр целиком, стрелки, счётчик, крестик ---------- */
.lightbox {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: var(--navy-deep); color: var(--white); overflow: hidden;
}
.lightbox[open] { display: block; }
.lightbox::backdrop { background: var(--navy-deep); }
.lightbox__img {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 64px 72px; box-sizing: border-box;
  object-fit: contain; touch-action: pan-y; -webkit-user-drag: none; user-select: none;
}
.lightbox__close, .lightbox__arrow {
  position: absolute; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 0;
  cursor: pointer; background: rgba(255, 255, 255, .12); color: var(--white); font-size: 22px; line-height: 1;
  transition: background .2s var(--ease);
}
.lightbox__close:hover, .lightbox__arrow:hover { background: rgba(255, 255, 255, .26); }
.lightbox__close:focus-visible, .lightbox__arrow:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.lightbox__close { top: 12px; right: 12px; }
.lightbox__close .icon { width: 24px; height: 24px; }
.lightbox__arrow { top: 50%; transform: translateY(-50%); }
.lightbox__arrow--prev { left: 12px; }
.lightbox__arrow--next { right: 12px; }
.lightbox__count {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 6px 14px;
  background: rgba(255, 255, 255, .12); font: 500 14px/1.2 var(--sans); letter-spacing: .08em;
}
/* подпись снимка над счетчиком (старые фото, 12.11) */
.lightbox__caption {
  position: absolute; left: 50%; bottom: 56px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px);
  margin: 0; font-size: 15px; line-height: 1.4; text-align: center; color: rgba(255, 255, 255, .85);
}
.lightbox__caption:empty { display: none; }
.lightbox__img.is-loading { visibility: hidden; }
.lightbox--captioned .lightbox__img { padding-bottom: 104px; }
/* вертикальный документ (приказ 1980 г.): во всю ширину окна, но не шире 1100px, листается вниз; кнопки на месте */
.lightbox--tall { overflow-y: auto; overscroll-behavior: contain; }
.lightbox--tall .lightbox__img {
  position: static; display: block; width: min(100%, 1100px); height: auto; margin: 0 auto; padding: 72px 72px 112px;
  object-fit: initial; touch-action: pan-y pinch-zoom;
}
.lightbox--tall .lightbox__close, .lightbox--tall .lightbox__arrow, .lightbox--tall .lightbox__count { position: fixed; }
.lightbox--tall .lightbox__caption { position: static; transform: none; margin: -96px auto 0; padding-bottom: 72px; }
@media (max-width: 767px) {
  .lightbox--tall .lightbox__img { padding: 64px 0 104px; }
  .lightbox__img { padding: 64px 0; }
  .lightbox__close { top: 8px; right: 8px; }
  .lightbox__arrow--prev { left: 8px; }
  .lightbox__arrow--next { right: 8px; }
}

/* specifications */
.specs { margin: 0 0 24px; }
.spec { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 16px; }
.spec:last-child { border-bottom: 1px solid var(--line); }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; overflow-wrap: anywhere; }
.boat__price { margin: 0 0 24px; font: 500 30px/1.2 var(--serif); }
@media (max-width: 767px) { .spec { gap: 12px; } .boat .btn { width: 100%; } }

/* second boat: placeholder */
.boat--empty { grid-template-columns: minmax(0, 1fr); place-items: center; min-height: 220px; padding: 48px 24px; border: 1px dashed var(--sky); border-bottom-style: dashed; background: transparent; text-align: center; }
.boat__empty { margin: 0; }

/* ---------- benefits / how to buy ---------- */
.benefits { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; }
.benefits li { padding: 20px 0 22px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.benefits strong { font-weight: 500; }
@media (max-width: 767px) { .benefits { grid-template-columns: minmax(0, 1fr); } }

.boats-how .svc-list { max-width: none; }  /* шаги и заключение - на всю колонку (11.11) */
.boats-closing { margin: 40px 0 0; font: italic 500 clamp(28px, 3vw, 38px)/1.2 var(--serif); max-width: none; }
