/* EVA.UA checkout – блок «Оплата» за Figma «Checkout 3.0» → Payment methods.
 * Підключається після styles.css і перекриває базові стилі оплати, промокодів і підсумку.
 */

/* Proxima Nova без size-adjust: у базовому демо шрифт збільшено на 5%, через що тексти з макета
 * («Visa, MasterCard, Apple Pay, Google Pay», «Карткою Visa від ПриватБанку -7%») не влазять у рядок */
@font-face { font-family: ProximaNovaFigma; font-weight: 400; font-display: swap; src: url("https://eva.ua/nuxt_content/fonts/ProximaNova-Regular.woff2") format("woff2"); }
@font-face { font-family: ProximaNovaFigma; font-weight: 600; font-display: swap; src: url("https://eva.ua/nuxt_content/fonts/ProximaNova-Semibold.woff2") format("woff2"); }
@font-face { font-family: ProximaNovaFigma; font-weight: 700; font-display: swap; src: url("https://eva.ua/nuxt_content/fonts/ProximaNova-Bold.woff2") format("woff2"); }
.promo-banner, .payment, .promo, .sidebar, .sheet, .mobile-cta, .footer {
  font-family: ProximaNovaFigma, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
/* Сітка як у Figma: 752 контент + 48 + 448 підсумок */
@media (min-width: 1024px) { .layout { gap: 48px; } }

.pm-section-title { font-size: 16px; line-height: 20px; font-weight: 600; color: var(--text-primary); }
.payment { padding-top: 32px; }
.payment__list { gap: 16px; padding-top: 16px; }
.payment .field__error { padding-top: 0; }

/* ---------- Авторизований юзер: картка контактів (як на eva.ua) ---------- */
.contact-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: #fff; }
.contact-card__body > * + * { margin-top: 16px; }
.contact-card__name { font-size: 14px; line-height: 18px; font-weight: 600; color: #333; }
.contact-card__phone { display: flex; align-items: center; gap: 4px; font-size: 14px; line-height: 18px; color: #333; }
.contact-card__phone svg { width: 12px; height: 12px; flex-shrink: 0; }
.contact-card__edit { border: 0; background: none; padding: 0; font-size: 14px; line-height: 18px; color: var(--text-secondary); }
.contact-card__edit:hover { color: #333; }

/* ---------- Банер -7% (1_Banner_1448×112) ---------- */
.promo-banner { position: relative; height: 82px; margin-top: 32px; border-radius: var(--radius-md); background: #d5c9aa; overflow: hidden; }
.promo-banner__inner { position: absolute; left: 50%; top: 0; width: 325px; height: 82px; margin-left: -125px; }
.promo-banner__cards { position: absolute; left: 19.52px; top: 5px; width: 87.987px; height: 76px; object-fit: cover; }
.promo-banner__copy { position: absolute; left: 112.52px; top: 2px; width: 212px; height: 99px; padding: 10px 0; color: #333; }
.promo-banner__logos { position: relative; width: 132.909px; height: 17px; }
.promo-banner__visa { position: absolute; left: 0; top: 1.16px; width: 41.348px; height: 12.362px; }
.promo-banner__from { position: absolute; left: 45.98px; top: 6.38px; font-size: 7.727px; line-height: 9.273px; font-weight: 600; }
.promo-banner__raif { position: absolute; left: 61.43px; top: .39px; width: 51.027px; height: 13.129px; overflow: hidden; }
.promo-banner__raif img { position: absolute; display: block; }
.promo-banner__raif-a { left: 31.82%; top: .24%; width: 68.06%; height: 99.21%; }
.promo-banner__raif-b { left: .07%; top: 5.25%; width: 24%; height: 93.38%; }
.promo-banner__offer { position: absolute; left: 0; top: calc(50% + .5px); transform: translateY(-50%); display: flex; align-items: center; gap: 5.857px; white-space: nowrap; text-transform: uppercase; }
.promo-banner__offer b { font-size: 35.143px; line-height: 35.143px; font-weight: 700; }
.promo-banner__offer span { font-size: 11.714px; line-height: 16.107px; font-weight: 600; }

/* ---------- Нотифікація «Недоступні оплата…» ---------- */
.pm-notice { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border-radius: var(--radius-md); background: #fff3e8; font-size: 14px; line-height: 18px; color: var(--text-primary); }
.pm-notice img { flex-shrink: 0; }

/* ---------- Картка способу оплати ---------- */
.pm {
  display: flex; flex-direction: column;
  padding: 15px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); /* рамка входить у 16px, як inside-stroke у Figma */
  background: #fff; cursor: pointer; outline: none;
  transition: border-color .15s;
}
.pm:hover { border-color: var(--border-default); }
.pm:focus-visible, .pm-option:focus-visible, .plan__info:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text-primary); }
.pm--active, .pm--active:hover { border-color: var(--green); cursor: default; }
.pm--expanded { gap: 16px; padding-bottom: 7px; }
.pm__head { display: flex; gap: 12px; align-items: flex-start; }
.pm-radio, .pm-radio img { display: block; width: 20px; height: 20px; flex-shrink: 0; }
.pm__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pm__row { display: flex; gap: 8px; align-items: flex-start; }
.pm__icon { display: block; width: 20px; height: 20px; flex-shrink: 0; }
.pm__icon > img { display: block; }
.pm__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pm-title { font-size: 16px; line-height: 20px; font-weight: 600; letter-spacing: -.7px; color: var(--text-primary); }
[data-group="checkmo"] .pm-title { letter-spacing: 0; }
[data-group="card"] .pm-desc { letter-spacing: -.4px; }
.pm-desc { font-size: 14px; line-height: 18px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm--active .pm-desc { white-space: normal; }
.pm-desc--row { display: flex; gap: 6px; }
.pm-desc--row span:first-child { flex-shrink: 0; }
.pm-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-left: 28px; }
.pm-badge { display: inline-flex; align-items: center; min-height: 16px; padding: 0 6px; border-radius: var(--radius-sm); background: var(--bg-medium); font-size: 13px; line-height: 15px; color: var(--text-primary); }
.pm-badge--promo { flex-shrink: 0; background: #ffead5; white-space: nowrap; }
.pm-link { border: 0; background: none; padding: 0; font-size: 13px; line-height: 15px; color: var(--text-secondary); text-decoration: underline; }
.pm-link:hover { color: var(--text-primary); }

/* Вкладені варіанти (картки, Google/Apple Pay, держпрограми) */
.pm-options { display: flex; flex-direction: column; gap: 4px; }
/* border, а не 1px-заливка: при дробовому масштабі (125%) border прилипає до пікселя, і всі дільники однакові */
.pm-divider { height: 0; margin-left: 60px; border-top: 1px solid var(--border-default); }
.pm-option { display: flex; gap: 8px; align-items: flex-start; min-height: 52px; padding: 8px 0 8px 32px; border-radius: var(--radius-md); cursor: pointer; outline: none; }
.pm-option--single { align-items: center; }
.pm-option:hover .pm-option__title { text-decoration: underline; text-underline-offset: 2px; }
.pm-option__body { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: flex-start; }
.pm-option--single .pm-option__body { align-items: center; }
.pm-option__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pm-option__title { font-size: 14px; line-height: 18px; color: var(--text-primary); }
.pm-option__sub { font-size: 12px; line-height: 16px; color: var(--text-muted); }

/* Іконка «Дія» – шари Figma як є */
.ico-dia { position: relative; display: block; width: 20px; height: 20px; }
.ico-dia > * { position: absolute; display: block; }
.ico-dia__bg { top: -.95%; right: -.99%; bottom: -.98%; left: -.93%;
  -webkit-mask: url("assets/dia-mask.svg") .186px .189px / 20px 20px no-repeat; mask: url("assets/dia-mask.svg") .186px .189px / 20px 20px no-repeat; }
.ico-dia__bg img { display: block; width: 100%; height: 100%; }
.ico-dia__v1 { left: 61.52%; top: 40.11%; width: 17.15%; height: 20.64%; }
.ico-dia__v2 { left: 44.5%; top: 40.11%; width: 15.62%; height: 21.11%; }
.ico-dia__v3 { left: 50.85%; top: 32.25%; width: 5.78%; height: 5.21%; }
.ico-dia__v4 { left: 18.55%; top: 35.32%; width: 23.34%; height: 31.05%; }

/* Іконки банків у попапі розстрочки (24px) */
.ico-24 { position: relative; display: block; width: 24px; height: 24px; flex-shrink: 0; }
.ico-privat-parts > span { position: absolute; display: flex; align-items: center; justify-content: center; transform: translate(-50%, -50%); }
.ico-privat-parts img { display: block; transform: rotate(26.15deg); }
.ico-privat-parts__a { left: calc(50% + 1.88px); top: calc(50% + .44px); width: 27.128px; height: 27.912px; }
.ico-privat-parts__a img { width: 19.704px; height: 21.421px; }
.ico-privat-parts__b { left: calc(50% - 6.82px); top: calc(50% - 1.33px); width: 15.985px; height: 17.697px; }
.ico-privat-parts__b img { width: 10.71px; height: 14.457px; }
.ico-mono-parts > span { position: absolute; left: -2.61px; top: -2.4px; width: 28.383px; height: 28.383px; display: flex; align-items: center; justify-content: center; }
.ico-mono-parts img { display: block; width: 24px; height: 24px; object-fit: cover; transform: rotate(11.75deg); }

/* ---------- Промокоди / сертифікати (Widget account) ---------- */
.promo { padding-top: 32px; }
.promo__title { padding: 0 0 32px; }
.promo .card + .card { margin-top: 16px; }
.promo-card { padding: 15px; }
.promo-card .toggle-row__label { font-size: 16px; line-height: 20px; color: var(--text-primary); }
/* Tongle з Figma: вимкнений – сіра обвідка 1.5px і сірий кружок, увімкнений – як у базовому демо */
.promo-card .switch { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border-default); }
.promo-card .switch::after { background: var(--border-default); box-shadow: none; }
.promo-card .switch[aria-checked="true"] { background: var(--green-tint); box-shadow: none; }
.promo-card .switch[aria-checked="true"]::after { background: var(--green); }
/* Увімкнений стан: поле 48px і кнопка «Застосувати» 14px, неактивна – #595959 */
.promo-card .field__control { padding-top: 16px; }
.promo-card .input { height: 48px; padding: 12px; font-size: 14px; line-height: 18px; border-color: var(--border-default); }
.promo-card .input::placeholder { color: var(--text-muted); }
.promo-card .btn-apply { min-height: 38px; margin-top: 16px; padding: 10px 16px; font-size: 14px; line-height: 18px; background: var(--text-primary); }
.promo-card .btn-apply:hover:not(:disabled) { background: #000; }
.promo-card .btn-apply:disabled { background: #595959; color: var(--text-muted); opacity: 1; }

/* ---------- Підсумок (Total) ---------- */
/* без overflow: hidden – інакше тултіп «Гарантуємо безпеку платежів» обрізається рамкою;
 * кути сірого низу округлюємо самі */
.summary { overflow: visible; }
.summary__bottom { border-radius: 0 0 calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px); }
.summary__rows { padding: 16px; }
.summary__row { color: #333; }
.summary__row + .summary__row { padding-top: 8px; }
.summary__bottom { padding: 16px; }
.summary__total { align-items: center; height: 24px; font-size: 14px; line-height: 18px; color: #333; }
.summary__total b { font-size: 18px; line-height: 24px; }
.summary__cta { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 32px; }
.summary .btn-primary { font-size: 14px; line-height: 18px; }
.summary__terms { padding-top: 16px; font-size: 12px; line-height: 16px; }
.summary__logos { display: none; }

/* Посилання «Гарантуємо безпеку платежів» + тултіп */
.safety { position: relative; display: inline-flex; }
.safety__link { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; font-size: 13px; line-height: 16px; color: var(--text-secondary); }
.safety__link span { text-decoration: underline; text-underline-offset: 2px; }
.safety__link img { flex-shrink: 0; }
.safety__tip {
  position: absolute; z-index: 30; left: 50%; top: calc(100% + 8px); transform: translateX(-50%);
  width: 320px; padding: 16px; border-radius: var(--radius-md); background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.1), 0 2px 6px rgba(0,0,0,.06);
  font-size: 14px; line-height: 20px; color: var(--text-primary); text-align: left;
  opacity: 0; visibility: hidden; transition: opacity .15s, visibility .15s;
}
/* місток над тултіпом, щоб він не зникав, поки курсор переходить з посилання */
.safety__tip::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
/* Arrow з Figma: 12×8, по центру зверху */
.safety__tip::after {
  content: ""; position: absolute; left: 50%; top: -8px; width: 12px; height: 8px; margin-left: -6px;
  background: #fff; clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.safety__tip b { display: block; font-weight: 600; }
.safety:hover .safety__tip, .safety:focus-within .safety__tip { opacity: 1; visibility: visible; }

/* Логотипи платіжних систем */
.pay-logos { display: inline-flex; align-items: flex-start; gap: 16px; }
.pay-logos > img { display: block; width: 138px; height: 11px; }
.pay-logos__visa { position: relative; display: block; width: 98px; height: 14px; overflow: hidden; }
.pay-logos__visa img { position: absolute; left: 0; top: 0; width: 93.88%; height: 93.01%; }

/* Футер */
.footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; padding: 12px 32px; text-align: left; font-size: 13px; line-height: 16px; background: #f6f6f6; }

/* ---------- Модалка / шторка: «Оплата частинами», «Безпека платежів» ---------- */
.overlay--sheet { padding: 16px; }
.sheet { position: relative; width: 828px; max-width: 100%; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; background: #fff; border-radius: 16px; padding: 24px; }
.sheet--enter { animation: fade .15s ease-out; }
.sheet__head { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 -24px; padding: 0 24px 16px; border-bottom: 1px solid var(--border-default); }
.sheet__head--left { justify-content: flex-start; }
.sheet__title { font-size: 18px; line-height: 24px; font-weight: 600; color: #333; text-align: center; }
.sheet__head--left .sheet__title { flex: 1; text-align: left; }
.sheet__close { position: absolute; right: 16px; top: -8px; display: flex; border: 0; background: none; padding: 0; }
.sheet__head--left .sheet__close { position: static; }
.sheet__body { padding-top: 24px; }
.sheet--safety { width: 480px; }
.safety__p { font-size: 14px; line-height: 20px; color: var(--text-primary); }
.safety__p + .safety__p { padding-top: 20px; }

.parts__sum { display: none; padding-bottom: 16px; font-size: 16px; line-height: 20px; font-weight: 600; }
.parts__list { display: flex; flex-direction: column; gap: 24px; }
.plan {
  display: grid; grid-template-columns: 270px 144px 1fr 164px; align-items: center; column-gap: 24px;
  min-height: 72px; padding: 15px; border: 1px solid var(--border-default); border-radius: var(--radius-md); cursor: pointer;
}
.plan--active { border-color: var(--green); }
.plan__info { display: flex; align-items: center; gap: 16px; min-width: 0; outline: none; border-radius: 4px; }
.plan__brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.plan__text { display: flex; flex-direction: column; white-space: nowrap; }
.plan__title { font-size: 14px; line-height: 18px; font-weight: 600; color: var(--text-primary); }
.plan__meta { display: flex; gap: 6px; font-size: 13px; line-height: 15px; color: #333; }
.plan__free { color: #3c8042; }
.plan__select { position: relative; display: block; height: 40px; }
.plan__select select {
  width: 100%; height: 40px; padding: 0 44px 0 16px; appearance: none; -webkit-appearance: none;
  border: 1.5px solid var(--border-default); border-radius: var(--radius-md); background: #fff;
  font: inherit; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text-primary); cursor: pointer; outline: none;
}
.plan__select select:focus-visible { border-color: var(--text-primary); }
.plan__select img { position: absolute; right: 16px; top: 10px; pointer-events: none; }
.plan__price { justify-self: end; white-space: nowrap; font-size: 14px; line-height: 18px; font-weight: 600; color: var(--text-primary); }
.plan__price b { font-size: 18px; line-height: 24px; font-weight: 600; }
.plan__btn, .parts__save {
  display: flex; align-items: center; justify-content: center; height: 40px; padding: 10px 16px;
  border-radius: var(--radius-md); font-size: 14px; line-height: 18px; font-weight: 600;
}
.plan__btn { border: 0; background: var(--text-primary); color: #fff; }
.plan__btn:hover { background: #000; }
.parts__note { display: flex; gap: 8px; align-items: flex-start; padding-top: 24px; font-size: 13px; line-height: 15px; color: var(--text-primary); }
.parts__note img { flex-shrink: 0; }
.parts__note a { color: inherit; }
.parts__save { width: 100%; margin-top: 24px; border: 1.5px solid var(--text-primary); background: #fff; color: var(--text-primary); }
.parts__save:hover { background: var(--bg-subtle); }

/* ===================================================================== */
@media (max-width: 1023px) {
  /* колонка з align-items: flex-start інакше розтягується по однорядкових описах оплати */
  .content { width: 100%; }
  .summary__logos { display: block; padding-top: 16px; }
  .footer__logos { display: none; }
  .footer { justify-content: center; text-align: center; }
}

@media (max-width: 767px) {
  .payment { padding-top: 24px; }
  .promo-banner { margin-top: 24px; }
  .promo__title { padding-bottom: 24px; }
  .summary__cta { display: flex; }
  .summary__cta-spacer { display: none; }
  .summary__terms { text-align: left; }
  .footer { padding: 12px 16px calc(104px + env(safe-area-inset-bottom)); }
  .mobile-cta { padding-top: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .mobile-cta .btn-primary { font-size: 14px; line-height: 18px; }
  .safety--cta { display: flex; justify-content: center; padding-top: 8px; }
  .safety--cta .safety__link { font-size: 11px; line-height: 14px; }
  .safety--cta .safety__link img { width: 12px; height: 12px; }
  .safety--cta .safety__link span { text-decoration: none; }
  .safety__tip { display: none; }

  .overlay--sheet { align-items: flex-end; padding: 0; }
  .sheet { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 16px 16px 0 0; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
  .sheet--enter { animation: sheet-in .25s ease-out; }
  .sheet__head { margin: 0 -16px; padding: 0 16px 16px; }
  .sheet--safety { width: 100%; }
  .parts__sum { display: block; }
  .parts__list { gap: 16px; }
  .plan { grid-template-columns: 1fr auto; row-gap: 16px; column-gap: 16px; padding: 15px; }
  .plan__info { grid-column: 1 / -1; gap: 12px; align-items: flex-start; }
  .plan__brand { align-items: flex-start; }
  .plan__text { white-space: normal; }
  .plan__btn { grid-column: 1 / -1; }
  .plan__price { min-width: 108px; text-align: right; }
}
