:root{
  --bg:#0b0f13;
  --panel:#0f1720;
  --muted:#98a0ad;
  --accent:#6c5ce7;
  --white: #eef2f7;
  --radius:12px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background:linear-gradient(180deg,var(--bg),#07090b 60%);
  color:var(--white);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* Centered hero */
.hero{
  width:100%;
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:48px 24px;
}

.hero-inner{
  text-align:center;
  max-width:820px;
  width:100%;
  padding:48px;
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:var(--radius);
  box-shadow: 0 8px 30px rgba(2,6,23,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
  backdrop-filter: blur(6px);
}

.hero-title{
  margin:0 0 12px;
  font-weight:600;
  font-size:clamp(1.8rem,4.5vw,2.8rem);
  letter-spacing:-0.02em;
  color:var(--white);
}

/* logo images */
.hero-title .hero-logo{ display:block; margin:0 auto; height:clamp(48px,8vw,96px); width:auto; }
.brand-logo{ display:block; height:clamp(36px,6.5vw,84px); width:auto; }

.hero-sub{
  margin:0 0 28px;
  color:var(--muted);
  font-size:clamp(0.95rem,2.2vw,1.1rem);
  display:block;
}

/* Typewriter caret */
.hero-sub #typewriter { white-space: nowrap; display:inline-block; letter-spacing: -0.01em; }
.hero-sub .caret {
  display:inline-block;
  width:2px;
  height:1.05em;
  background: var(--muted);
  margin-left:8px;
  vertical-align:bottom;
  animation: blink 1s steps(1) infinite;
  border-radius:1px;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* CTA button */
.btn-cta{
  appearance:none;
  border:0;
  padding:12px 22px;
  font-size:1rem;
  border-radius:10px;
  background:linear-gradient(90deg,var(--accent),#4f46e5);
  color:white;
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease, opacity .12s ease;
  box-shadow: 0 8px 18px rgba(108,92,231,0.18);
  display:inline-flex;
  align-items:center;
  gap:10px;
  margin:0 auto;
}
.btn-cta:active{transform:translateY(1px) scale(.997)}
.btn-cta:hover{box-shadow:0 14px 30px rgba(108,92,231,0.22); transform:translateY(-2px)}

/* Catalog overlay (animated page) */
.catalog-overlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  background:linear-gradient(180deg, rgba(2,6,23,0.6), rgba(2,6,23,0.85));
  z-index:1200;
  opacity:0;
  pointer-events:none;
  transition:opacity .28s ease;
}

.catalog-overlay[aria-hidden="false"]{
  opacity:1;
  pointer-events:auto;
}

.catalog-sheet{
  width:100%;
  max-width:1100px;
  height:92vh;
  margin:28px;
  border-radius:16px;
  overflow:hidden;
  background:linear-gradient(180deg, rgba(11,15,19,0.98), rgba(15,23,32,0.98));
  box-shadow:0 20px 60px rgba(2,6,23,0.6);
  transform:translateY(18px) scale(.995);
  opacity:0;
  transition:transform .36s cubic-bezier(.2,.9,.2,1), opacity .36s ease;
}

/* when overlay opened, pop sheet up */
.catalog-overlay[aria-hidden="false"] .catalog-sheet{
  transform:translateY(0) scale(1);
  opacity:1;
}

/* hero with background image */
.catalog-hero{
  height:210px;
  /* make the header itself transparent (no image/overlay) */
  background: transparent;
  background-image: none;
  position:relative;
  display:flex;
  align-items:center;
}
.catalog-hero-inner{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:28px 36px;
  /* keep the sheet/container visible but make the inner header transparent */
  background: transparent;
}

/* brand and search on the left */
.brand-search{
  display:flex;
  align-items:center;
  gap:12px;
}
.brand{
  color: #fff;
  letter-spacing: -0.02em;
}

/* center and enlarge brand in catalog and cart headers */
.catalog-hero{
  position:relative;
}
.catalog-hero .brand{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  font-weight:800;
  font-size:clamp(1.6rem,5vw,2.8rem);
  text-align:center;
  z-index:2;
}
.cart-sheet .catalog-hero .brand{
  font-size:clamp(1.4rem,4.2vw,2.4rem);
}
.search input{
  width:260px;
  max-width:48vw;
  padding:10px 12px;
  border-radius:10px;
  border:0;
  outline:0;
  background:rgba(255,255,255,0.06);
  color:var(--white);
  font-size:0.95rem;
}

/* close button */
.close-btn{
  position:absolute;
  top:16px;
  right:16px;
  width:36px;
  height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,0.03);
  color:var(--white);
  border:1px solid rgba(255,255,255,0.04);
  border-radius:8px;
  font-size:1.05rem;
  line-height:1;
  cursor:pointer;
  transition:background .12s ease, transform .08s ease, color .12s ease;
}
.close-btn:hover{ background:rgba(255,255,255,0.06); transform:translateY(-1px); }
.close-btn:active{ transform:translateY(0); }

/* nav */
.catalog-nav{
  padding:16px 24px;
  border-bottom:1px solid rgba(255,255,255,0.03);
  background:transparent;
}
.catalog-nav .catalog-nav-row{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:22px;
  padding:12px 16px;
}
.catalog-search{ flex:0 0 auto; }
.catalog-search input{
  width:260px;
  max-width:30vw;
  padding:10px 12px;
  border-radius:10px;
  border:0;
  outline:0;
  background:rgba(255,255,255,0.06);
  color:var(--white);
  font-size:0.95rem;
}

/* keep categories layout */
.catalog-cats{
  display:flex;
  gap:14px;
  list-style:none;
  margin:0;
  padding:0;
  align-items:center;
  white-space:nowrap;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

/* Hide native scrollbars globally but keep scrolling functional */
/* Applies a no-thumb UI while preserving scroll behavior */
* {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}
*::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
  width: 0; height: 0;
}
/* For browsers that show a faint thumb, ensure transparent track/thumb */
*::-webkit-scrollbar-thumb { background: transparent; border-radius: 999px; }

/* Ensure touch momentum scrolling remains smooth on scrollable elements */
html, body, .catalog-cats, .catalog-grid, .cart-grid { -webkit-overflow-scrolling: touch; }

/* sliding indicator under active category */
.catalog-cats{ position:relative; padding-bottom:8px; }
.cats-indicator{
  position:absolute;
  height:3px;
  background:var(--accent);
  bottom:2px;
  left:0;
  border-radius:3px;
  transform:translateX(0);
  transition:transform .28s cubic-bezier(.2,.9,.2,1), width .28s cubic-bezier(.2,.9,.2,1);
  will-change:transform,width;
  pointer-events:none;
}
.catalog-cats li{
  color:var(--muted);
  cursor:pointer;
  padding:8px 10px;
  border-radius:8px;
  font-size:0.95rem;
}
.catalog-cats li.active{
  color:var(--white);
  background:rgba(108,92,231,0.12);
}

/* grid of cards */
.catalog-grid{
  padding:28px;
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap:22px;
  height: calc(100% - 320px);
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  /* prevent grid items (cards) from stretching vertically on wide screens */
  align-items: start;
  grid-auto-rows: auto;
  /* animate category changes */
  transition: opacity .26s ease, transform .26s ease;
}

/* grid transition helper classes */
.catalog-grid.fade-out{ opacity:0; transform:translateY(8px); }
.catalog-grid.fade-in{ opacity:1; transform:translateY(0); }
.catalog-card{
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:14px;
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:14px;
  transition:transform .18s ease, box-shadow .18s ease;
  cursor: pointer;
}
.catalog-card:hover{
  transform:translateY(-6px);
  box-shadow: 0 14px 40px rgba(2,6,23,0.55);
}
.card-thumb{
  height:140px;
  border-radius:10px;
  background-size:cover;
  background-position:center;
}
.card-title{ font-weight:600; color:var(--white); font-size:0.98rem; }
.catalog-card .card-desc{ color:var(--muted); font-size:0.88rem; margin-top:6px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.item-sheet .card-desc{ /* allow full long description inside item popup */
  display:block; -webkit-line-clamp:unset; -webkit-box-orient:unset; overflow:visible; color:var(--muted); font-size:0.95rem; margin:0;
}

/* Ensure long descriptions are rendered above any decorative overlays and keep consistent color */
.item-sheet .card-desc{
  color:var(--muted) !important;
  mix-blend-mode: normal !important;
  position:relative;
  z-index:3;
}
.card-price{ margin-top:8px; font-weight:700; color:var(--white); font-size:0.98rem; }

/* Item overlay specifics */
.item-sheet{ max-width:860px; height:auto; padding:0; max-height: calc(92vh - 48px); overflow:auto; }
.item-body{ display:flex; gap:24px; padding:28px; align-items:center; flex-wrap:wrap; background:linear-gradient(180deg, rgba(11,15,19,0.98), rgba(15,23,32,0.98)); }
.item-media{ flex:1 1 360px; min-height:260px; border-radius:12px; background-size:contain; background-position:center center; background-repeat:no-repeat; box-shadow: inset 0 1px 0 rgba(255,255,255,0.02); display:flex; align-items:center; justify-content:center; }
.item-info{ flex:1 1 360px; min-width:260px; display:flex; flex-direction:column; gap:14px; padding:12px 8px; }
.item-price{ font-weight:700; color: #9be15d; font-size:1.1rem; }

/* item actions: cleaner, centered single primary CTA */
.item-actions{
  display:flex;
  gap:12px;
  margin-top:8px;
  align-items:center;
  justify-content:center;
}

/* make ghost smaller and primary CTA prominent */
.btn-ghost{ display:none; }
.item-sheet .btn-cta{ padding:12px 18px; border-radius:10px; }

/* Ensure SVG icon and label sit nicely inside CTA */
.btn-cta svg{ width:16px; height:16px; display:block; flex:0 0 auto; }
.btn-label{ display:inline-block; line-height:1; }

/* cart button / badge */
.cart-btn{
  position:absolute;
  top:14px;
  right:58px;
  background:rgba(0,0,0,0.35);
  border:0;
  color:var(--white);
  padding:10px 12px;
  border-radius:10px;
  display:flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
}
.cart-count{
  background:var(--accent);
  color:white;
  font-size:0.78rem;
  padding:4px 8px;
  border-radius:999px;
}

/* cart sheet specifics */
.cart-sheet{ max-width:860px; height:auto; display:flex; flex-direction:column; padding:12px 16px; gap:12px; }
.cart-grid{ padding:18px; display:flex; flex-direction:column; gap:16px; max-height:56vh; overflow:auto; }
.cart-row{
  display:flex;
  gap:14px;
  align-items:center;
  padding:14px;
  border-radius:12px;
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
}
.cart-thumb{ width:84px; height:68px; border-radius:10px; background-size:cover; background-position:center; flex:0 0 84px; }
.cart-info{ flex:1; display:flex; flex-direction:column; gap:8px; }
.cart-actions{ display:flex; gap:10px; align-items:center; }
.cart-actions{ display:flex; gap:14px; align-items:center; min-width:120px; }
.qty-btn{ background:transparent; border:1px solid rgba(255,255,255,0.06); padding:8px 10px; border-radius:8px; cursor:pointer; color:var(--white); font-size:1.05rem; }

/* quantity selector (item sheet) - match cart style */
.qty-select{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin-top:6px;
}
.qty-display{
  min-width:36px;
  padding:8px 10px;
  background:rgba(255,255,255,0.03);
  color:var(--white);
  border-radius:8px;
  text-align:center;
  font-weight:600;
  font-size:0.95rem;
}

/* small screens */
@media (max-width:680px){
  .catalog-hero{ height:180px }
  .search input{ width:160px }
  .catalog-grid{ grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) }
  .catalog-nav .catalog-nav-row{ flex-wrap:wrap; gap:10px; }
  .catalog-search{ flex:1 1 100%; }
}
@media (max-width:720px){
  .item-body{ flex-direction:column; }
  .item-media{ width:100%; min-height:180px; }
}
@media (max-width:520px){
  .cart-btn{ right:16px; top:12px; padding:8px; }
  .cart-thumb{ width:64px; height:48px; }
}

/* remove button (in cart and item sheet) */
.remove-btn{
  width:36px;
  height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,70,70,0.12);
  color:#ff6b6b;
  border:1px solid rgba(255,70,70,0.16);
  padding:0;
  border-radius:8px;
  cursor:pointer;
  font-size:1.05rem;
  line-height:1;
  transition:background .12s ease, transform .08s ease, color .12s ease;
  margin-left:12px;
}
.cart-total{ color:var(--white); font-size:1rem; }
.cart-shipping-note{ color:var(--muted); font-size:0.9rem; margin-left:10px; display:inline-block; vertical-align:middle; }

/* shipping tooltip */
.cart-shipping{ position:relative; display:inline-block; }
.shipping-tooltip{
  position:absolute;
  bottom: calc(100% + 10px);
  left:50%;
  transform:translateX(-50%) translateY(6px);
  background:linear-gradient(180deg, rgba(15,23,32,0.98), rgba(11,15,19,0.98));
  color:var(--muted);
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.04);
  box-shadow:0 8px 30px rgba(2,6,23,0.5);
  font-size:0.9rem;
  min-width:220px;
  max-width:320px;
  text-align:left;
  opacity:0;
  pointer-events:none;
  transition:opacity .16s ease, transform .16s ease;
  z-index:1300;
}
.shipping-tooltip::after{
  content:"";
  position:absolute;
  top:100%;
  left:50%;
  transform:translateX(-50%);
  width:10px;
  height:10px;
  background:inherit;
  border-left:1px solid rgba(255,255,255,0.02);
  transform-origin:center;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}
.cart-shipping:hover .shipping-tooltip,
.cart-shipping:focus .shipping-tooltip,
.cart-shipping:focus-visible .shipping-tooltip{
  opacity:1;
  transform:translateX(-50%) translateY(0);
  pointer-events:auto;
}
.remove-btn:hover{
  background:rgba(255,70,70,0.18);
  color:#fff;
  transform:translateY(-2px);
}
.remove-btn:active{ transform:translateY(0); }

/* Interactive modern enhancements - appended */
:root{
  --neon-a: rgba(108,92,231,0.18);
  --neon-b: rgba(59,130,246,0.12);
  --glow: rgba(108,92,231,0.14);
}

/* animated gradient backdrop (subtle, performant) */
body::before{
  content:"";
  position:fixed; inset:0; z-index:0; pointer-events:none;
  background: radial-gradient(600px 280px at 10% 15%, rgba(108,92,231,0.06), transparent 14%),
              radial-gradient(420px 200px at 88% 80%, rgba(59,130,246,0.04), transparent 18%);
  mix-blend-mode:screen;
  opacity:0.95; transform:translateZ(0);
  animation: bgFloat 14s ease-in-out infinite alternate;
}
@keyframes bgFloat{ from{ transform:translateY(0px) } to{ transform:translateY(-8px) } }

/* subtle glow on catalog sheet header area */
.catalog-sheet{ position:relative; z-index:1; }
.catalog-sheet::after{
  content:""; position:absolute; inset:auto 0 0 0; height:120px; pointer-events:none;
  background: linear-gradient(180deg, transparent, rgba(15,23,32,0.7));
  z-index:0;
}

/* stronger hover glow + scale for cards */
.catalog-card{ will-change:transform, box-shadow; transition: transform .34s cubic-bezier(.2,.9,.25,1), box-shadow .34s ease; transform-origin:center; }
.catalog-card:hover{ transform: translateY(-10px) scale(1.02); box-shadow: 0 24px 70px rgba(2,6,23,0.7), 0 8px 30px var(--glow); }

/* card inner highlight for 3D feel */
.card-thumb{ transition: transform .32s ease, box-shadow .32s ease; }
.catalog-card:hover .card-thumb{ transform: translateZ(12px) scale(1.02); box-shadow: 0 10px 30px rgba(2,6,23,0.45), 0 2px 12px rgba(108,92,231,0.06); }

/* CTA ripple via pseudo-element */
.btn-cta{ position:relative; overflow:hidden; }
.btn-cta::after{ content:""; position:absolute; inset:0; background:radial-gradient(circle at var(--rx,50%) var(--ry,50%), rgba(255,255,255,0.12) 0%, transparent 40%); opacity:0; transition: opacity .4s ease, transform .5s cubic-bezier(.2,.8,.2,1); transform:scale(0.6); pointer-events:none; }
.btn-cta:active::after{ opacity:1; transform:scale(1); }

/* springy indicator emphasis */
.cats-indicator{ transition: transform .42s cubic-bezier(.18,1.1,.2,1), width .34s cubic-bezier(.18,1.1,.2,1); box-shadow: 0 8px 30px rgba(108,92,231,0.12); }

/* hero parallax container isolation */
.hero{ perspective:900px; }
.hero-inner{ transition: transform .28s ease; will-change:transform; }

/* micro-interaction: subtle focus ring on cards for keyboard users */
.catalog-card:focus{ outline:2px solid rgba(108,92,231,0.18); outline-offset:4px; }

@media (prefers-reduced-motion:reduce){
  body::before, .catalog-sheet::before, .hero-inner, .catalog-card{ animation:none; transition:none; }
}

/* Landing hero subtle animated background */
.hero{ position:relative; overflow:hidden; }
.hero::before{
  content:"";
  position:absolute;
  inset:-12% -18%;
  pointer-events:none;
  z-index:0;
  mix-blend-mode:screen;
  background: radial-gradient(circle at 18% 30%, rgba(108,92,231,0.10), transparent 16%),
              radial-gradient(circle at 82% 72%, rgba(59,130,246,0.06), transparent 18%);
  transform:translateZ(0);
  animation: heroGlow 18s linear infinite alternate;
}
.hero::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:1;
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.00) 40%, rgba(255,255,255,0.01) 100%);
  opacity:0.6;
  transform:translateZ(0);
  animation: heroShift 28s linear infinite;
}
.hero-inner{ position:relative; z-index:2; }

