/* ===========================================================
   Learnaroo Hub — Back-to-School countdown banner
   Fixed top bar, logged-out visitors only (body.lh-has-bts).
   Height reserved at first paint via --lh-bts-h → zero CLS.
   Brand: pink→orange marquee gradient, sunny-yellow CTA,
   Baloo 2 display face, glassy digit tiles.
   =========================================================== */
:root{ --lh-bts-h:52px }
@media(max-width:719px){ :root{ --lh-bts-h:48px } }

/* Reserve space + push the sticky purple header below the bar. */
body.lh-has-bts{ padding-top:var(--lh-bts-h) }
body.lh-has-bts header.site{ top:var(--lh-bts-h) !important }

#lh-bts{
  position:fixed; top:0; left:0; right:0; z-index:80;
  height:var(--lh-bts-h);
  color:#fff;
  background:linear-gradient(92deg,#C2255C 0%,#E0356A 30%,#E8590C 72%,#D9480F 100%);
  background-size:200% 100%;
  animation:lhBtsFlow 9s ease-in-out infinite;
  box-shadow:0 8px 24px rgba(120,20,60,.35);
  overflow:hidden;
}
/* glossy sheen sweeping across (mirrors header.site .nav:before) */
#lh-bts:before{
  content:""; position:absolute; top:0; bottom:0; left:-35%; width:26%;
  background:linear-gradient(105deg,transparent,rgba(255,255,255,.22),transparent);
  transform:skewX(-18deg); animation:lhBtsSheen 6s ease-in-out infinite; pointer-events:none;
}
/* sunny underline echoing the KS rainbow header accent */
#lh-bts:after{
  content:""; position:absolute; left:0; right:0; bottom:0; height:3px;
  background:linear-gradient(90deg,var(--yellow,#FFD23F),#FF8A3D,var(--yellow,#FFD23F));
  background-size:200% 100%; animation:lhBtsShimmer 5s linear infinite;
}
@keyframes lhBtsFlow{0%,100%{background-position:0 0}50%{background-position:100% 0}}
@keyframes lhBtsSheen{0%{left:-35%}30%,100%{left:130%}}
@keyframes lhBtsShimmer{to{background-position:200% 0}}

.lh-bts-in{
  position:relative; z-index:1; height:100%;
  display:flex; align-items:center; justify-content:center;
  gap:clamp(.45rem,1.6vw,1.1rem);
  padding:0 clamp(10px,3vw,28px);
  max-width:1340px; margin:0 auto;
  flex-wrap:nowrap; white-space:nowrap;
}

/* floating sparkles */
.lh-bts-spark i{
  position:absolute; width:7px; height:7px; background:#fff; opacity:0; pointer-events:none;
  clip-path:polygon(50% 0,59% 41%,100% 50%,59% 59%,50% 100%,41% 59%,0 50%,41% 41%);
  animation:lhBtsTwinkle 2.4s ease-in-out infinite;
}
.lh-bts-spark i:nth-child(1){left:6%;  top:18%}
.lh-bts-spark i:nth-child(2){left:22%; top:62%; width:5px;height:5px; animation-delay:.7s}
.lh-bts-spark i:nth-child(3){right:20%; top:14%; width:5px;height:5px; animation-delay:1.3s}
.lh-bts-spark i:nth-child(4){right:7%; top:58%; animation-delay:1.9s}
@keyframes lhBtsTwinkle{0%,100%{opacity:0;transform:scale(.3) rotate(0)}50%{opacity:.95;transform:scale(1) rotate(45deg)}}

.lh-bts-label{display:inline-flex; align-items:center; gap:.4rem; min-width:0}
.lh-bts-emoji{font-size:1.25rem; line-height:1; animation:lhBtsBob 1.8s ease-in-out infinite}
@keyframes lhBtsBob{0%,100%{transform:translateY(0) rotate(-4deg)}50%{transform:translateY(-3px) rotate(4deg)}}
.lh-bts-word{
  font-family:'Baloo 2',cursive,sans-serif; font-weight:800;
  font-size:clamp(.9rem,2.2vw,1.12rem); letter-spacing:.01em;
  text-shadow:0 2px 6px rgba(0,0,0,.25);
}

/* countdown tiles */
.lh-bts-timer{display:inline-flex; align-items:center; gap:.28rem}
.lh-bts-seg{
  display:inline-flex; flex-direction:column; align-items:center; justify-content:center;
  min-width:clamp(2.1rem,5.4vw,2.6rem); padding:.14rem .3rem .18rem;
  background:rgba(255,255,255,.16); border:1px solid rgba(255,255,255,.34);
  border-radius:10px; backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px);
  box-shadow:inset 0 -2px 0 rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.14);
}
.lh-bts-seg b{
  font-family:'Baloo 2',cursive,sans-serif; font-weight:800;
  font-size:clamp(.98rem,2.4vw,1.18rem); line-height:1;
  font-variant-numeric:tabular-nums; letter-spacing:.02em;
}
.lh-bts-seg small{font-size:.5rem; font-weight:800; text-transform:uppercase; letter-spacing:.09em; opacity:.9; line-height:1.25}
.lh-bts-c{font-family:'Baloo 2',sans-serif; font-weight:800; font-style:normal; opacity:.75; animation:lhBtsBlink 1s steps(1) infinite}
@keyframes lhBtsBlink{50%{opacity:.25}}

