/* ==========================================================================
   HxH v1.6 — Professional polish: animated art backgrounds, pro search,
   prettier loading, admin upgrade, low-end-mobile performance mode.
   Animations use ONLY transform/opacity (GPU-friendly). Heavy effects are
   disabled automatically on low-end devices via .hx-lowfx (see hx-fx.js).
   ========================================================================== */

/* ---------- animated art backgrounds ------------------------------------ */
.hx-scene-css{
  background-image:url('/assets/generated/bg-lavender-sky.webp')!important;
  background-size:cover!important;background-position:center!important;
  animation:v6Drift 30s ease-in-out infinite alternate;
}
.hx-scene-css::after{content:'';position:absolute;inset:0;border-radius:inherit;
  background:linear-gradient(160deg,rgba(255,255,255,.38),transparent 55%,rgba(14,124,90,.10))}
html[data-theme="black"] .hx-scene-css{filter:brightness(.5) saturate(1.25)}
html[data-theme="black"] .hx-scene-css::after{background:linear-gradient(160deg,rgba(10,5,25,.25),transparent 55%,rgba(0,0,0,.35))}
@keyframes v6Drift{from{transform:scale(1.04) translate3d(0,0,0)}to{transform:scale(1.12) translate3d(-1.6%,1.6%,0)}}

html[data-theme="white"] .referral-hero{
  background:linear-gradient(120deg,rgba(255,255,255,.88),rgba(243,237,255,.78)),
             url('/assets/generated/bg-lavender-sky.webp') center/cover!important}
html[data-theme="black"] .referral-hero{
  background:linear-gradient(120deg,rgba(16,8,34,.92),rgba(24,12,52,.88)),
             url('/assets/generated/bg-lavender-sky.webp') center/cover!important}

/* transparent illustration inside empty states (cart, catalog, search) */
.empty-catalog::before{
  content:'';display:block;width:158px;height:158px;margin:2px auto 10px;
  background:url('/assets/generated/art-empty-box-nobg.webp') center/contain no-repeat;
  filter:drop-shadow(0 20px 24px rgba(9,90,66,.30));
  animation:v6Floaty 6.5s ease-in-out infinite alternate}

/* auth panels: little 3D art chip, never over the form */
.auth-panel{position:relative}
.auth-panel::after{
  content:'';position:absolute;right:14px;bottom:12px;width:128px;height:104px;
  background:url('/assets/generated/art-welcome-3d-nobg.webp') center/contain no-repeat;
  filter:drop-shadow(0 16px 20px rgba(9,90,66,.35));pointer-events:none;
  animation:v6Floaty 7.5s ease-in-out infinite alternate}
@media(max-width:760px){.auth-panel::after{display:none}}

/* admin welcome banner art */
.admin-welcome{position:relative;overflow:hidden}
.admin-welcome::after{
  content:'';position:absolute;right:10px;bottom:-8px;width:240px;height:180px;
  background:url('/assets/generated/art-welcome-3d-nobg.webp') center/contain no-repeat;opacity:.95;
  filter:drop-shadow(0 18px 22px rgba(9,90,66,.30));pointer-events:none;
  animation:v6Floaty 8.5s ease-in-out infinite alternate}
.admin-welcome>*{position:relative;z-index:1}
@media(max-width:760px){.admin-welcome::after{opacity:.5;width:160px;height:120px}}

/* ---------- top search bar: professional ------------------------------- */
html[data-theme] .header-search{
  position:relative!important;border-radius:999px!important;min-height:44px;
  transition:box-shadow .22s,border-color .22s,background .22s}
