/* =====================================================================
   Smart Promo Popup & Bar — front-end styles
   All colors come from CSS variables set inline per site (see spb_inline_css).
   Class names avoid "promo"/"popup"/"banner"/"ad" so ad-blocker cosmetic
   filters don't hide the elements.
   ===================================================================== */

/* ---------- Announcement bar ---------- */
.spb-bar {
  position: relative;
  z-index: 9990;
  color: var(--spb-bar-text, #fff);
  background: linear-gradient(90deg, var(--spb-bar-start, #073e6b), var(--spb-bar-end, #0b5cab));
  font-family: inherit;
}
.spb-bar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 9px 20px;
}
.spb-bar__text {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: inherit;
}
.spb-bar__spark { color: #ffd66b; }
.spb-bar__label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; opacity: .8; }
.spb-bar__timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}
.spb-bar__timer .spb-cd-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 30px;
  padding: 2px 6px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .16);
  line-height: 1;
}
.spb-bar__timer .spb-cd-box b { font-size: 13px; font-weight: 700; }
.spb-bar__timer .spb-cd-box small { font-size: 8px; text-transform: uppercase; opacity: .8; margin-top: 2px; }
.spb-bar__sep { opacity: .55; }
.spb-bar__timer.is-expired { display: none; }
.spb-bar__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  background: var(--spb-accent, #ff7a18);
  color: var(--spb-btn-text, #fff);
  transition: filter .15s ease, transform .15s ease;
}
.spb-bar__cta:hover { filter: brightness(1.06); transform: translateY(-1px); }

@media (max-width: 640px) {
  .spb-bar__inner { gap: 6px 12px; padding: 8px 14px; }
  .spb-bar__text { font-size: 12.5px; }
  .spb-bar__label { display: none; }
}

/* ---------- Modal (shared) ---------- */
.spb-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  font-family: inherit;
}
.spb-modal[hidden] { display: none; }
.spb-modal.is-open { opacity: 1; visibility: visible; }

.spb-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 20, 35, .6);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.spb-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border-radius: var(--spb-radius, 18px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  transform: translateY(18px) scale(.98);
  transition: transform .35s cubic-bezier(.2, .8, .3, 1);
}
.spb-modal.is-open .spb-modal__dialog { transform: none; }

body.spb-modal-open { overflow: hidden; }

.spb-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  color: #333;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease;
}
.spb-modal__close:hover { background: #fff; }

.spb-modal__hero {
  position: relative;
  padding: 30px 28px 24px;
  color: #fff;
  text-align: center;
  background: var(--spb-primary, #0b5cab);
}
.spb-modal__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.spb-modal__heading { margin: 0 0 8px; font-size: 26px; line-height: 1.15; font-weight: 800; color: var(--spb-heading, #fff); }
.spb-modal__sub { margin: 0; font-size: 14.5px; line-height: 1.5; opacity: .92; }

.spb-modal__timer { display: inline-flex; gap: 8px; margin-top: 16px; font-variant-numeric: tabular-nums; }
.spb-modal__timer .spb-cd-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 46px;
  padding: 8px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .16);
}
.spb-modal__timer .spb-cd-box b { font-size: 20px; line-height: 1; font-weight: 700; }
.spb-modal__timer .spb-cd-box small { font-size: 9px; text-transform: uppercase; opacity: .85; margin-top: 3px; }
.spb-modal__timer.is-expired { display: none; }

.spb-modal__body { padding: 22px 26px 26px; }

.spb-modal__price {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 15px;
  color: #33414f;
}
.spb-modal__price s { opacity: .55; }
.spb-modal__price .spb-label { color: #66727f; font-size: 13px; }
.spb-modal__price .spb-now { font-size: 24px; font-weight: 800; color: var(--spb-accent, #ff7a18); }

/* ---------- Form ---------- */
.spb-form { display: grid; gap: 10px; }
.spb-form__row { display: grid; gap: 10px; }
@media (min-width: 480px) { .spb-form__row--2 { grid-template-columns: 1fr 1fr; } }

.spb-form input,
.spb-form textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #d7dde5;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #1a2432;
  box-sizing: border-box;
}
.spb-form input:focus,
.spb-form textarea:focus {
  outline: none;
  border-color: var(--spb-primary, #0b5cab);
  box-shadow: 0 0 0 3px rgba(11, 92, 171, .15);
}
.spb-form input.is-invalid { border-color: #e5484d; }
.spb-form textarea { min-height: 72px; resize: vertical; }

.spb-form__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.spb-form__submit {
  margin-top: 2px;
  padding: 13px 18px;
  border: 0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: var(--spb-accent, #ff7a18);
  color: var(--spb-btn-text, #fff);
  transition: filter .15s ease;
}
.spb-form__submit:hover { filter: brightness(1.06); }
.spb-form__submit:disabled { opacity: .7; cursor: default; }

.spb-form__msg { display: none; margin: 2px 0 0; font-size: 13.5px; line-height: 1.4; }
.spb-form__msg.is-ok { display: block; color: #1a7f4b; }
.spb-form__msg.is-err { display: block; color: #c0362c; }

.spb-modal__note { margin: 12px 0 0; text-align: center; font-size: 13px; color: #66727f; }
.spb-modal__note a { color: var(--spb-primary, #0b5cab); }

@media (max-width: 520px) {
  .spb-modal__heading { font-size: 22px; }
  .spb-modal__hero { padding: 26px 22px 20px; }
  .spb-modal__body { padding: 20px 20px 22px; }
}

/* =====================================================================
   Design presets
   ===================================================================== */

/* --- Corner slide-in: small card, bottom-right, no dark overlay --- */
.spb-modal--corner { align-items: flex-end; justify-content: flex-end; padding: 20px; }
.spb-modal--corner .spb-modal__overlay { display: none; }
.spb-modal--corner .spb-modal__dialog { max-width: 360px; transform: translateY(28px); }
.spb-modal--corner.is-open .spb-modal__dialog { transform: none; }
.spb-modal--corner .spb-modal__hero { padding: 22px 22px 18px; }
.spb-modal--corner .spb-modal__heading { font-size: 21px; }
@media (max-width: 520px) {
  .spb-modal--corner { align-items: flex-end; justify-content: center; }
  .spb-modal--corner .spb-modal__dialog { max-width: 100%; }
}

/* --- Split: hero beside the body on wider screens --- */
.spb-modal--split .spb-modal__dialog { max-width: 780px; }
@media (min-width: 721px) {
  .spb-modal--split .spb-modal__dialog {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
  .spb-modal--split .spb-modal__hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    padding: 34px 30px;
  }
  .spb-modal--split .spb-modal__timer { align-self: flex-start; }
}

/* --- Spotlight: large centered, bigger hero --- */
.spb-modal--spotlight .spb-modal__dialog { max-width: 560px; }
.spb-modal--spotlight .spb-modal__hero { padding: 44px 34px 32px; }
.spb-modal--spotlight .spb-modal__heading { font-size: 32px; }
.spb-modal--spotlight .spb-modal__sub { font-size: 16px; }
@media (max-width: 520px) {
  .spb-modal--spotlight .spb-modal__heading { font-size: 24px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .spb-modal,
  .spb-modal__dialog,
  .spb-bar__cta { transition: none !important; }
}
