/* GiftShakib — 5D depth layer (v1) */
:root {
  --sf-perspective: 1400px;
  --sf-depth-1: 40px;
  --sf-depth-2: 80px;
  --sf-depth-3: 120px;
  --sf-glow: rgba(46, 196, 182, 0.45);
  --sf-glow-soft: rgba(46, 196, 182, 0.12);
  --sf-shadow-5d:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 18px rgba(0, 0, 0, 0.28),
    0 22px 48px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(46, 196, 182, 0.06);
  --sf-shadow-5d-hover:
    0 1px 0 rgba(255, 255, 255, 0.07) inset,
    0 14px 28px rgba(0, 0, 0, 0.34),
    0 32px 64px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(46, 196, 182, 0.22),
    0 0 48px rgba(46, 196, 182, 0.14);
}

html {
  overflow-x: clip;
}
body.sf-5d {
  overflow-x: clip;
  max-width: 100%;
}

/* ── Depth scene (fixed background layers) ── */
.sf-depth-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}

.sf-depth-layer {
  position: absolute;
  will-change: transform;
  transition: transform 0.15s linear;
}

.sf-depth-orb {
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  mix-blend-mode: screen;
}

.sf-depth-orb-1 {
  width: min(55vw, 520px);
  height: min(55vw, 520px);
  top: -12%;
  inset-inline-start: -8%;
  background: radial-gradient(circle, rgba(46, 196, 182, 0.55) 0%, rgba(46, 196, 182, 0) 68%);
  animation: sf-orb-drift-1 22s ease-in-out infinite alternate;
}

.sf-depth-orb-2 {
  width: min(48vw, 440px);
  height: min(48vw, 440px);
  top: 38%;
  inset-inline-end: -10%;
  background: radial-gradient(circle, rgba(56, 120, 200, 0.5) 0%, rgba(56, 120, 200, 0) 70%);
  animation: sf-orb-drift-2 26s ease-in-out infinite alternate;
}

.sf-depth-orb-3 {
  width: min(36vw, 320px);
  height: min(36vw, 320px);
  bottom: 8%;
  inset-inline-start: 28%;
  background: radial-gradient(circle, rgba(120, 80, 220, 0.35) 0%, transparent 72%);
  animation: sf-orb-drift-3 19s ease-in-out infinite alternate;
}

.sf-depth-grid {
  inset: 0;
  opacity: 0.22;
  background:
    linear-gradient(rgba(46, 196, 182, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 196, 182, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.35) 25%, rgba(0, 0, 0, 0.55) 55%, transparent 100%);
  transform-origin: 50% 100%;
  transform: perspective(900px) rotateX(68deg) translateY(18%);
}

.sf-depth-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.65;
}

@keyframes sf-orb-drift-1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4%, 6%, 0) scale(1.08); }
}
@keyframes sf-orb-drift-2 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-5%, -4%, 0) scale(1.06); }
}
@keyframes sf-orb-drift-3 {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(3%, -5%, 0); }
}

/* Content above depth scene */
body.sf-5d > .skip-link {
  position: relative;
  z-index: 110;
}
body.sf-5d > .site-header {
  position: relative;
  z-index: 100;
  overflow: visible;
}
body.sf-5d > main,
body.sf-5d > footer,
body.sf-5d > script,
body.sf-5d > .sf-modal {
  position: relative;
  z-index: 1;
}

/* ── Header glass + lift ── */
body.sf-5d .site-header {
  background: rgba(7, 13, 22, 0.72);
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
  border-bottom-color: rgba(46, 196, 182, 0.12);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 40px rgba(0, 0, 0, 0.28);
}

body.sf-5d .brand img {
  box-shadow:
    0 0 0 1px rgba(46, 196, 182, 0.25),
    0 8px 24px rgba(0, 0, 0, 0.35);
  transform: translateZ(var(--sf-depth-1));
}

/* ── Hero depth panel ── */
body.sf-5d .hero {
  transform-style: preserve-3d;
}

body.sf-5d .hero-content {
  transform-style: preserve-3d;
  transform: translateZ(var(--sf-depth-2));
}

