/* ==========================================================================
   Страница акции (/sales/<slug>/) — новый дизайн, один шаблон на все акции
   Разметка: templates/template-discount-v2.php + includes/sale-page.php. Всё под .bsa.
   Завершённая акция — .bsa--ended: чёрно-белая шапка, лента и плашка «Promotion ended».
   ========================================================================== */

.bsa {
  --ink: #231F20; --red: #E32320; --red-d: #C41D1A; --mut: #6F686A; --mut2: #8b8385; --line: #E5E1E1; --tint: #F6F4F3; --ground: #F1F0EF; --wa: #1FA855;
  --sans: "Archivo", "Proxima Nova", Arial, sans-serif; --serif: "Source Serif 4", Georgia, serif;
  --gut: clamp(16px, 5vw, 64px); --max: 1280px;
  background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5;
}
.bsa *, .bsa *::before, .bsa *::after { box-sizing: border-box; }
.bsa a:focus-visible, .bsa summary:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.bsa-wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gut); }
.bsa p { margin: 0; }
.bsa h1, .bsa h2, .bsa h3 { text-transform: none; }
.bsa-h2 { margin: 0; font: 800 clamp(26px, 3.2vw, 42px)/1.06 var(--sans); font-variation-settings: "wdth" 115; letter-spacing: -.01em; color: inherit; text-align: start; text-wrap: balance; }
.bsa-h2 span, .bsa-docs__title span { color: var(--red); }
.bsa-sec--dark .bsa-h2 span { color: #ff4d4a; }
.bsa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 54px; padding: 0 26px; border-radius: 10px; font: 700 16px var(--sans); text-decoration: none; white-space: nowrap; transition: background .15s, color .15s, border-color .15s, filter .15s; }
.bsa-btn svg { width: 20px; height: 20px; }
.bsa-btn--red { background: var(--red); color: #fff; }
.bsa-btn--red:hover { background: var(--red-d); color: #fff; }
.bsa-btn--wa { background: var(--wa); color: #fff; }
.bsa-btn--wa:hover { filter: brightness(1.07); color: #fff; }
.bsa-btn--ghost { border: 1.5px solid rgba(255,255,255,.5); color: #fff; }
.bsa-btn--ghost:hover { border-color: #fff; color: #fff; }
.bsa-link { font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 5px; white-space: nowrap; }
.bsa-link:hover { color: var(--red); }
.bsa-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 32px; margin-bottom: 28px; }
.bsa-head__text { max-width: 760px; margin-top: 10px !important; font-family: var(--serif); font-size: 16px; line-height: 1.55; color: var(--mut); }
.bsa-sec { padding: 80px 0; }
.bsa-sec--white { background: #fff; }
.bsa-sec--dark { background: var(--ink); color: #fff; }
.bsa-badge { display: inline-flex; align-items: center; height: 28px; margin-inline-end: 12px; padding: 0 12px; border-radius: 14px; background: var(--red); color: #fff; font: 800 12px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; vertical-align: middle; }
.bsa-badge--dark { background: var(--ink); }

/* шапка на фото (как в первом варианте), текст — вверху, сразу под крошками, чтобы не закрывать машину */
.bsa-hero { position: relative; isolation: isolate; display: flex; flex-direction: column; min-height: clamp(600px, 82vh, 800px); background: var(--ink); color: #fff; overflow: hidden; box-shadow: 0 -16px 0 var(--ink); }
.bsa-hero picture { position: absolute; inset: 0; z-index: -2; }
.bsa-hero__img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 60% 70%; }
.bsa-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg, rgba(35,31,32,.6) 0%, rgba(35,31,32,.25) 34%, rgba(35,31,32,0) 60%), linear-gradient(180deg, rgba(35,31,32,.85) 0%, rgba(35,31,32,.5) 30%, rgba(35,31,32,0) 52%); }
.bsa-hero > .bsa-wrap { width: 100%; }
.bsa-hero__crumbs { position: relative; padding-top: 18px; }
.bsa .bsa-hero .breadcrumbs { margin: 0; padding: 0; }
.bsa .bsa-hero .breadcrumbs, .bsa .bsa-hero .breadcrumbs * { color: rgba(255,255,255,.85) !important; font-family: var(--sans) !important; font-size: 14px !important; }
.bsa-hero__in { position: relative; padding-top: 36px; padding-bottom: 48px; }
.bsa-hero__eyebrow { margin: 0 0 14px !important; font: 700 14px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.85); }
.bsa .bsa-hero__title { max-width: 860px; margin: 0 0 22px; color: #fff; text-align: start; font: 800 clamp(36px, 5vw, 68px)/1 var(--sans); font-variation-settings: "wdth" 116; letter-spacing: -.015em; text-wrap: balance; }
.bsa-perks { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px !important; padding: 0 !important; list-style: none; }
.bsa-perks li { display: inline-flex; align-items: center; gap: 8px; height: 36px; margin: 0; padding: 0 14px; border: 1px solid rgba(255,255,255,.28); border-radius: 18px; background: rgba(35,31,32,.45); backdrop-filter: blur(4px); font-size: 14px; font-weight: 600; color: #fff; }
.bsa-perks li::before { content: ""; width: 14px; height: 14px; flex: none; background: var(--red); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12.5l5 5L20 6.5' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12.5l5 5L20 6.5' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.bsa-hero__btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* Rent-to-Own: короткий заголовок — блок ниже от шапки, заголовок крупнее, пункты столбиком слева от машины */
.bsa--rto .bsa-hero__in { padding-top: clamp(48px, 10vh, 110px); }
.bsa--rto .bsa-hero__title { font-size: clamp(44px, 5.4vw, 78px); margin-bottom: 26px; }
.bsa--rto .bsa-perks { flex-direction: column; align-items: flex-start; }

/* завершённая акция */
.bsa--ended .bsa-hero__img { filter: grayscale(.9) brightness(.85); }
.bsa--ended .bsa-perks li { opacity: .7; }
/* лента «Promotion ended» — широкая полоса через всё фото (текста на фото нет, заголовок она не закрывает) */
.bsa-tape { position: absolute; top: 66%; left: 50%; z-index: 0; width: 170%; padding: 18px 0; border-block: 3px solid var(--red); background: var(--ink); color: #fff; transform: translate(-50%, -50%) rotate(-11deg); overflow: hidden; white-space: nowrap; text-align: center; font: 800 clamp(18px, 2vw, 28px)/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; box-shadow: 0 18px 40px rgba(0,0,0,.45); pointer-events: none; }
.bsa-tape span { display: inline-block; }
[dir="rtl"] .bsa-tape { transform: translate(50%, -50%) rotate(11deg); left: auto; right: 50%; }
.bsa-endnote { padding: 44px 0 64px; }
.bsa-endnote__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 4px; margin-bottom: 36px; padding: 18px 22px; border: 1px solid var(--line); border-inline-start: 4px solid var(--red); border-radius: 12px; background: var(--tint); }
.bsa-endnote__head p { font-family: var(--serif); font-size: 17px; line-height: 1.5; color: #3d3637; }
.bsa-endnote .bsa-h2 { margin-bottom: 24px; }

/* карточки акций */
.bsa-h2 + .bsa-offers { margin-top: 26px; }
.bsa-offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.bsa-offer { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); text-decoration: none; transition: box-shadow .2s, border-color .2s; }
.bsa-offer:hover { border-color: #cfc7c8; box-shadow: 0 12px 30px rgba(35,31,32,.1); color: var(--ink); }
.bsa-offer__img { aspect-ratio: 16 / 9; overflow: hidden; background: var(--tint); }
.bsa-offer__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.bsa-offer:hover .bsa-offer__img img { transform: scale(1.04); }
.bsa-offer.is-ended .bsa-offer__img img { filter: grayscale(1); }
.bsa-offer__body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 18px 20px 20px; }
.bsa-offer__body small { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.bsa-offer__body b { font-size: 19px; line-height: 1.25; }
.bsa-offer__go { margin-top: auto; padding-top: 8px; font-size: 14px; font-weight: 700; color: var(--mut); }
.bsa-offer:hover .bsa-offer__go { color: var(--red); }

/* машины */
.bsa-cars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.bsa-car { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.bsa-car__img { position: relative; display: block; aspect-ratio: 16 / 11; overflow: hidden; background: var(--tint); }
.bsa-car__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
a.bsa-car__img:hover img { transform: scale(1.04); }
.bsa-car__off { position: absolute; top: 12px; inset-inline-start: 12px; padding: 5px 10px; border-radius: 8px; background: var(--red); color: #fff; font: 800 14px/1 var(--sans); }
.bsa-car__body { display: flex; flex-direction: column; flex: 1; padding: 16px 16px 16px; }
.bsa .bsa-car__name { margin: 0 0 10px; font: 700 18px/1.25 var(--sans); color: var(--ink); }
.bsa-car__name a { color: inherit; text-decoration: none; }
.bsa-car__name a:hover { color: var(--red); }
.bsa-car__name span { font-weight: 500; color: var(--mut2); font-size: 14px; }
.bsa .bsa-car__specs { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 14px; padding: 0; list-style: none; }
.bsa-car__specs li { margin: 0; padding: 3px 8px; border-radius: 6px; background: var(--tint); font-size: 12px; line-height: 1.4; color: var(--mut); }
.bsa-car__price { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); line-height: 1.25; }
.bsa-car__price s { display: block; margin-bottom: 2px; color: var(--mut2); font-size: 14px; text-decoration-thickness: 1.5px; }
.bsa-car__price s .js-price { font-weight: 500; }
.bsa-car__now { display: block; font-size: 15px; color: var(--mut); }
.bsa-car__now .js-price { font-size: 22px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.bsa--ended .bsa-car__now .js-price { color: var(--ink); }
.bsa-car__price small { display: block; margin-top: 2px; font-size: 13px; color: var(--mut); }
.bsa-car__btns { display: flex; gap: 6px; margin-top: 14px; }
.bsa-car__btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: 9px; font: 700 14px var(--sans); text-decoration: none; transition: filter .15s, background .15s, color .15s; }
.bsa-car__btn svg { width: 18px; height: 18px; }
.bsa-car__btn--wa { flex: 1; background: var(--wa); color: #fff; }
.bsa-car__btn--wa:hover { filter: brightness(1.07); color: #fff; }
.bsa-car__btn--icon { width: 42px; flex: none; border: 1px solid var(--line); color: var(--ink); }
.bsa-car__btn--icon:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* как это работает */
.bsa-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 32px 0 0 !important; padding: 0; list-style: none; counter-reset: none; }
.bsa-steps li { position: relative; margin: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: rgba(255,255,255,.04); }
.bsa-steps__img { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.bsa-steps__img img { width: 100%; height: 100%; object-fit: cover; }
.bsa-steps__num { position: absolute; top: 14px; inset-inline-start: 14px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff; font: 800 18px/1 var(--sans); }
.bsa-steps b { display: block; padding: 20px 22px 6px; font-size: 20px; line-height: 1.25; }
.bsa-steps p { padding: 0 22px 24px; font-family: var(--serif); font-size: 16px; line-height: 1.55; color: rgba(255,255,255,.74); }

/* условия и документы */
.bsa-terms { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.bsa-dl { margin: 24px 0 0; border-top: 1px solid var(--line); }
.bsa-dl div { display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.bsa-dl dt { font-weight: 700; color: var(--ink); }
.bsa-dl dd { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.55; color: #3d3637; }
.bsa-docs { padding: 26px 26px 10px; border-radius: 16px; background: var(--ink); color: #fff; }
.bsa .bsa-docs__title { margin: 0 0 18px; font: 800 22px/1.2 var(--sans); color: #fff; }
.bsa-docs__group { margin-bottom: 18px; }
.bsa-docs__group b { display: block; margin-bottom: 8px; font-size: 16px; color: #fff; }
.bsa .bsa-docs__group ul { margin: 0; padding: 0; list-style: none; }
.bsa-docs__group li { position: relative; margin: 0 0 6px; padding-inline-start: 18px; font-size: 15px; line-height: 1.45; color: rgba(255,255,255,.78); }
.bsa-docs__group li::before { content: ""; position: absolute; inset-inline-start: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }

/* FAQ */
.bsa-faq { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 64px; align-items: start; }
.bsa-q { border-bottom: 1px solid var(--line); }
.bsa-q:first-child { border-top: 1px solid var(--line); }
.bsa-q__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 20px 4px; cursor: pointer; list-style: none; }
.bsa-q__head::-webkit-details-marker { display: none; }
.bsa .bsa-q__title { margin: 0; font: 700 18px/1.35 var(--sans); color: var(--ink); }
.bsa-q[open] .bsa-q__title, .bsa-q__head:hover .bsa-q__title { color: var(--red); }
.bsa-q__icon { position: relative; flex: none; width: 30px; height: 30px; border: 1.5px solid var(--line); border-radius: 50%; }
.bsa-q__icon::before, .bsa-q__icon::after { content: ""; position: absolute; inset-inline-start: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px; background: var(--ink); transition: transform .2s; }
.bsa-q__icon::after { transform: rotate(90deg); }
.bsa-q[open] .bsa-q__icon::after { transform: rotate(0); }
.bsa-q__body { padding: 0 48px 22px 4px; font-family: var(--serif); font-size: 17px; line-height: 1.6; color: #3d3637; }

@media (max-width: 1100px) {
  .bsa-cars { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .bsa-cars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bsa-steps { grid-template-columns: 1fr; }
  .bsa-steps li { display: grid; grid-template-columns: 38% minmax(0, 1fr); align-items: center; }
  .bsa-steps__img { aspect-ratio: auto; height: 100%; grid-row: 1 / span 2; }
  .bsa-steps b { padding: 18px 18px 4px; font-size: 18px; }
  .bsa-steps p { padding: 0 18px 18px; font-size: 15px; }
  .bsa-steps__num { width: 34px; height: 34px; font-size: 16px; }
  .bsa-terms, .bsa-faq { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 700px) {
  .bsa-hero { min-height: max(680px, 100svh); }
  .bsa-hero::after { background: linear-gradient(180deg, rgba(35,31,32,.92) 0%, rgba(35,31,32,.6) 28%, rgba(35,31,32,0) 44%), linear-gradient(0deg, rgba(35,31,32,.95) 0%, rgba(35,31,32,.7) 24%, rgba(35,31,32,0) 44%); }
  .bsa-hero__img { object-position: 50% 55%; }
  /* телефон: заголовок вверху, пункты и кнопки внизу, машина между ними */
  .bsa-hero__in { display: flex; flex: 1; flex-direction: column; justify-content: space-between; gap: 24px; padding-top: 28px; padding-bottom: 28px; }
  .bsa .bsa-hero__title, .bsa--rto .bsa-hero__title { margin-bottom: 0; font-size: clamp(30px, 8.6vw, 40px); }
  .bsa--rto .bsa-hero__in { padding-top: 28px; }
  .bsa-perks { margin-bottom: 18px !important; }
  .bsa-perks li { height: 32px; padding: 0 12px; font-size: 13px; }
  .bsa-hero__btns .bsa-btn { flex: 1 1 100%; }
  .bsa-tape { width: 220%; padding: 11px 0; border-block-width: 2px; font-size: 14px; }
  .bsa-sec { padding: 52px 0; }
  .bsa-cars { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .bsa-car { display: grid; grid-template-columns: 42% minmax(0, 1fr); }
  .bsa-car__img { aspect-ratio: auto; height: 100%; min-height: 150px; }
  .bsa-car__body { padding: 12px 12px 12px; }
  .bsa .bsa-car__name { font-size: 16px; margin-bottom: 8px; }
  .bsa .bsa-car__specs { display: none; }
  .bsa-car__price { padding-top: 8px; }
  .bsa-car__now .js-price { font-size: 19px; }
  .bsa-car__btns { margin-top: 10px; }
  .bsa-car__btn { height: 38px; }
  .bsa-car__btn--wa { font-size: 0; gap: 0; }
  .bsa-car__btn--wa svg { width: 20px; height: 20px; }
  .bsa-car__btn--icon { width: 38px; }
  .bsa-dl div { grid-template-columns: 1fr; gap: 4px; }
  .bsa-q__body { padding: 0 0 20px; font-size: 16px; }
  .bsa-head .bsa-link { white-space: normal; }
}
