/* SANTA+ abonēšanas baneris — v1.0
   Desktop: josla lapas apakšā, atveras līdz ~pusei ekrāna.
   Mobilais (<768px): kompakta josla VIRS apakšējās navigācijas, atveras kā bottom sheet.
   Krāsas maina šeit, :root mainīgajos. */

.spb {
  --spb-bg: #FDEEEC;
  --spb-fg: #111111;
  --spb-muted: #333333;
  --spb-accent: #E43136;
  --spb-tag-bg: #FFE500;
  --spb-tag-fg: #111111;
  --spb-card-bg: #FFFFFF;
  --spb-control-bg: rgba(0,0,0,.08);
  --spb-line: #F0D5D0;                /* plānas līnijas / rokturis */
  --spb-note: #555555;
  --spb-bottom-offset: 0px;           /* JS iestata = apakšējās navigācijas augstums (mobilajā) */
  --spb-z: 9990;                      /* virs lapas satura, zem cookie loga */
  --spb-font-sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --spb-font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-family: var(--spb-font-sans);
}
.spb[hidden] { display: none !important; }
.spb *, .spb *::before, .spb *::after { box-sizing: border-box; }

/* ---------- Panelis ---------- */
.spb-panel {
  position: fixed;
  left: 0; right: 0;
  bottom: var(--spb-bottom-offset);
  z-index: var(--spb-z);
  background: var(--spb-bg);
  color: var(--spb-fg);
  transform: translateY(0);
  transition: transform .3s ease;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}
.spb.is-entering .spb-panel,
.spb.is-away .spb-panel { transform: translateY(calc(100% + var(--spb-bottom-offset) + 20px)); }
@media (prefers-reduced-motion: reduce) { .spb-panel { transition: none; } }

.spb-scrim {
  display: none;
  position: fixed; inset: 0;
  z-index: calc(var(--spb-z) - 1);
  background: rgba(0,0,0,.5);
}