body.sf-5d .hero-content::before {
  content: "";
  position: absolute;
  inset: -1.5rem -1.2rem;
  z-index: -1;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01)),
    rgba(8, 16, 28, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  box-shadow: var(--sf-shadow-5d);
  pointer-events: none;
}

body.sf-5d .hero-compact .hero-content::before {
  inset: -1rem -0.8rem;
  border-radius: 18px;
}

body.sf-5d .hero .btn-primary {
  box-shadow:
    0 0 0 1px rgba(46, 196, 182, 0.35),
    0 10px 28px rgba(46, 196, 182, 0.28),
    0 4px 12px rgba(0, 0, 0, 0.25);
}

body.sf-5d .brand-mark {
  text-shadow:
    0 0 40px rgba(46, 196, 182, 0.25),
    0 2px 24px rgba(0, 0, 0, 0.45);
}

/* ── 3D tilt cards ── */
.sf-tilt {
  transform-style: preserve-3d;
  transform: perspective(var(--sf-perspective)) rotateX(var(--sf-rx, 0deg)) rotateY(var(--sf-ry, 0deg)) translateZ(0);
  transition:
    transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    border-color 0.25s ease;
  will-change: transform;
}

.sf-tilt-inner {
  transform: translateZ(24px);
  transform-style: preserve-3d;
}

/* Category tiles */
body.sf-5d .cat-tile {
  box-shadow: var(--sf-shadow-5d);
  border-color: rgba(255, 255, 255, 0.08);
  transform-style: preserve-3d;
}

body.sf-5d .cat-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -40px 60px rgba(0, 0, 0, 0.35);
  transform: translateZ(2px);
}

body.sf-5d .cat-tile:hover,
body.sf-5d .product-card:hover {
  transform: unset;
}

body.sf-5d .cat-tile:hover {
  box-shadow: var(--sf-shadow-5d-hover);
  border-color: rgba(46, 196, 182, 0.35);
}

body.sf-5d .cat-tile-meta {
  transform: translateZ(32px);
}

body.sf-5d .cat-tile img {
  transform: translateZ(8px) scale(1);
  transition: transform 0.8s var(--ease);
}

body.sf-5d .cat-tile:hover img {
  transform: translateZ(12px) scale(1.06);
}

/* Product cards */
body.sf-5d .product-card {
  position: relative;
  box-shadow: var(--sf-shadow-5d);
  border-color: rgba(255, 255, 255, 0.07);
  transform-style: preserve-3d;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.04), transparent 42%),
    var(--surface);
}

body.sf-5d .product-card::before {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.07), transparent 38%);
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 2;
}

body.sf-5d .product-card:hover::before {
  opacity: 1;
}

body.sf-5d .product-card:hover {
  box-shadow: var(--sf-shadow-5d-hover);
  border-color: rgba(46, 196, 182, 0.38);
}

body.sf-5d .product-body {
  position: relative;
  z-index: 1;
  transform: translateZ(18px);
}

body.sf-5d .media-frame {
  transform: translateZ(10px);
  box-shadow: inset 0 -24px 48px rgba(0, 0, 0, 0.35);
}

body.sf-5d .product-card:hover .media-frame img {
  transform: translateZ(6px) scale(1.06);
}

/* Sections floating panels */
body.sf-5d .section-quiet {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(6px);
}

