/* ==========================================================================
   HxH v4 — Instant SPA feel + full UI polish
   - Tab switches swap ONLY the page content (sidebar/header/nav stay mounted),
     so this layer keeps transitions tiny and chrome rock-stable.
   - Hero scene is pure CSS/SVG now (no baked-icon image, no double logos).
   ========================================================================== */
:root{
  --v4-purple:#0a6e4f; --v4-violet:#0e7c5a; --v4-deep:#0a4a37;
  --v4-lav:#f7f4ff; --v4-lav2:#efe9fd; --v4-line:#e7defa; --v4-ink:#171331;
  --v4-muted:#6d6884; --v4-card:#ffffff;
  --v4-shadow:0 10px 30px -12px rgba(9,90,66,.14);
  --v4-shadow-lg:0 22px 44px -16px rgba(9,90,66,.22);
  --v4-r:18px;
}

/* ---------- no sideways scroll / no clipped floating buttons ---------- */
html,body{overflow-x:clip}
*{scrollbar-width:thin;scrollbar-color:#8fe3c4 transparent}
*::-webkit-scrollbar{width:8px;height:8px}
*::-webkit-scrollbar-thumb{background:#8fe3c4;border-radius:8px}
::selection{background:#ddd0fb;color:var(--v4-deep)}

/* ---------- instant tab switching: kill the "full reload" theatre ------- */
/* entrance.js adds [data-enter] on every view change; keep it a whisper. */
#app[data-enter] .content{animation:v4PageIn .22s ease-out both}
#app[data-enter="first"] .content{animation:v4PageIn .3s ease-out both}
.page-enter>.page-heading,.page-enter>.hero,.page-enter>.auth-panel,
.page-enter>.admin-workspace>.page-heading{animation-duration:.22s!important}
.fx-pre{transition-duration:.38s!important}
@keyframes v4PageIn{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){
  #app[data-enter] .content,.page-enter>*{animation:none!important}
}

/* ---------- sticky glass topbar (chrome never unmounts now) ------------- */
html[data-theme="white"] .topbar{
  position:sticky;top:0;z-index:34;
  background:rgba(255,255,255,.88)!important;
  -webkit-backdrop-filter:blur(16px) saturate(1.4);backdrop-filter:blur(16px) saturate(1.4);
  border-bottom:1px solid var(--v4-line)!important;
  box-shadow:0 10px 28px -22px rgba(9,90,66,.35);
}
html[data-theme="black"] .topbar{
  position:sticky;top:0;z-index:34;
  background:rgba(5,5,10,.88)!important;
  -webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);
}
.top-brand[hidden]{display:none!important}
.top-link{position:relative;border-radius:10px;padding:7px 4px}
.top-link.active{color:var(--v4-purple)!important;font-weight:750}
.cart-count{background:linear-gradient(135deg,#0e7c5a,#0a4a37)!important;
  box-shadow:0 4px 10px -2px rgba(10,110,79,.55);font-weight:800}

/* ---------- sidebar: calmer active state, crisp icons ------------------- */
html[data-theme="white"] .sidebar{background:rgba(255,255,255,.92)!important;border-right:1px solid var(--v4-line)!important}
html[data-theme="white"] .nav-item{border-radius:13px;color:#4c4666}
html[data-theme="white"] .nav-item svg{width:20px;height:20px}
html[data-theme="white"] .nav-item:hover{background:var(--v4-lav);color:var(--v4-deep)}
html[data-theme="white"] .nav-item.active{
  background:linear-gradient(120deg,#e6f5ee,#f5f0ff)!important;color:var(--v4-deep)!important;
  box-shadow:inset 0 0 0 1px #ddd0fb,0 8px 18px -12px rgba(10,110,79,.5)!important;font-weight:750}
.brand img{border-radius:12px;box-shadow:0 8px 18px -8px rgba(9,90,66,.5)}

/* ---------- HERO: pure CSS lavender scene (no baked icons) -------------- */
.hx-scene-css{position:absolute;inset:-6% -4%;z-index:0;pointer-events:none;border-radius:28px;
  background:
   radial-gradient(ellipse 55% 42% at 78% 16%,rgba(95,211,168,.40),transparent 70%),
   radial-gradient(ellipse 60% 50% at 18% 82%,rgba(196,181,253,.45),transparent 70%),
   radial-gradient(ellipse 45% 38% at 88% 84%,rgba(221,208,251,.55),transparent 70%),
   linear-gradient(150deg,#fbfaff 0%,#f3edff 48%,#e9defc 100%);}
.hx-scene-css i{position:absolute;border-radius:50%;background:rgba(255,255,255,.75);
  box-shadow:0 18px 34px -18px rgba(10,110,79,.35)}
.hx-scene-css i:nth-child(1){width:120px;height:120px;left:6%;top:12%;opacity:.7}
.hx-scene-css i:nth-child(2){width:74px;height:74px;right:10%;top:58%;opacity:.55}
.hx-scene-css i:nth-child(3){width:44px;height:44px;left:16%;bottom:10%;opacity:.6}
html[data-theme="white"] .hx-hero .hero-art{overflow:visible}
.hx-hero .hx-tile-in{border-radius:20px!important;border:1px solid rgba(255,255,255,.95)!important;
  box-shadow:0 16px 30px -14px rgba(9,90,66,.45)!important}
.hx-hero .hx-mainlogo{border-radius:26px!important}
.hx-hero .hx-mainlogo img{border-radius:25px!important}
.hero-notes span svg{border-radius:12px}
/* trust notes must never collide with the art on small screens */
@media(max-width:760px){
  .hx-hero .hero-art{--ring:min(250px,calc(100vw - 150px));--tile:50px;
    min-height:calc(var(--ring) + var(--tile) + 26px);margin-top:26px}
  .hx-hero .hx-mainlogo{border-radius:20px!important}
  .hx-hero .hx-mainlogo img{border-radius:19px!important}
  .hx-scene-css{inset:0;border-radius:22px}
}

/* ---------- back-to-top rocket: real SVG, never clipped ----------------- */
.scroll-to-top-btn{
  right:20px!important;bottom:28px!important;width:50px!important;height:50px!important;
  background:#fff!important;color:var(--v4-violet)!important;
  border:1.5px solid #ddd0fb!important;border-radius:50%!important;
  box-shadow:0 14px 30px -10px rgba(9,90,66,.4)!important;z-index:65!important}
.scroll-to-top-btn .rocket-icon{width:22px;height:22px;position:relative;z-index:2}
.scroll-to-top-btn:hover{color:var(--v4-deep)!important;transform:translateY(-3px)}
.scroll-to-top-btn .scroll-progress-bar{stroke:var(--v4-violet)!important}
.scroll-to-top-btn .scroll-progress-bg{stroke:#e6f5ee!important}
html[data-theme="black"] .scroll-to-top-btn{background:#17122b!important;border-color:#0a4a37!important;color:#8fe3c4!important}
@media(max-width:860px){
  .scroll-to-top-btn{right:16px!important;bottom:calc(104px + env(safe-area-inset-bottom))!important;width:46px!important;height:46px!important}
}

/* ---------- floating mobile tab bar ------------------------------------ */
@media(max-width:860px){
  .mobile-nav{
    left:10px;right:10px;bottom:calc(10px + env(safe-area-inset-bottom));
    border-radius:22px!important;border:1px solid var(--v4-line)!important;
    background:rgba(255,255,255,.94)!important;
    -webkit-backdrop-filter:blur(18px) saturate(1.5);backdrop-filter:blur(18px) saturate(1.5);
    box-shadow:0 18px 36px -14px rgba(9,90,66,.35)!important;
    padding:8px 6px!important;justify-content:space-between!important}
  html[data-theme="black"] .mobile-nav{background:rgba(16,12,30,.94)!important;border-color:#2e2160!important}
  .mobile-nav a{
    flex:1 1 0;min-width:0;border-radius:16px;padding:7px 2px 6px!important;
    font-size:10px!important;font-weight:650;color:#6d6884!important;gap:4px!important;
    transition:background .18s,color .18s,transform .18s}
  .mobile-nav a svg{width:22px!important;height:22px!important}
  .mobile-nav a:active{transform:scale(.94)}
  .mobile-nav a.active{
    background:linear-gradient(140deg,#e6f5ee,#f5f0ff)!important;color:var(--v4-purple)!important;
    box-shadow:inset 0 0 0 1px #ddd0fb;font-weight:800}
  html[data-theme="black"] .mobile-nav a.active{background:#241743!important;color:#8fe3c4!important;box-shadow:inset 0 0 0 1px #0a4a37}
  .content{padding-bottom:calc(118px + env(safe-area-inset-bottom))!important}
}

/* ---------- cards, panels, products: one calm system -------------------- */
html[data-theme="white"] .panel{
  background:var(--v4-card);border:1px solid var(--v4-line)!important;border-radius:var(--v4-r)!important;
  box-shadow:var(--v4-shadow)}
html[data-theme="white"] .product{
  border:1px solid var(--v4-line)!important;border-radius:var(--v4-r)!important;background:#fff;
  box-shadow:0 8px 22px -14px rgba(9,90,66,.18);overflow:hidden;
  transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}
html[data-theme="white"] .product:hover{transform:translateY(-4px);border-color:#8fe3c4!important;box-shadow:var(--v4-shadow-lg)}
.product-art{pointer-events:none}
html[data-theme="white"] .category-card{border-radius:var(--v4-r)!important;border-color:var(--v4-line)!important}
html[data-theme="white"] .category-icon{background:var(--tint,var(--v4-lav))!important;border-radius:14px}
html[data-theme="white"] .stat{
  background:#fff;border:1px solid var(--v4-line);border-radius:var(--v4-r);box-shadow:var(--v4-shadow)}
html[data-theme="white"] .mini-banner,html[data-theme="white"] .journey-step{
  border-radius:var(--v4-r)!important;border-color:var(--v4-line)!important;box-shadow:var(--v4-shadow)}
html[data-theme="white"] .featured-showcase{border-radius:22px!important}
.fb-tile{border-radius:18px!important}
.fb-logo img{pointer-events:none}

/* buttons + tabs */
.btn{border-radius:13px!important}
.btn:not(.secondary){background:linear-gradient(135deg,#0e7c5a,#08543d)!important;
  box-shadow:0 12px 24px -10px rgba(10,110,79,.55)!important}
.btn:not(.secondary):hover{box-shadow:0 16px 30px -10px rgba(10,110,79,.6)!important}
html[data-theme="white"] .tabs .tab{border-radius:999px!important;border:1px solid var(--v4-line);background:#fff}
html[data-theme="white"] .tabs .tab.active{background:linear-gradient(135deg,#0e7c5a,#08543d)!important;color:#fff!important;border-color:transparent;box-shadow:0 8px 18px -8px rgba(10,110,79,.6)}
.toggle-pill{border-radius:999px!important}
.toggle-pill.on{background:#e6f5ee!important;color:var(--v4-deep)!important;border-color:#8fe3c4!important}

/* page headings + sections */
.page-heading h1{letter-spacing:-.6px}
html[data-theme="white"] .page-heading p{color:var(--v4-muted)}
.section-title{margin-bottom:16px}

/* forms: clear purple focus everywhere */
input,select,textarea{border-radius:12px!important}
html[data-theme="white"] input:focus,html[data-theme="white"] select:focus,html[data-theme="white"] textarea:focus{
  border-color:var(--v4-violet)!important;box-shadow:0 0 0 4px rgba(14,124,90,.14)!important;outline:none}
.field>label{margin-bottom:7px}

/* tables */
.table-wrap{border-radius:16px;overflow:auto}
html[data-theme="white"] .table-wrap{border:1px solid var(--v4-line);background:#fff}
html[data-theme="white"] th{background:var(--v4-lav);color:var(--v4-deep);font-size:11px;letter-spacing:.4px;text-transform:uppercase}
html[data-theme="white"] td{border-top:1px solid #f1ebfc}
.status{border-radius:999px!important;font-weight:750}

/* admin: tabs scroll instead of wrapping into a mess */
.admin-tabs{display:flex;gap:8px;overflow-x:auto;padding-bottom:8px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.admin-tabs::-webkit-scrollbar{display:none}
.admin-tabs .tab{flex:0 0 auto;border-radius:999px!important}
.admin-tabs .tab.active{background:linear-gradient(135deg,#0e7c5a,#08543d)!important;color:#fff!important}

/* auth pages */
html[data-theme="white"] .auth-panel{
  border-radius:24px!important;border:1px solid var(--v4-line)!important;
  box-shadow:var(--v4-shadow-lg)!important;background:linear-gradient(180deg,#fff,#fcfaff)}
.auth-brand-emblem{border-radius:18px!important}

/* toasts sit above the floating tab bar */
@media(max-width:860px){#toasts{bottom:calc(96px + env(safe-area-inset-bottom))!important}}
.toast{border-radius:14px!important;box-shadow:var(--v4-shadow-lg)!important}

/* skeleton shimmer for slow panels (used by JS mounts) */
.v4-skeleton{border-radius:14px;background:linear-gradient(100deg,#efe9fd 40%,#f7f4ff 50%,#efe9fd 60%);
  background-size:200% 100%;animation:v4Shimmer 1.2s infinite;min-height:90px}
@keyframes v4Shimmer{to{background-position:-200% 0}}

/* decorative imagery never eats taps */
.hero-art *,[aria-hidden="true"] img{pointer-events:none!important}
img{-webkit-user-drag:none}