/* 20% OFF badge — sunny yellow, gentle wiggle */
.lh-bts-off{
  font-family:'Baloo 2',cursive,sans-serif; font-weight:800;
  font-size:clamp(.78rem,1.9vw,.92rem); letter-spacing:.04em;
  color:var(--yellow-ink,#5b4500); background:var(--yellow,#FFD23F);
  padding:.28rem .7rem; border-radius:999px;
  box-shadow:0 3px 0 var(--yellow-deep,#E0A700), 0 6px 14px rgba(0,0,0,.18);
  transform:rotate(-2deg); animation:lhBtsWiggle 3.2s ease-in-out infinite;
}
@keyframes lhBtsWiggle{0%,100%{transform:rotate(-2deg) scale(1)}50%{transform:rotate(2deg) scale(1.06)}}

/* CTA — compact pill, always clear of the bar edges */
.lh-bts-cta{
  display:inline-flex; align-items:center; gap:.35rem;
  font-family:'Baloo 2',cursive,sans-serif; font-weight:800;
  font-size:clamp(.74rem,1.7vw,.85rem); line-height:1;
  height:30px; padding:0 .85rem;
  color:var(--yellow-ink,#5b4500); background:var(--yellow,#FFD23F);
  border-radius:999px; text-decoration:none; white-space:nowrap;
  box-shadow:0 2px 0 var(--yellow-deep,#E0A700), 0 3px 8px rgba(0,0,0,.18);
  transition:transform .12s ease, box-shadow .2s ease;
  position:relative; overflow:hidden; flex:none; align-self:center;
  margin-block:4px; /* guaranteed breathing room inside the 52px bar */
}
.lh-bts-cta:before{
  content:""; position:absolute; top:2px; left:8px; right:8px; height:42%;
  background:linear-gradient(rgba(255,255,255,.5),rgba(255,255,255,0));
  border-radius:99px; pointer-events:none;
}
.lh-bts-cta:hover{transform:translateY(-1px); box-shadow:0 3px 0 var(--yellow-deep,#E0A700), 0 0 14px 2px rgba(255,210,63,.5); color:var(--yellow-ink,#5b4500)}
.lh-bts-cta:active{transform:translateY(1px); box-shadow:0 1px 0 var(--yellow-deep,#E0A700)}
.lh-bts-cta:focus-visible{outline:2px solid #fff; outline-offset:1px}

/* LIVE state (after zero): swap timer for celebration line */
.lh-bts-here{display:none; font-size:clamp(.85rem,2.2vw,1rem); font-weight:700}
.lh-bts-here b{font-family:'Baloo 2',cursive,sans-serif; font-weight:800}
#lh-bts.is-live .lh-bts-timer,
#lh-bts.is-live .lh-bts-in-word{display:none}
#lh-bts.is-live .lh-bts-here{display:inline}

/* compact steps down */
@media(max-width:719px){
  .lh-bts-seg small{display:none}
  .lh-bts-seg{min-width:1.9rem; padding:.16rem .26rem; border-radius:8px}
  .lh-bts-off{display:none}
}
@media(max-width:479px){
  .lh-bts-word .lh-bts-in-word{display:none}
  .lh-bts-word{font-size:.82rem}
  .lh-bts-cta{height:28px; padding:0 .65rem; font-size:.74rem}
  .lh-bts-in{gap:.4rem}
}
@media(max-width:359px){
  .lh-bts-word{display:none}
}

@media(prefers-reduced-motion:reduce){
  #lh-bts, #lh-bts:before, #lh-bts:after,
  .lh-bts-emoji, .lh-bts-off, .lh-bts-c, .lh-bts-spark i{animation:none !important}
  .lh-bts-spark i{opacity:.5}
}

@media print{ #lh-bts{display:none} body.lh-has-bts{padding-top:0} }
