/* TG-SB-1122. Mobile search pill (live via features-live.json sb.all).
   Moves #tgmd-btn inside form.ma-s. Restores the pre-restyle typist
   (tgx-js) and the pipe-flow gradient animation, tinted with the
   purple-to-amber palette. Does not edit theme files, head.tpl,
   custom.css, #tg-studiofix, or tg-mobile-dots-1117 files.
   Rollback: ~/backups-nov22/mobile-searchbar-anim-TIMESTAMP/ROLLBACK.md */

/* Desktop unchanged: all rules are inside max-width:1023px and
   only apply when JS has set html.tgsb-on (phone/tablet). */
@media (max-width: 1023px){

/* Beat live rainbow/fog/gradient blocks that use up to 8 :not(#qN) ids.
   html.tgsb-on + 9 :not() is one step stronger. */
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s:hover,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s:focus-within,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9)[data-tgm] body #th-main .ma-s,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9)[data-tgm] body #th-main.th-sc .ma-s,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9)[data-tgm] body #th-main.th-sc .ma-s:hover,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9)[data-tgm] body #th-main.th-sc .ma-s:focus-within,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9)[data-tgxm] body #th-main:not(.th-sc) .ma-s,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9)[data-tgxm] body #th-main .ma-s{
  /* Fallback fill; the moving pipe lives on ::before, same mechanism as
     the live tgpipe-a / PIPE v2 animation (28s, right-to-left, endless). */
  background: #FF3E9A !important;
  background-size: auto !important;
  background-position: 0 0 !important;
  animation: none !important;
  filter: none !important;
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 24px rgba(40,10,40,.28), 0 1px 3px rgba(0,0,0,.18) !important;
  outline: 0 !important;
  transform: none !important;
  overflow: hidden !important;
  isolation: isolate;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 6px 0 18px !important;
  gap: 0 !important;
  font-family: Poppins, system-ui, sans-serif !important;
}

/* Restore the old PIPE animation (same 28s linear translate -50% loop,
   blur, repeat-x tile) on ::before, tinted with the approved
   purple-pink-red-orange-amber palette, looped so it tiles cleanly. */
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s::before,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s:hover::before,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s:focus-within::before{
  content: "" !important;
  display: block !important;
  position: absolute !important;
  z-index: 0 !important;
  pointer-events: none !important;
  left: 0 !important;
  top: -60% !important;
  right: auto !important;
  bottom: auto !important;
  width: 400% !important;
  height: 220% !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  opacity: 1 !important;
  transform-origin: 0 50% !important;
  background: linear-gradient(90deg, #7B4DFF 0%, #7B4DFF 6%, #FF3E9A 20%, #FF3E9A 26%, #FF3B3B 40%, #FF3B3B 46%, #FF7A00 60%, #FF7A00 66%, #FFB000 80%, #FFB000 86%, #7B4DFF 100%) 0 0 / 50% 100% repeat-x !important;
  background: linear-gradient(in oklch 90deg, #7B4DFF 0%, #7B4DFF 6%, #FF3E9A 20%, #FF3E9A 26%, #FF3B3B 40%, #FF3B3B 46%, #FF7A00 60%, #FF7A00 66%, #FFB000 80%, #FFB000 86%, #7B4DFF 100%) 0 0 / 50% 100% repeat-x !important;
  filter: blur(8px) saturate(1.1) !important;
  animation: tgsb-pipe 28s linear infinite !important;
}
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s::after,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s:focus-within::after{
  content: none !important;
  display: none !important;
  animation: none !important;
  background: none !important;
  filter: none !important;
  opacity: 0 !important;
}
@keyframes tgsb-pipe{
  0%{transform:translate(0,0)}
  25%{transform:translate(-12.5%,5%)}
  50%{transform:translate(-25%,0)}
  75%{transform:translate(-37.5%,-5%)}
  100%{transform:translate(-50%,0)}
}
@media (prefers-reduced-motion: reduce){
  html.tgsb-on body #th-main form.ma-s::before,
  html.tgsb-on body #th-main form.ma-s:focus-within::before{
    animation: none !important;
    transform: none !important;
  }
}

html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s .tg-ss-wrap,
html.tgsb-on body #th-main form.ma-s .tg-ss-wrap{
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
  z-index: 2;
}