body.sf-5d .section-head h2,
body.sf-5d .page-hero h1 {
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

body.sf-5d .page-hero {
  position: relative;
}

body.sf-5d .page-hero .container {
  transform: translateZ(var(--sf-depth-1));
}

/* Auth / account cards */
body.sf-5d .auth-card,
body.sf-5d .account-panel,
body.sf-5d .sf-modal-card {
  box-shadow: var(--sf-shadow-5d);
  border-color: rgba(255, 255, 255, 0.1);
  transform-style: preserve-3d;
}

body.sf-5d .product-media {
  box-shadow: var(--sf-shadow-5d);
  transform-style: preserve-3d;
}

/* Buttons glow */
body.sf-5d .btn-primary {
  box-shadow:
    0 0 0 1px rgba(46, 196, 182, 0.2),
    0 8px 22px rgba(46, 196, 182, 0.22);
}

body.sf-5d .btn-primary:hover {
  box-shadow:
    0 0 0 1px rgba(46, 196, 182, 0.4),
    0 12px 32px rgba(46, 196, 182, 0.32);
}

/* Footer depth strip */
body.sf-5d .site-footer {
  position: relative;
  border-top: 1px solid rgba(46, 196, 182, 0.1);
  background:
    linear-gradient(180deg, rgba(7, 13, 22, 0.4), rgba(7, 13, 22, 0.92)),
    var(--bg);
  box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.25);
}

body.sf-5d .site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(46, 196, 182, 0.45), transparent);
  pointer-events: none;
}

/* Enhanced reveal (5D entrance) */
body.sf-5d .reveal {
  transform: translateY(28px) translateZ(-40px) scale(0.98);
  opacity: 0;
}

body.sf-5d .reveal.is-in {
  transform: translateY(0) translateZ(0) scale(1);
  opacity: 1;
}

/* Shine sweep on cat tiles */
@keyframes sf-shine-sweep {
  from { transform: translateX(-120%) skewX(-18deg); }
  to { transform: translateX(220%) skewX(-18deg); }
}

body.sf-5d .cat-tile-shade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.12) 50%, transparent 70%);
  transform: translateX(-120%) skewX(-18deg);
  animation: sf-shine-sweep 6s ease-in-out infinite;
  pointer-events: none;
}

body.sf-5d .cat-tile:nth-child(2n) .cat-tile-shade::after {
  animation-delay: 2.5s;
}

/* Clock widget lift */
body.sf-5d .sf-site-clock {
  box-shadow:
    var(--sf-shadow-5d),
    0 0 24px rgba(46, 196, 182, 0.08);
  transform: translateZ(var(--sf-depth-1));
}

/* ── Slide-in from left / right only ── */
.sf-slide-stage {
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.sf-slide-item {
  opacity: 0;
  transform: translateX(var(--sf-enter-x, 56px));
  will-change: transform, opacity;
}

.sf-slide-item.sf-slide-in {
  animation: sf-slide-enter 1.85s cubic-bezier(0.22, 0.82, 0.28, 1) forwards;
  animation-delay: var(--sf-slide-delay, 0s);
}

.sf-slide-item.sf-slide-done {
  opacity: 1;
  transform: none;
  will-change: auto;
}

@keyframes sf-slide-enter {
  0% {
    opacity: 0;
    transform: translateX(var(--sf-enter-x, 56px));
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  body.sf-5d .sf-depth-orb,
  body.sf-5d .cat-tile-shade::after {
    animation: none !important;
  }
  body.sf-5d .sf-depth-particles {
    display: none;
  }
  .sf-tilt {
    transform: none !important;
  }
  .sf-slide-item {
    opacity: 1;
    transform: none;
    animation: none !important;
  }
  body.sf-5d .reveal {
    transform: translateY(16px);
  }
  body.sf-5d .reveal.is-in {
    transform: none;
  }
}

@media (max-width: 960px) {
  .sf-depth-grid {
    opacity: 0.1;
  }
  .sf-depth-orb {
    filter: blur(48px);
    opacity: 0.35;
  }
  .sf-depth-particles {
    display: none;
  }
  body.sf-5d .hero-content::before {
    display: none;
  }
  body.sf-5d .hero-content,
  body.sf-5d .brand img,
  body.sf-5d .sf-site-clock,
  body.sf-5d .page-hero .container {
    transform: none;
  }
  .sf-tilt,
  body.sf-5d .cat-tile:hover,
  body.sf-5d .product-card:hover {
    transform: none !important;
  }
  .sf-slide-item {
    transform: translateX(var(--sf-enter-x, 28px));
  }
}

@media (max-width: 640px) {
  body.sf-5d .cat-tile-meta strong {
    font-size: 1.2rem;
  }
}
