/* msab 2026-11-23 (im1): product card info modals «Система цін» (#popup_1) and «Сервіс» (#popup_2) — look only.
   The texts come unchanged from admin constants (nadpisi_na_sajti.sistema_cin / .servis); open/close stays jquery-modal.
   msab-info-modals.js only adds classes and wrappers (tiers list, value span) — no text is added or changed.
   Without the script the modals still get the card look below. Phones (<=560 px) get a bottom sheet.
   Scope: only #popup_1 / #popup_2 and their blocker. Rollback: remove the link/script lines in templates/product.html.
   Colours follow mobile-v2 / msab-auth tokens (teal #2bcbc3, teal text #1a9a93, navy #273445, ink #2b3442). */

/* ---------- 1. backdrop ---------- */
.jquery-modal.blocker.msab-im-blk,
.jquery-modal.blocker:has(> #popup_1), .jquery-modal.blocker:has(> #popup_2) { background-color: rgba(15, 23, 42, .55); padding: 20px; }

/* ---------- 2. card ---------- */
.jquery-modal .modal#popup_1, .jquery-modal .modal#popup_2 {
  width: 92%; max-width: 460px; padding: 22px 22px 20px; border-radius: 20px; background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .18), 0 2px 8px rgba(15, 23, 42, .08);
  box-sizing: border-box; text-align: left; color: #2b3442; font-family: MuseoSans, Arial, sans-serif;
  max-height: calc(100dvh - 40px); overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  animation: msabImIn .18s ease-out;
}
#popup_1 *, #popup_2 * { box-sizing: border-box; }

/* title row: soft icon + heading; right padding leaves room for the close button */
.jquery-modal .modal#popup_1 > .title, .jquery-modal .modal#popup_2 > .title {
  display: flex; align-items: center; gap: 12px; min-height: 40px; margin: 0 0 14px; padding-right: 48px;
  font-size: 22px; line-height: 1.25; font-weight: 800; color: #273445; letter-spacing: -.01em;
}
.jquery-modal .modal#popup_1 > .title::before, .jquery-modal .modal#popup_2 > .title::before {
  content: ""; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; background: #e9f8f7 no-repeat center / 22px 22px;
}
/* price tag */
.jquery-modal .modal#popup_1 > .title::before { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a9a93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.6 13.4l-7.2 7.2a2 2 0 0 1-2.8 0L3 13V3h10l7.6 7.6a2 2 0 0 1 0 2.8z'/%3E%3Ccircle cx='7.5' cy='7.5' r='1.5'/%3E%3C/svg%3E"); }
/* shield with tick */
.jquery-modal .modal#popup_2 > .title::before { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a9a93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E"); }

/* close button — same as the sign-in modal */
.jquery-modal .modal#popup_1 a.close-modal, .jquery-modal .modal#popup_2 a.close-modal {
  top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid #e6e9ee;
  background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23273445' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") no-repeat center / 16px 16px;
  text-indent: -9999px; overflow: hidden; transition: background-color .15s;
}
.jquery-modal .modal#popup_1 a.close-modal:hover, .jquery-modal .modal#popup_2 a.close-modal:hover { background-color: #f4f6f8; }
.jquery-modal .modal#popup_1 a.close-modal:focus-visible, .jquery-modal .modal#popup_2 a.close-modal:focus-visible { outline: 2px solid #2bcbc3; outline-offset: 2px; }

/* ---------- 3. text (baseline, works without the script) ---------- */
.jquery-modal .modal#popup_1 p, .jquery-modal .modal#popup_2 p { margin: 0 0 10px; font-size: 15px; line-height: 1.5; font-weight: 400; color: #2b3442; }
.jquery-modal .modal#popup_1 strong, .jquery-modal .modal#popup_2 strong { font-weight: 700; color: #273445; }
.jquery-modal .modal#popup_1 p a, .jquery-modal .modal#popup_2 p a { color: #1a9a93; font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.jquery-modal .modal#popup_1 p a:hover, .jquery-modal .modal#popup_2 p a:hover { color: #273445; }
.jquery-modal .modal#popup_1 p a:focus-visible, .jquery-modal .modal#popup_2 p a:focus-visible { outline: 2px solid #2bcbc3; outline-offset: 2px; border-radius: 4px; }
.jquery-modal .modal#popup_1 > p:last-child, .jquery-modal .modal#popup_2 > p:last-child { margin-bottom: 0; }