html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s input[name="s"],
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s input[name="s"]:focus,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9)[data-tgm] body #th-main .ma-s input,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9)[data-tgxm] body #th-main .ma-s input{
  display: block !important;
  width: 100% !important;
  height: 44px !important;
  min-height: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff !important;
  font-family: Poppins, system-ui, sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 44px !important;
  outline: 0 !important;
  box-shadow: none !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.25) !important;
  position: relative !important;
  z-index: 2 !important;
  padding: 0 !important;
  margin: 0 !important;
}

html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s input[name="s"]::placeholder,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s input[name="s"]::-webkit-input-placeholder,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9)[data-tgm] body #th-main .ma-s input::placeholder,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9)[data-tgxm] body #th-main .ma-s input::placeholder{
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  opacity: 1 !important;
  font-family: Poppins, system-ui, sans-serif !important;
  font-weight: 700 !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.25) !important;
}

/* Magnifier: white stroke, no fill, on the right, before the dots. */
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s > button,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s > [type="submit"]{
  order: 99 !important;
  flex: 0 0 40px !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #fff !important;
  display: grid !important;
  place-items: center !important;
  position: static !important;
  z-index: 2 !important;
  filter: none !important;
}
html.tgsb-on body #th-main form.ma-s > button svg,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s > button svg,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9)[data-tgm] body #th-main .ma-s button svg,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9)[data-tgm] body #th-main.th-sc .ma-s button svg{
  width: 22px !important;
  height: 22px !important;
  color: #fff !important;
  stroke: #fff !important;
  filter: none !important;
}
html.tgsb-on body #th-main form.ma-s > button svg [stroke],
html.tgsb-on[data-tgm] body #th-main .ma-s button svg [stroke],
html.tgsb-on[data-tgxm] body #th-main .ma-s button svg [stroke]{
  stroke: #fff !important;
}
html.tgsb-on[data-tgxm="dark"] body #th-main:not(.th-sc) .ma-s button svg{
  filter: none !important;
}

/* Dots button, once JS has moved it into the pill. */
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s > #tgmd-btn.tgmd-btn,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main form.ma-s > .tgmd-btn,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main.th-sc form.ma-s > #tgmd-btn.tgmd-btn,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main.th-sc form.ma-s > .tgmd-btn,
html.tgsb-on:not(#q1):not(#q2):not(#q3):not(#q4):not(#q5):not(#q6):not(#q7):not(#q8):not(#q9) body #th-main.th-sc nav.th-act form.ma-s .tgmd-btn{
  display: inline-grid !important;
  place-items: center;
  order: 100 !important;
  flex: 0 0 40px !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  margin: 0 2px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #fff !important;
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  z-index: 2 !important;
  filter: none !important;
}
html.tgsb-on body #th-main form.ma-s > .tgmd-btn:active,
html.tgsb-on body #th-main form.ma-s > .tgmd-btn[aria-expanded="true"]{
  background: rgba(255,255,255,.16) !important;
  box-shadow: none !important;
  color: #fff !important;
}
html.tgsb-on body #th-main form.ma-s > .tgmd-btn .tgmd-dots{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
html.tgsb-on body #th-main form.ma-s > .tgmd-btn .tgmd-dots i{
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff !important;
}

/* Layout changes only on the true mobile two-row bar (<=767px),
   where the dots sit outside the pill today. 768-1023 keeps the one-row header. */
@media (max-width: 767px){
/* When scrolled, the solid header strip goes away so the pill floats.
   Logo row is already off-screen (top:-58px), so transparency is safe.
   At rest the logo row keeps its current background so the wordmark stays readable. */
html.tgsb-on body #th-main.th-sc{
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  border-bottom-color: transparent !important;
}

/* Full-width pill again: no 44px hole reserved for dots-outside.
   Side inset 12px. The live bar is a TOP sticky row; env(safe-area-inset-bottom)
   is wired as a custom property so it can be applied if the row is ever pinned
   to the bottom, without opening a 34px gap under a top bar. */
html.tgsb-on{
  --tgsb-safe-bottom: env(safe-area-inset-bottom, 0px);
}
html.tgsb-on body #th-main form.ma-s,
html.tgsb-on body #th-main.th-sc form.ma-s,
html.tgsb-on.tgmd-on body #th-main.th-sc form.ma-s{
  margin-left: 12px !important;
  margin-right: 12px !important;
  width: auto !important;
  max-width: none !important;
  flex: 1 1 auto !important;
}

/* Do not resurrect the header on product pages: HH already hides it.
   Do not fight Studio's html.ts-lock hide of everything except #tees-studio. */
}

}
