/* ═══════════════════════════════════════════════════════════════
   HariyaliBasket — Hero "Mandi Ticket" (v4.23.0)
   template-parts/hero-ticket.php. Cream = roz, Golden = festival
   (Customizer → 🎫 HB Hero Ticket). Sirf .hb-tk-* classes — baaki hero
   (.hb-hv2-*) ko nahi chhuta.
   ═══════════════════════════════════════════════════════════════ */

.hb-tk-wrap{
  --tk-ink:   #0d3320;
  --tk-page:  #0d3320;              /* notch = hero ka background */
  --tk-body:  #fdf6e3;
  --tk-muted: #8a6b2d;
  --tk-acc:   #25834f;
  --tk-chip:  #ffffff;
  --tk-chipl: #eadfbf;
  --tk-perf:  #c9b88c;
  --tk-stub:  #f59e0b;
  --tk-stubi: #0d3320;
  --tk-stubm: #6b3d00;
  max-width: 520px;
  margin: 0 auto 14px;
  font-family: 'Nunito', system-ui, sans-serif;
}
.hb-tk--golden{
  --tk-body:  linear-gradient(110deg, #fde68a, #fbbf24, #fef3c7, #f59e0b, #fde68a);
  --tk-muted: #7a4a00;
  --tk-acc:   #0d3320;
  --tk-chip:  rgba(255,255,255,.75);
  --tk-chipl: rgba(122,74,0,.2);
  --tk-perf:  #a16207;
  --tk-stub:  #25834f;
  --tk-stubi: #ffffff;
  --tk-stubm: #fde68a;
}

/* ── Upar: headline + live dot ── */
.hb-tk-top{ display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 2px 10px; }
.hb-tk-h1{
  margin: 0; font-family: 'Sora', system-ui, sans-serif; font-weight: 800;
  font-size: 19px; line-height: 23px; color: #ffffff; letter-spacing: -.01em;
}
.hb-tk-h1 em{ font-style: normal; color: #f59e0b; }
.hb-tk-sr{ position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hb-tk-live{
  flex-shrink: 0; height: 24px; padding: 0 9px; border-radius: 999px;
  background: rgba(77,218,133,.14); color: #4dda85;
  font-size: 11px; font-weight: 900; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.hb-tk-live i{ width: 7px; height: 7px; border-radius: 50%; background: #4dda85; animation: hbTkPulse 1.8s ease-out infinite; }
.hb-tk-wrap.is-past .hb-tk-live{ background: rgba(245,158,11,.16); color: #f59e0b; }
.hb-tk-wrap.is-past .hb-tk-live i{ background: #f59e0b; }
@keyframes hbTkPulse{ 0%,100%{ box-shadow: 0 0 0 0 rgba(77,218,133,.6); } 70%{ box-shadow: 0 0 0 8px rgba(77,218,133,0); } }

/* ── Ticket ── */
.hb-tk{
  position: relative; display: flex; min-height: 196px;
  filter: drop-shadow(0 7px 0 #071a10);
  animation: hbTkBreathe 5s ease-in-out infinite;
}
@keyframes hbTkBreathe{ 0%,100%{ transform: translateY(0) rotate(-.5deg); } 50%{ transform: translateY(-3px) rotate(.35deg); } }

.hb-tk-body{
  position: relative; flex: 1; min-width: 0; overflow: hidden;
  border-radius: 18px 0 0 18px;
  background: var(--tk-body);
  padding: 12px 12px 12px 16px; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 6px;
  color: var(--tk-ink);
}
.hb-tk--golden .hb-tk-body{ background-size: 200% 100%; animation: hbTkFoil 6s linear infinite; }
@keyframes hbTkFoil{ 0%{ background-position: 0% 50%; } 100%{ background-position: 200% 50%; } }

.hb-tk-holo{
  position: absolute; top: 0; bottom: 0; left: 0; width: 26%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), rgba(77,218,133,.25), rgba(245,158,11,.25), transparent);
  animation: hbTkHolo 4.5s ease-in-out infinite;
}
@keyframes hbTkHolo{ 0%{ transform: translateX(-140%) skewX(-18deg); } 55%,100%{ transform: translateX(420%) skewX(-18deg); } }

.hb-tk-row{ display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; }
.hb-tk-brand{ font-size: 10px; font-weight: 900; letter-spacing: .12em; color: var(--tk-muted); white-space: nowrap; }
.hb-tk-date{ font-family: 'Sora', system-ui, sans-serif; font-size: 10px; font-weight: 800; color: var(--tk-muted); white-space: nowrap; }

.hb-tk-ends{ align-items: flex-end; margin-top: 2px; }
.hb-tk-end{ display: flex; flex-direction: column; line-height: 15px; min-width: 0; }
.hb-tk-end-r{ text-align: right; }
.hb-tk-end small{ font-size: 9.5px; font-weight: 900; color: var(--tk-muted); }
.hb-tk-end b{ font-family: 'Sora', system-ui, sans-serif; font-size: 16px; font-weight: 800; color: var(--tk-ink); white-space: nowrap; }
.hb-tk-end i{ font-style: normal; font-size: 11.5px; font-weight: 900; color: var(--tk-acc); white-space: nowrap; }

/* route: Mandi → chhantai → ghar */
.hb-tk-route{ position: relative; height: 32px; }
.hb-tk-track, .hb-tk-fill{ position: absolute; left: 6px; right: 6px; top: 11px; height: 3px; border-radius: 3px; }
.hb-tk-track{ background: repeating-linear-gradient(90deg, #c9bf9f 0 7px, transparent 7px 13px); }
.hb-tk-fill{ background: var(--tk-acc); transform-origin: 0 50%; animation: hbTkFill 6s cubic-bezier(.6,0,.4,1) infinite; }
.hb-tk-stop{ position: absolute; top: 6px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #ffffff; box-sizing: border-box; background: #d6cfb8; }
.hb-tk-s1{ left: 0; background: #25834f; }
.hb-tk-s2{ left: 50%; margin-left: -6.5px; animation: hbTkS2 6s infinite; }
.hb-tk-s3{ right: 0; animation: hbTkS3 6s infinite; }
.hb-tk-midl{ position: absolute; left: 50%; top: 21px; transform: translateX(-50%); font-size: 9.5px; font-weight: 900; color: #a39a80; white-space: nowrap; animation: hbTkL2 6s infinite; }
.hb-tk-van{
  position: absolute; top: -2px; left: 0; width: 26px; height: 24px; border-radius: 7px;
  background: #0d3320; display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1;
  box-shadow: 0 2px 0 rgba(0,0,0,.25);
  animation: hbTkVan 6s cubic-bezier(.6,0,.4,1) infinite;
}
@keyframes hbTkVan{ 0%,6%{ left: 0; } 40%,50%{ left: calc(50% - 13px); } 84%,100%{ left: calc(100% - 26px); } }
@keyframes hbTkFill{ 0%,6%{ transform: scaleX(0); } 40%,50%{ transform: scaleX(.5); } 84%,100%{ transform: scaleX(1); } }
@keyframes hbTkS2{ 0%,38%{ background: #d6cfb8; transform: scale(1); } 42%{ transform: scale(1.5); } 46%,100%{ background: #25834f; transform: scale(1); } }
@keyframes hbTkS3{ 0%,82%{ background: #d6cfb8; transform: scale(1); } 86%{ transform: scale(1.5); } 90%,100%{ background: #25834f; transform: scale(1); } }
@keyframes hbTkL2{ 0%,38%{ color: #a39a80; } 46%,100%{ color: #0d3320; } }

/* aaj ke yatri */
.hb-tk-yatri{ justify-content: flex-start; margin-top: 4px; }
.hb-tk-ylbl{ flex-shrink: 0; font-size: 9.5px; font-weight: 900; letter-spacing: .08em; line-height: 11px; color: var(--tk-muted); }
.hb-tk-ywin{
  flex: 1; min-width: 0; overflow: hidden;
  -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.hb-tk-marq{ display: flex; width: max-content; animation: hbTkMarq 16s linear infinite; }
.hb-tk-set{ display: flex; gap: 6px; padding-right: 6px; }
@keyframes hbTkMarq{ 0%{ transform: translateX(0); } 100%{ transform: translateX(-50%); } }
.hb-tk-chip{
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px 0 2px;
  border-radius: 999px; background: var(--tk-chip); border: 1px solid var(--tk-chipl); white-space: nowrap;
}
.hb-tk-chip img, .hb-tk-chip-e{
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid #ffffff; box-sizing: border-box;
  object-fit: cover; display: block; flex-shrink: 0;
}
.hb-tk-chip-e{ display: flex; align-items: center; justify-content: center; font-size: 13px; background: #eaf6ee; }
.hb-tk-chip b{ font-size: 11px; font-weight: 900; color: #0d3320; }
.hb-tk-chip b span{ font-family: 'Sora', system-ui, sans-serif; font-weight: 800; }

/* barcode + countdown */
.hb-tk-foot{ margin-top: auto; padding-top: 4px; }
.hb-tk-bar{
  flex: 0 1 96px; min-width: 40px; height: 22px; opacity: .75;
  background: repeating-linear-gradient(90deg, #0d3320 0 2px, transparent 2px 4px, #0d3320 4px 5px, transparent 5px 8px, #0d3320 8px 11px, transparent 11px 12px);
}
.hb-tk-cut{ display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 900; color: var(--tk-muted); white-space: nowrap; }
.hb-tk-cut b{ font-family: 'Sora', system-ui, sans-serif; font-size: 13px; font-weight: 800; color: #e2572b; font-variant-numeric: tabular-nums; }
.hb-tk-colon{ animation: hbTkTick 1s steps(1) infinite; }
@keyframes hbTkTick{ 0%,49%{ opacity: 1; } 50%,100%{ opacity: .25; } }

/* TAAZA mohar — van ghar pahunche tab */
.hb-tk-stamp{
  position: absolute; left: 24%; top: 86px; padding: 3px 10px; pointer-events: none;
  border: 3px solid #e2572b; border-radius: 9px; color: #e2572b; background: rgba(253,246,227,.6);
  font-family: 'Sora', system-ui, sans-serif; font-weight: 800; font-size: 17px; letter-spacing: .04em;
  opacity: 0; animation: hbTkStamp 6s infinite;
}
@keyframes hbTkStamp{ 0%,84%{ opacity: 0; transform: scale(2.4) rotate(-26deg); } 89%{ opacity: 1; transform: scale(.88) rotate(-14deg); } 92%,99%{ opacity: 1; transform: scale(1) rotate(-14deg); } 100%{ opacity: 0; } }

/* perforation + kainchi */
.hb-tk-perf{ position: relative; width: 0; margin: 12px 0; border-left: 3px dashed var(--tk-perf); }
.hb-tk-perf span{ position: absolute; left: -10px; top: 0; font-size: 15px; line-height: 1; animation: hbTkScis 3s ease-in-out infinite; }
@keyframes hbTkScis{ 0%,60%{ transform: translateY(-6px); opacity: 0; } 70%{ opacity: 1; } 100%{ transform: translateY(70px); opacity: 0; } }

/* stub = CTA */
.hb-tk-stub{
  position: relative; flex: 0 0 88px; width: 88px; margin: 0; border: 0; cursor: pointer;
  border-radius: 0 18px 18px 0; padding: 14px 6px 12px; box-sizing: border-box;
  background: var(--tk-stub); color: var(--tk-stubi);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center;
  font-family: inherit; -webkit-tap-highlight-color: transparent;
  transform-origin: 0 100%;
  animation: hbTkNudge 3s ease-in-out infinite;
  transition: transform .55s cubic-bezier(.5,-0.4,.6,1), opacity .55s ease;
}
@keyframes hbTkNudge{ 0%,70%,100%{ transform: rotate(0); } 76%{ transform: rotate(-4deg); } 82%{ transform: rotate(3deg); } 88%{ transform: rotate(-1.5deg); } }
.hb-tk-fare{ display: flex; flex-direction: column; font-size: 9.5px; font-weight: 900; letter-spacing: .04em; line-height: 12px; color: var(--tk-stubm); }
.hb-tk-fare b{ font-family: 'Sora', system-ui, sans-serif; font-size: 19px; line-height: 22px; font-weight: 800; color: var(--tk-stubi); }
.hb-tk-go{ font-family: 'Sora', system-ui, sans-serif; font-weight: 800; font-size: 15px; line-height: 17px; color: var(--tk-stubi); }
.hb-tk-dots{ display: flex; gap: 4px; }
.hb-tk-dots i{ width: 7px; height: 7px; border-radius: 50%; background: var(--tk-stubi); opacity: .8; }
.hb-tk-stub:focus-visible{ outline: 3px solid #4dda85; outline-offset: 3px; }
.hb-tk-wrap.is-torn .hb-tk-stub{ animation: none; transform: translate(40px, 34px) rotate(24deg); opacity: 0; pointer-events: none; }

/* notches (ticket ke kate hue gol) */
.hb-tk-notch{ position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--tk-page); }
.hb-tk-nl{ left: -9px; top: 50%; margin-top: -9px; }
.hb-tk-nt{ right: 80px; top: -9px; }
.hb-tk-nb{ right: 80px; bottom: -9px; }

/* Chhota phone (≤359px) */
@media (max-width: 359px){
  .hb-tk-h1{ font-size: 16px; line-height: 20px; }
  .hb-tk-live{ height: 22px; padding: 0 7px; font-size: 10px; }
  .hb-tk-stub{ flex-basis: 78px; width: 78px; }
  .hb-tk-nt, .hb-tk-nb{ right: 70px; }
  .hb-tk-body{ padding-left: 13px; }
  .hb-tk-end b{ font-size: 14.5px; }
  .hb-tk-bar{ display: none; }
  .hb-tk-go{ font-size: 14px; }
}
@media (prefers-reduced-motion: reduce){
  .hb-tk, .hb-tk-body, .hb-tk-holo, .hb-tk-fill, .hb-tk-van, .hb-tk-stop, .hb-tk-midl,
  .hb-tk-marq, .hb-tk-colon, .hb-tk-stamp, .hb-tk-perf span, .hb-tk-stub, .hb-tk-live i{ animation: none !important; }
  .hb-tk-fill{ transform: scaleX(1); }
  .hb-tk-van{ left: calc(100% - 26px); }
  .hb-tk-holo, .hb-tk-perf span{ display: none; }
  .hb-tk-ywin{ overflow-x: auto; }
}