/* ---------- 4. «Система цін» (classes from msab-info-modals.js) ---------- */
#popup_1 .msab-im__lead { margin: 0 0 12px; font-size: 14px; line-height: 1.45; color: #6b7280; }
#popup_1 .msab-im__lead strong, #popup_1 .msab-im__lead u { font-weight: 600; color: #6b7280; text-decoration: none; }
#popup_1 .msab-im__tiers { display: grid; gap: 8px; margin: 0 0 12px; }
.jquery-modal .modal#popup_1 .msab-im__tier {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0;
  padding: 12px 14px; border: 1px solid #e6e9ee; border-radius: 12px; background: #fff;
}
#popup_1 .msab-im__tier > strong { font-size: 15px; font-weight: 700; color: #273445; }
#popup_1 .msab-im__sep { display: none; }
#popup_1 .msab-im__val { flex: 0 0 auto; padding: 4px 10px; border-radius: 999px; background: #e9f8f7; color: #157f79; font-size: 14px; font-weight: 700; white-space: nowrap; }
.jquery-modal .modal#popup_1 .msab-im__special { margin: 0 0 10px; padding: 12px 14px; border: 1px solid #c9eeeb; border-radius: 12px; background: #f3fbfa; font-size: 14px; }
.jquery-modal .modal#popup_1 .msab-im__note { margin: 0; padding: 12px 14px; border-radius: 12px; background: #f4f6f8; font-size: 14px; color: #3d4757; }
#popup_1 .msab-im__empty { display: none; }

/* ---------- 5. «Сервіс» ---------- */
.jquery-modal .modal#popup_2 > p:first-of-type { margin: 0 0 12px; font-size: 14px; color: #6b7280; }
.jquery-modal .modal#popup_2 > p:first-of-type strong { font-weight: 600; color: #6b7280; }
.jquery-modal .modal#popup_2 ol { list-style: none; counter-reset: msabIm; display: grid; gap: 8px; margin: 0; padding: 0; }
.jquery-modal .modal#popup_2 ol li {
  counter-increment: msabIm; position: relative; margin: 0; padding: 12px 14px 12px 52px; min-height: 50px;
  border: 1px solid #e6e9ee; border-radius: 12px; background: #fff; font-size: 15px; line-height: 1.45; color: #2b3442;
}
.jquery-modal .modal#popup_2 ol li::before {
  content: counter(msabIm); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: #e9f8f7; color: #157f79; font-size: 13px; font-weight: 800; line-height: 1;
}
.jquery-modal .modal#popup_2 ul { margin: 0 0 10px 20px; padding: 0; }
.jquery-modal .modal#popup_2 ul li { margin: 6px 0; font-size: 15px; line-height: 1.45; }

/* ---------- 6. phones: bottom sheet ---------- */
@media (max-width: 560px) {
  body .jquery-modal.blocker.msab-im-blk,
  body .jquery-modal.blocker:has(> #popup_1), body .jquery-modal.blocker:has(> #popup_2) { padding: 0; }
  .jquery-modal.blocker.msab-im-blk::before,
  .jquery-modal.blocker:has(> #popup_1)::before, .jquery-modal.blocker:has(> #popup_2)::before { vertical-align: bottom; }
  .jquery-modal .modal#popup_1, .jquery-modal .modal#popup_2 {
    width: 100%; max-width: none; vertical-align: bottom; border-radius: 20px 20px 0 0;
    padding: 26px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 40px); animation-name: msabImUp; animation-duration: .22s;
    box-shadow: 0 -8px 30px rgba(15, 23, 42, .18);
  }
  /* grab handle */
  .jquery-modal .modal#popup_1::before, .jquery-modal .modal#popup_2::before {
    content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: #d9dee5;
  }
  .jquery-modal .modal#popup_1 > .title, .jquery-modal .modal#popup_2 > .title { font-size: 20px; margin-bottom: 12px; }
  .jquery-modal .modal#popup_1 > .title::before, .jquery-modal .modal#popup_2 > .title::before { flex-basis: 36px; width: 36px; height: 36px; border-radius: 10px; background-size: 20px 20px; }
  .jquery-modal .modal#popup_1 a.close-modal, .jquery-modal .modal#popup_2 a.close-modal { top: 22px; right: 14px; width: 40px; height: 40px; }
  .jquery-modal .modal#popup_1 .msab-im__tier { padding: 11px 12px; }
  .jquery-modal .modal#popup_2 ol li { padding: 11px 12px 11px 48px; }
  .jquery-modal .modal#popup_2 ol li::before { left: 12px; top: 11px; }
}
@media (max-width: 340px) {
  .jquery-modal .modal#popup_1 .msab-im__tier { flex-wrap: wrap; gap: 6px; }
}

@keyframes msabImIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes msabImUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .jquery-modal .modal#popup_1, .jquery-modal .modal#popup_2 { animation: none; }
}
