/* ==========================================================================
   MOBILE STICKY BUY BAR: the sentence bar, docked to the bottom edge. Phones only (< 768px).
   "Rs. 15,000 lifetime Rs. 82,500 · ends 6d 23h 59m 59s", then "Pay with [Card] or [WhatsApp]".
   Show/hide: initStickyBuy in app.js. Other designs: design-backups/sticky-bars/ (repo root).
   ========================================================================== */

/* Live sale (countdown running) vs calm (evergreen, off, or deadline passed) */
html:not(.promo-sale) [data-when-live], html.promo-ended [data-when-live] { display: none !important; }
html.promo-sale:not(.promo-ended) [data-when-calm] { display: none !important; }

@media (max-width: 767px) {
  /* The container is only a positioned, transparent layer; the bar draws its own surface. */
  .sticky-buy {
    left: 0; right: 0; bottom: 0; display: block; padding: 0; gap: 0;
    background: none; border: 0; border-radius: 0; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none;
  }
  body:has(.sticky-buy) .footer { padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px)); }

  .sb15 { pointer-events: auto; }
  .sb-cards { flex: none; }   /* the two-cards icon carries its own colours */
  .sb-strike { font-weight: 450; color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(255, 107, 138, 0.9); }
  .sb-btn--card { color: #fff; background: linear-gradient(180deg, #6663ff 0%, #4a46f6 48%, #3b37e8 100%); border: 1px solid rgba(190, 188, 255, 0.35); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16); }
  .sb-btn--wa { color: #fff; background: linear-gradient(180deg, #0f7a45 0%, #0a5c33 55%, #07482a 100%); border: 1px solid rgba(130, 255, 190, 0.32); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); }

  /* Full ticking countdown: days, hours, minutes and seconds (style.css hides minutes + seconds in the sticky bar by default) */
  .sticky-buy .promo-countdown { font-size: inherit; }
  .sticky-buy .sb15 .promo-countdown__m, .sticky-buy .sb15 .promo-countdown__s { display: inline; }

  /* ---------- Sentence bar (docked) ---------- */
  .sb15 {
    position: relative; padding: 9px 12px calc(10px + env(safe-area-inset-bottom, 0px)); text-align: center;
    background: rgba(10, 6, 32, 0.95); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
    border-top: 1px solid var(--line-2); box-shadow: 0 -18px 40px -16px rgba(0, 0, 0, 0.8);
  }
  .sb15::before {
    content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(157, 154, 255, 0.75), transparent);
  }
  .sb15__price { padding-bottom: 8px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }   /* never wraps; overflow:hidden is only a safety net, initStickyFit (app.js) makes it fit */
  .sb15__price b { font-size: 15px; font-weight: 650; letter-spacing: -0.02em; color: #fff; }
  .sb15__price s { margin-left: 2px; }
  .sb15__pay { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
  .sb15__link {
    display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 16px; border-radius: 999px;
    font-size: 14px; font-weight: 600; color: #fff; -webkit-tap-highlight-color: transparent;
  }
  .sb15__link svg { width: 17px; height: 17px; flex: none; }
  .sb15__link:active { transform: scale(0.97); }
  .sb15__price { font-variant-numeric: tabular-nums; }
  .sb15__price .promo-countdown { font-size: 12px; font-weight: 600; letter-spacing: -0.01em; color: var(--mint); }

  /* Fit states, added one by one by initStickyFit in app.js ONLY while the price line is wider than the bar:
     seconds, then minutes, then the struck old price, then the word "ends". Never days or hours. */
  .sticky-buy .sb15.sb15--no-s .promo-countdown__s,
  .sticky-buy .sb15.sb15--no-m .promo-countdown__m { display: none; }
  .sticky-buy .sb15.sb15--no-was .sb-strike { display: none; }
  .sticky-buy .sb15.sb15--no-ends .sb15__ends-word { display: none; }

  /* ---------- Narrow phones ---------- */
  @media (max-width: 379px) {
    .sb15__price { font-size: 11.5px; }
    .sb15__price b { font-size: 14px; }
    .sb15__pay { gap: 6px; font-size: 12.5px; }
    .sb15__link { padding: 0 12px; gap: 6px; font-size: 13.5px; }
    .sb15__price { padding-bottom: 7px; }
  }
}
