/* Нове вікно «Де купити» на сторінці товару (дизайн А. Печериці, завдання 0023).
   Блок «Еталон» — дослівно з листа; нижче «Адаптація» — лише те, чого вимагає шаблон сайту. */

/* ===== Еталон ===== */
.np-buy {
  --np-green: #00ae4d;
  --np-ink: #0e4d2b;
  --np-surface: #fafafa;
  --np-card: #ffffff;
  box-sizing: border-box;
  width: min(1120px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  margin: auto;
  padding: 40px 44px 44px;
  border: 0;
  border-radius: 0;
  background: var(--np-surface);
  color: var(--np-ink);
  font-family: Montserrat, Arial, sans-serif;
}
.np-buy::backdrop { background: rgba(21, 21, 21, 0.35); }
.np-buy *, .np-buy *::before { box-sizing: border-box; }

.np-buy__head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.np-buy__title { margin: 0; font-size: 35px; line-height: 1.2; font-weight: 600; letter-spacing: -0.03em; text-transform: uppercase; color: var(--np-ink); }
.np-buy__close { flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--np-ink); border-radius: 999px; background: transparent; color: var(--np-ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }

.np-buy__panels { display: flex; background: var(--np-card); }
.np-buy__panel { display: flex; flex-direction: column; min-width: 0; }
.np-buy__panel--store {
  flex: none; width: 560px; padding: 40px 88px 40px 40px;
  background: var(--np-green); color: var(--np-surface);
  clip-path: polygon(0 0, calc(100% - 44px) 0, 100% 50%, calc(100% - 44px) 100%, 0 100%);
}
.np-buy__panel--partners { flex: 1 1 0; padding: 40px 40px 40px 28px; color: var(--np-ink); }

.np-buy__tag {
  align-self: flex-start; display: inline-flex; align-items: center; height: 28px; padding: 0 22px 0 10px;
  color: var(--np-surface); font-size: 14px; line-height: 1.5; font-weight: 600;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
}
.np-buy__tag--dark { background: var(--np-ink); }
.np-buy__tag--green { background: var(--np-green); }

.np-buy__heading { margin: 20px 0 0; font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: 0.01em; text-transform: uppercase; color: inherit; }
.np-buy__price-label { margin-top: 24px; font-size: 14px; line-height: 1.4; font-weight: 500; }
.np-buy__figure { font-size: 50px; line-height: 1.2; font-weight: 600; }
.np-buy__stats { margin-top: 44px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.np-buy__stat-label { font-size: 18px; line-height: 1.5; font-weight: 500; letter-spacing: 0.01em; }

.np-buy__list { list-style: none; margin: 24px 0 32px; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 18px; line-height: 1.5; font-weight: 500; letter-spacing: 0.01em; }
.np-buy__list li { position: relative; padding-left: 34px; }
/* плюс 20×20, лінія 1.5px: колір тексту на зеленій панелі, зелений на білій */
.np-buy__list li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 20px; height: 20px;
  background:
    linear-gradient(currentColor, currentColor) center / 16px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 16px no-repeat;
}
.np-buy__panel--partners .np-buy__list li::before { color: var(--np-green); }

.np-buy__actions { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.np-buy__btn {
  display: inline-flex; align-items: center; justify-content: center; height: 60px; padding: 0 22px;
  border-radius: 999px; font-size: 18px; line-height: 1.5; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.np-buy__btn--light { background: var(--np-card); color: var(--np-ink); }
.np-buy__btn--dark { background: var(--np-ink); color: var(--np-surface); }
.np-buy__link {
  display: inline-flex; align-items: center; min-height: 44px; color: var(--np-ink);
  font-size: 16px; line-height: 1.5; font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px;
}
.np-buy__link:hover { color: var(--np-green); }
.np-buy__btn:focus-visible, .np-buy__close:focus-visible, .np-buy__link:focus-visible { outline: 3px solid var(--np-ink); outline-offset: 3px; }
.np-buy__btn--light:focus-visible { outline-color: var(--np-card); }

/* Мобільна версія: пропозиція, окремо не затверджена */
@media (max-width: 900px) {
  .np-buy { padding: 20px 16px 24px; }
  .np-buy__head { margin-bottom: 20px; }
  .np-buy__title { font-size: 25px; line-height: 1.1; letter-spacing: 0; }
  .np-buy__panels { flex-direction: column; }
  .np-buy__panel--store {
    width: auto; padding: 24px 20px 56px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 28px), 50% 100%, 0 calc(100% - 28px));
  }
  .np-buy__panel--partners { padding: 24px 20px; }
  .np-buy__heading { font-size: 20px; }
  .np-buy__figure { font-size: 40px; }
  .np-buy__stats { margin-top: 24px; }
  .np-buy__list, .np-buy__stat-label { font-size: 16px; }
  .np-buy__actions { align-items: stretch; }
  .np-buy__link { justify-content: center; }
}

/* ===== Адаптація під сайт ===== */
/* Браузери без <dialog> (Safari < 15.4, Firefox < 98, старі iPhone/iPad): закрите вікно інакше видно внизу сторінки товару. */
.np-buy:not([open]) { display: none; }
/* Приховані частини (зелена панель без пропозиції, ціна без числа) не займають місця:
   display:flex панелей інакше перекриває атрибут hidden. */
.np-buy [hidden] { display: none !important; }
/* «Магазини на мапі» та «Інтернет-магазини» — кнопки open-stores-map (відкривають список партнерів), не посилання:
   знімаємо типовий вигляд кнопки, решта — з еталону. */
.np-buy button.np-buy__btn, .np-buy button.np-buy__link { margin: 0; border: 0; font-family: inherit; cursor: pointer; }
.np-buy button.np-buy__link { padding: 0; background: none; }
/* Без зеленої панелі біла стоїть сама: лівий відступ як у правого краю, бо шеврона поруч немає. */
@media (min-width: 901px) {
  .np-buy__panel--store[hidden] + .np-buy__panel--partners, .np-buy__panel--partners:first-child { padding-left: 40px; }
}