@keyframes heroGlow{
  0%{ transform: translate(-3%,0) scale(1); filter: blur(0px); }
  100%{ transform: translate(3%,-6%) scale(1.04); filter: blur(6px); }
}
@keyframes heroShift{
  0%{ background-position: 0% 50%; }
  50%{ background-position: 100% 50%; }
  100%{ background-position: 0% 50%; }
}

@media (prefers-reduced-motion:reduce){
  .hero::before, .hero::after{ animation:none; }
}

/* Fullscreen particle canvas for star effects */
#particlesCanvas{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
  z-index:8; /* above backdrop but below UI overlays */
  mix-blend-mode:screen;
  opacity:0.95;
}

/* Slightly stronger hero glow when particles present */
.hero.particles-on::before{ opacity:1.05; }

@media (max-width:680px){
  #particlesCanvas{ opacity:0.6; }
}

/* SITE LOADER: spinner ring and logo bounce */
.site-loader{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg, rgba(11,15,19,0.98), rgba(2,6,23,0.98));
  z-index:2200;
  transition:opacity .36s ease, visibility .36s ease;
}
.site-loader[data-hidden="true"]{ opacity:0; pointer-events:none; visibility:hidden; }
.site-loader .loader-inner{ text-align:center; padding:18px; position:relative; }
.loader-logo{
  height:96px;
  width:auto;
  display:block;
  margin:0 auto;
  position:relative;
  z-index:2;
  transform-origin:center center;
  animation: bounceZoom 900ms cubic-bezier(.2,.9,.2,1) infinite alternate;
}