html[data-theme="white"] .header-search{
  background:#f7f4ff!important;border:1.5px solid #e3d8fb!important;color:#7c6aa8!important}
html[data-theme="white"] .header-search>svg{color:#0e7c5a!important;flex:0 0 auto}
html[data-theme="white"] .header-search:focus-within{
  background:#fff!important;border-color:#0e7c5a!important;
  box-shadow:0 0 0 4px rgba(14,124,90,.14),0 14px 28px -14px rgba(9,90,66,.35)!important}
html[data-theme="white"] .header-search input{font-size:13px!important;color:#241243!important}
html[data-theme="white"] .header-search input::placeholder{color:#9790b5!important}
html[data-theme="white"] .header-search kbd{
  background:#fff;border:1px solid #ddd0fb!important;color:#0e7c5a!important;border-radius:7px!important;
  font-weight:700;box-shadow:0 2px 0 #e7defa}
html[data-theme="black"] .header-search:focus-within{
  border-color:#17a67a!important;box-shadow:0 0 0 4px rgba(14,124,90,.22)!important}
.search-clear{border-radius:50%!important;display:grid;place-items:center}
.search-clear:hover{background:#e6f5ee!important;color:#0a6e4f!important}
/* suggestions: floating card, never clipped */
.search-suggest{
  position:absolute!important;top:calc(100% + 10px)!important;left:0;right:0;z-index:80!important;
  border-radius:18px!important;padding:8px!important;max-height:min(60vh,430px);overflow:auto;
  animation:v5Pop .22s cubic-bezier(.2,1,.3,1) both}
html[data-theme="white"] .search-suggest{background:#fff!important;border:1px solid #e7defa!important;
  box-shadow:0 28px 50px -18px rgba(9,90,66,.35)!important}
html[data-theme="black"] .search-suggest{background:#150b2e!important;border:1px solid #3b2570!important;
  box-shadow:0 28px 50px -18px rgba(0,0,0,.85)!important}
/* in-page big search (products / SMM) */
.search-field{border-radius:999px!important;min-height:52px;padding:0 8px 0 18px!important;
  transition:box-shadow .22s,border-color .22s}
html[data-theme="white"] .search-field{background:#fff!important;border:1.5px solid #e3d8fb!important}
html[data-theme="white"] .search-field:focus-within{border-color:#0e7c5a!important;box-shadow:0 0 0 4px rgba(14,124,90,.13)!important}
.search-field input{font-size:15px!important}
@media(max-width:760px){
  .header-search{min-height:42px}
  .search-suggest{position:fixed!important;left:10px!important;right:10px!important;top:70px!important}
}

/* ---------- prettier loading -------------------------------------------- */
.boot{background:
  radial-gradient(ellipse at 50% 30%,rgba(95,211,168,.35),transparent 55%),
  linear-gradient(180deg,#faf8ff,#f1eafd)!important}
html[data-theme="black"] .boot{background:
  radial-gradient(ellipse at 50% 30%,rgba(14,124,90,.35),transparent 55%),
  linear-gradient(180deg,#0b0619,#07040f)!important}
.boot-orbit{width:104px!important;height:104px!important}
.boot-orbit img{width:84px!important;height:84px!important;border-radius:26px!important;
  box-shadow:0 22px 44px -16px rgba(9,90,66,.6),0 0 0 8px rgba(95,211,168,.15)!important;
  animation:bootPulse 1.8s ease-in-out infinite}
.boot-orbit span{border-color:rgba(14,124,90,.35)!important}
.boot-orbit::after{content:'';position:absolute;inset:-14px;border-radius:50%;
  border:1.5px solid transparent;border-top-color:#0e7c5a;animation:cb-spin 1.15s linear infinite}
.boot strong{font-size:16px!important;letter-spacing:-.2px;
  background:linear-gradient(90deg,#0a4a37,#0e7c5a);-webkit-background-clip:text;background-clip:text;color:transparent}
html[data-theme="black"] .boot strong{background:linear-gradient(90deg,#8fe3c4,#17a67a);-webkit-background-clip:text;background-clip:text}
.boot-progress{width:190px!important;height:5px!important;border-radius:99px!important;overflow:hidden;
  background:rgba(14,124,90,.15)!important}
.boot-progress i{background:linear-gradient(90deg,#5fd3a8,#0a6e4f,#5fd3a8)!important;background-size:200% 100%;
  animation:cb-load 1.3s ease-in-out infinite,v6Shine 1.3s linear infinite!important;border-radius:99px}
@keyframes v6Shine{to{background-position:-200% 0}}
/* thin navigation progress bar (hx-fx.js) */
#v6-navprog{position:fixed;top:0;left:0;height:3px;width:38%;z-index:999;border-radius:0 3px 3px 0;
  background:linear-gradient(90deg,#5fd3a8,#0a6e4f);box-shadow:0 2px 10px rgba(10,110,79,.5);
  opacity:0;pointer-events:none;transition:opacity .25s}
#v6-navprog.on{opacity:1;animation:v6Prog 1.05s cubic-bezier(.3,.6,.4,1) infinite}
@keyframes v6Prog{0%{transform:translateX(-110%)}100%{transform:translateX(280%)}}

/* ---------- admin: professional console -------------------------------- */
.admin-tabs{
  position:sticky;top:66px;z-index:24;padding:10px!important;border-radius:18px!important;
  margin-bottom:16px}
html[data-theme="white"] .admin-tabs{background:rgba(255,255,255,.9)!important;border:1px solid #e7defa;
  -webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);box-shadow:0 14px 30px -20px rgba(9,90,66,.35)}
html[data-theme="black"] .admin-tabs{background:rgba(13,7,28,.92)!important;border:1px solid #2b1a56;
  -webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}
.admin-tabs .tab-count{background:linear-gradient(135deg,#f43f5e,#e11d48);color:#fff;font-size:9.5px;
  font-weight:800;border-radius:99px;padding:1px 6px;margin-left:6px;vertical-align:2px}
.admin-workspace .table-wrap table tbody tr{transition:background .16s}
html[data-theme="white"] .admin-workspace tbody tr:hover{background:#faf7ff!important}
html[data-theme="black"] .admin-workspace tbody tr:hover{background:#1a0f38!important}
.admin-workspace th{position:sticky;top:0;z-index:2}
.stat>svg{padding:9px;width:40px!important;height:40px!important;border-radius:13px;box-sizing:border-box}
html[data-theme="white"] .stat>svg{background:#f1eafd;color:#0a6e4f}
html[data-theme="black"] .stat>svg{background:rgba(14,124,90,.18);color:#8fe3c4}
.admin-context-bar{border-radius:14px!important}
html[data-theme="white"] .admin-context-bar{background:#faf8ff;border:1px solid #e7defa}
.live-pill{border-radius:99px!important}

@keyframes v6Floaty{from{translate:0 0;rotate:-1.6deg}to{translate:0 -9px;rotate:1.6deg}}
/* floating brand tiles in featured row + gentle icon bob on cards */
.fb-tile:hover .fb-logo{animation:v6Floaty 1.6s ease-in-out infinite alternate}
.category-card:hover .category-icon{animation:v6Floaty 1.4s ease-in-out infinite alternate}

/* ---------- performance: low-end mode + offscreen/hidden pause ---------- */
.hx-hero.hx-offscreen .hx-tile-in,.hx-hero.hx-offscreen .hx-mainlogo,
.hx-hero.hx-offscreen .hx-scene-css{animation-play-state:paused!important}
html.hx-paused *,html.hx-paused *::before,html.hx-paused *::after{animation-play-state:paused!important}
html.hx-lowfx .hx-scene-css,html.hx-lowfx .hx-tile-in,html.hx-lowfx .hx-mainlogo,
html.hx-lowfx .reward-network,html.hx-lowfx .empty-catalog::before,html.hx-lowfx .auth-panel::after,html.hx-lowfx .admin-welcome::after{animation:none!important}
html.hx-lowfx .topbar,html.hx-lowfx .mobile-nav,html.hx-lowfx .admin-tabs{
  -webkit-backdrop-filter:none!important;backdrop-filter:none!important}
html.hx-lowfx .btn::after{display:none!important}
html.hx-lowfx *{transition-duration:.08s!important}
/* keep long pages cheap to scroll on every device */
.journey,.faq-section,.footer.pro-footer,.referral-terms{content-visibility:auto;contain-intrinsic-size:auto 420px}
@media(prefers-reduced-motion:reduce){
  .hx-scene-css,.boot-progress i,.empty-catalog::before,#v6-navprog.on{animation:none!important}
}