.spb-inner {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  height: 128px;
  padding: 0 96px 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.spb-handle { display: none; }
.spb-brand { display: contents; }
.spb-logo { display: block; height: 44px; width: auto; flex: 0 0 auto; }
.spb-divider { flex: 0 0 1px; width: 1px; height: 96px; background: var(--spb-fg); opacity: .3; }

.spb-copy { width: 420px; flex: 0 1 420px; display: flex; flex-direction: column; gap: 18px; }
.spb-title {
  margin: 0;
  font-family: var(--spb-font-serif);
  font-weight: 600; font-size: 28px; line-height: 1.15;
  color: var(--spb-fg);
}
.spb-desc { display: none; margin: 0; font-size: 17px; line-height: 1.5; color: var(--spb-muted); }

/* ---------- Pogas ---------- */
.spb-actions { display: flex; align-items: center; gap: 32px; flex: 0 0 auto; }
.spb-btn {
  font: inherit; cursor: pointer; border: 0;
  height: 48px; padding: 0 28px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  font-weight: 700; font-size: 18px; text-decoration: none;
}
.spb-btn--primary { min-width: 240px; background: var(--spb-accent); color: #FFFFFF; }
.spb-btn--primary:hover { filter: brightness(1.08); }
.spb-btn--ghost { padding: 0 20px; background: transparent; color: var(--spb-fg); border: 1.5px solid var(--spb-fg); font-weight: 600; }
.spb-btn--ghost:hover { background: rgba(0,0,0,.06); }
.spb-btn svg { width: 22px; height: 22px; flex: 0 0 auto; }

.spb-iconbtn {
  cursor: pointer; border: 0;
  width: 44px; height: 44px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--spb-control-bg); color: var(--spb-fg);
}
.spb-iconbtn svg { width: 22px; height: 22px; }
.spb-toggle { position: absolute; right: 32px; top: 50%; margin-top: -22px; }
.spb-toggle svg { transition: transform .2s ease; }
.spb.is-open .spb-toggle svg { transform: rotate(180deg); }
.spb-x { display: none; background: transparent; }

.spb :focus-visible { outline: 3px solid #111111; outline-offset: 3px; }

/* ---------- Tarifi (redzami tikai atvērtā stāvoklī) ---------- */
.spb-plans { display: none; width: 420px; flex: 0 0 420px; flex-direction: column; gap: 14px; margin: 0; border: 0; padding: 0; }
.spb-plans legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.spb-plan {
  position: relative;
  height: 60px; padding: 0 20px;
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--spb-fg); border-radius: 8px;
  background: var(--spb-card-bg); color: var(--spb-fg);
  font-size: 18px; cursor: pointer;
}
.spb-plan:has(input:checked) { border: 2px solid var(--spb-accent); }
.spb-plan input { width: 22px; height: 22px; margin: 0; accent-color: var(--spb-accent); flex: 0 0 auto; }
.spb-tag {
  position: absolute; top: -13px; right: 16px;
  padding: 4px 10px; border-radius: 3px;
  background: var(--spb-tag-bg); color: var(--spb-tag-fg);
  font-size: 14px; font-weight: 700;
}
.spb-plan-text { display: flex; flex-direction: column; gap: 2px; }
.spb-plan-note { font-size: 13px; color: var(--spb-note); }
.spb-submit { margin-top: 10px; height: 56px; width: 100%; font-size: 20px; }

/* ---------- Desktop: atvērts ---------- */
.spb.is-open .spb-inner {
  height: auto;
  min-height: min(450px, 60vh);
  padding: 40px 96px 40px 48px;
  gap: 40px;
}
.spb.is-open .spb-logo { align-self: flex-start; margin-top: 8px; }
.spb.is-open .spb-divider { height: auto; align-self: stretch; }
.spb.is-open .spb-copy { width: 460px; flex-basis: 460px; }
.spb.is-open .spb-title { font-size: 38px; line-height: 1.1; letter-spacing: -0.01em; }
.spb.is-open .spb-desc { display: block; }
.spb.is-open .spb-actions { display: none; }
.spb.is-open .spb-plans { display: flex; }
.spb.is-open .spb-toggle { top: 24px; margin-top: 0; }

/* Vidēji ekrāni: kompaktāk */
@media (max-width: 1200px) and (min-width: 768px) {
  .spb-inner { gap: 20px; padding: 0 84px 0 24px; }
  .spb-copy { width: 300px; flex-basis: 300px; }
  .spb-title { font-size: 22px; }
  .spb-actions { gap: 12px; }
  .spb-btn--primary { min-width: 0; }
  .spb.is-open .spb-inner { gap: 24px; padding: 32px 84px 32px 24px; }
  .spb.is-open .spb-copy { width: 340px; flex-basis: 340px; }
  .spb.is-open .spb-title { font-size: 30px; }
  .spb-plans { width: 360px; flex-basis: 360px; }
}

/* ---------- Mobilais ---------- */
@media (max-width: 767.98px) {
  /* Aizvērts: 84px josla virs apakšējās navigācijas */
  .spb-panel { box-shadow: 0 -4px 16px rgba(0,0,0,.12); }
  .spb-inner {
    height: 84px;
    padding: 0 12px 0 16px;
    gap: 10px;
    justify-content: flex-start;
  }
  .spb-handle {
    display: block; position: absolute; top: 6px; left: 50%;
    width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: #D9BDB8;
  }
  .spb-divider { display: none; }
  .spb-brand { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; cursor: pointer; }
  .spb-logo { height: 18px; align-self: flex-start; }
  .spb-copy { width: auto; flex: 1 1 auto; }
  .spb-title { font-family: var(--spb-font-sans); font-size: 13px; line-height: 1.3; font-weight: 500; }
  .spb-actions { gap: 0; }
  .spb-btn--primary { min-width: 0; height: 44px; padding: 0 18px; font-size: 15px; gap: 6px; }
  .spb-btn--primary svg { width: 16px; height: 16px; }
  .spb-x { display: inline-flex; }
  .spb-toggle { display: none; }

  /* Atvērts: bottom sheet, sedz arī navigāciju */
  .spb.is-open .spb-scrim { display: block; }
  .spb.is-open .spb-panel {
    bottom: 0;
    max-height: 85vh; max-height: 85dvh;
    border-radius: 20px 20px 0 0;
    box-shadow: none;
    display: flex; flex-direction: column;
    z-index: calc(var(--spb-z) + 1);
  }
  .spb.is-open .spb-inner {
    height: auto; min-height: 0;
    flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    padding: 24px 20px 0; gap: 14px;
  }
  .spb.is-open .spb-handle { top: 8px; }
  .spb.is-open .spb-brand { flex: 0 0 auto; gap: 14px; cursor: default; }
  .spb.is-open .spb-logo { height: 24px; margin-top: 4px; }
  .spb.is-open .spb-copy { width: auto; flex: 0 0 auto; }
  .spb.is-open .spb-title { font-family: var(--spb-font-serif); font-size: 28px; line-height: 1.12; font-weight: 600; letter-spacing: 0; }
  .spb.is-open .spb-desc { font-size: 15px; }
  .spb.is-open .spb-plans { width: 100%; flex: 0 0 auto; margin-top: 6px; }
  .spb-plan { height: 56px; padding: 0 16px; font-size: 16px; gap: 12px; }
  .spb-tag { top: -12px; right: 12px; padding: 3px 8px; font-size: 13px; }
  .spb.is-open .spb-submit {
    position: sticky; bottom: 0;
    margin: 6px -20px 0; width: calc(100% + 40px);
    height: auto; border-radius: 0;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    background: var(--spb-bg);
    border-top: 1px solid var(--spb-line);
  }
  .spb.is-open .spb-submit { display: block; }
  .spb.is-open .spb-submit > span {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    height: 52px; border-radius: 999px; background: var(--spb-accent); font-size: 18px;
  }
  .spb.is-open .spb-toggle { display: inline-flex; position: absolute; top: 12px; right: 8px; background: transparent; }
  .spb.is-open .spb-x { display: none; }

}

/* Desktop/tablet: submit poga ir pati poga (span bez fona) */
@media (min-width: 768px) {
  .spb-submit > span { display: inline-flex; align-items: center; gap: 12px; }
}