/* small spinning ring below the logo (non-bouncing) */
.loader-spinner{
  width:56px;
  height:56px;
  margin:18px auto 0;
  border-radius:50%;
  border:4px solid rgba(255,255,255,0.06);
  border-top-color: var(--accent);
  border-right-color: rgba(255,255,255,0.02);
  box-shadow: 0 6px 18px rgba(108,92,231,0.06);
  animation: spin 1s linear infinite;
  z-index:1;
}

@keyframes spin{ to{ transform: rotate(360deg); } }
@keyframes bounceZoom{
  0%{ transform: scale(.88); opacity:0.0; }
  55%{ transform: scale(1.08); opacity:1; }
  80%{ transform: scale(.98); }
  100%{ transform: scale(1); }
}

@media (max-width:520px){
  .loader-logo{ height:72px; }
  .loader-logo::before{ width:110px; height:110px; }
}

/* Premium polish: smoother motion, glow, and graceful hide */
.site-loader{
  backdrop-filter: blur(8px) saturate(1.05);
}
.site-loader .loader-inner{
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  padding: 28px 32px;
  border-radius: 16px;
  box-shadow: 0 30px 90px rgba(2,6,23,0.7), inset 0 1px 0 rgba(255,255,255,0.02);
  transform-origin: center center;
  transition: transform .45s cubic-bezier(.2,.9,.2,1), opacity .36s ease;
}

/* premium continuous gentle bounce with subtle overshoot */
.loader-logo{
  animation: premiumBounce 1700ms cubic-bezier(.2,.9,.22,1) infinite;
  filter: drop-shadow(0 18px 40px rgba(108,92,231,0.12));
}

@keyframes premiumBounce{
  0%{ transform: translateY(0) scale(0.98); }
  30%{ transform: translateY(-10px) scale(1.06); }
  55%{ transform: translateY(-6px) scale(1.03); }
  80%{ transform: translateY(-2px) scale(1.01); }
  100%{ transform: translateY(0) scale(1); }
}

/* spinner refinement: thinner ring, subtle gradient, slower spin */
.loader-spinner{
  border-width:3px;
  width:64px; height:64px;
  margin-top:20px;
  opacity:0.94;
  animation: spin 1.6s cubic-bezier(.2,.7,.2,1) infinite;
}

/* Hide state: fade + scale-down the inner panel for a refined exit */
.site-loader[data-hidden="true"] .loader-inner{
  opacity:0; transform: scale(.98) translateY(-8px);
}

/* when the loader wrapper is hidden, keep pointer-events none and fade */
.site-loader[data-hidden="true"]{ opacity:0; pointer-events:none; }
