/* ============================================================
   Sketch-to-Product Scroll Slider — Frontend Styles
   Version 1.3.0
   ============================================================ */

/* ------ Wrapper & Shell ------ */
.stp-slider-wrap{
  --stp-height:100vh;
  --stp-overlay:.45;
  --stp-edge-gap:10px;
  position:relative;
  width:min(100%, calc(100vw - (var(--stp-edge-gap) * 2)));
  min-height:var(--stp-height);
  margin:0 auto;
  overflow:hidden;
  border-radius:28px;
  background:
    radial-gradient(circle at top left, rgba(255,212,0,.14), transparent 28%),
    linear-gradient(145deg, #06070c 0%, #10131c 48%, #07090f 100%);
  box-shadow:0 28px 80px rgba(3,7,18,.32);
}

/* ------ Loading state ------ */
.stp-slider-wrap.stp-is-loading{
  background:linear-gradient(145deg, #0b0e15 0%, #171d29 48%, #0a0d14 100%);
}
.stp-slider-wrap.stp-is-loading .stp-slide,
.stp-slider-wrap.stp-is-loading .stp-controls{
  opacity:0;
  visibility:hidden;
  transition:none !important;
}
.stp-slider-wrap.stp-is-loading .stp-slide.is-active,
.stp-slider-wrap.stp-is-ready .stp-slide.is-active{
  opacity:1;
  visibility:visible;
}
.stp-slider-wrap.stp-is-loading .stp-slider::before,
.stp-slider-wrap.stp-is-loading .stp-slider::after{
  opacity:0;
}
.stp-slider-wrap.stp-is-loading::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:3;
  background:
    radial-gradient(circle at 22% 28%, rgba(255,255,255,.08), transparent 22%),
    radial-gradient(circle at 74% 38%, rgba(255,212,0,.10), transparent 18%),
    linear-gradient(90deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,.09) 24%, rgba(255,255,255,.04) 48%);
  background-size:auto, auto, 220% 100%;
  animation:stpShimmer 1.6s linear infinite;
  pointer-events:none;
}
.stp-slider-wrap.stp-is-loading .stp-slider{
  min-height:var(--stp-height);
}

/* ------ Ready fade-in ------ */
.stp-slider-wrap.stp-is-ready{
  animation:stpFadeIn .28s ease-out;
}

/* ------ Full-bleed / edge-to-edge ------ */
.stp-slider-wrap.stp-full-bleed{
  width:calc(100vw - (var(--stp-edge-gap) * 2));
  max-width:calc(100vw - (var(--stp-edge-gap) * 2));
  margin-left:calc(50% - 50vw + var(--stp-edge-gap));
  margin-right:calc(50% - 50vw + var(--stp-edge-gap));
}

/* ------ Inner slider ------ */
.stp-slider{
  position:relative;
  min-height:var(--stp-height);
  isolation:isolate;
  border-radius:inherit;
  border:1px solid rgba(255,255,255,.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0)),
    #05060a;
}
.stp-slider::before{
  content:"";
  position:absolute;
  inset:auto auto -120px -120px;
  width:320px;
  height:320px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(255,212,0,.16) 0%, rgba(255,212,0,0) 72%);
  z-index:1;
  pointer-events:none;
}
.stp-slider::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    linear-gradient(transparent 0, transparent calc(100% - 1px), rgba(255,255,255,.05) calc(100% - 1px)),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size:100% 100%, 120px 120px;
  opacity:.14;
  mix-blend-mode:screen;
  pointer-events:none;
  z-index:1;
}

/* ------ Slides ------ */
.stp-slide{
  position:absolute;
  inset:0;
  opacity:0;
  visibility:hidden;
  transform:translate3d(0, 70px, 0) scale(.985);
  transition:opacity .75s ease, transform .9s cubic-bezier(.22,.61,.36,1), visibility .75s ease;
  color:var(--stp-text, #f5ece6);
  will-change:transform, opacity;
}
.stp-slide.is-active{
  opacity:1;
  visibility:visible;
  transform:translate3d(0, 0, 0) scale(1);
  z-index:3;
}
.stp-slide.is-leaving-up{
  opacity:0;
  visibility:hidden;
  transform:translate3d(0, -70px, 0) scale(.985);
  z-index:2;
}

/* ------ Background image ------ */
.stp-slide-bg{
  position:absolute;
  inset:0;
  background-position:center;
  background-size:cover;
  transform:scale(1.05);
  transition:transform 1.2s ease;
}
.stp-slide.is-active .stp-slide-bg{
  transform:scale(1);
}
.stp-slide-bg--default{
  background:
    radial-gradient(circle at 65% 30%, rgba(255,255,255,.16), transparent 18%),
    radial-gradient(circle at 50% 40%, rgba(255,255,255,.06), transparent 22%),
    linear-gradient(120deg, #07090f 0%, #12161f 45%, #07090f 100%);
}

/* ------ Dark overlay ------ */
.stp-overlay{
  position:absolute;
  inset:0;
  background:
    linear-gradient(90deg, rgba(4,6,10,.84) 0%, rgba(4,6,10,.30) 48%, rgba(4,6,10,.74) 100%),
    linear-gradient(180deg, rgba(0,0,0,.26) 0%, rgba(0,0,0,.14) 100%);
  opacity:var(--stp-overlay);
}

/* ------ Badge ------ */
.stp-badge{
  position:absolute;
  top:26px;
  left:26px;
  z-index:7;
  display:inline-flex;
  flex-direction:column;
  gap:6px;
}
.stp-badge span{
  display:inline-block;
  width:fit-content;
  background:linear-gradient(135deg, var(--stp-accent, #ffd400), #ffe88a);
  color:#05060a;
  padding:8px 12px;
  font-weight:800;
  font-size:13px;
  line-height:1;
  letter-spacing:.08em;
  text-transform:uppercase;
  border-radius:999px;
  box-shadow:0 14px 30px rgba(0,0,0,.18);
}
.stp-badge span:last-child{
  background:rgba(255,255,255,.10);
  color:#fff;
  backdrop-filter:blur(8px);
}

/* ============================================================
   MAIN GRID — Mobile-first default (≤767 px)
   Layout: step + visual in row 1, copy full-width, meta full-width
   ============================================================ */
.stp-grid{
  position:relative;
  z-index:5;
  min-height:var(--stp-height);
  display:grid;
  /* Left narrow col (step / meta), Right wide col (visual) */
  grid-template-columns: minmax(90px, 110px) 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "step  visual"
    "copy  visual"
    "meta  visual";
  gap:12px 16px;
  padding:80px 18px 76px;
  box-sizing:border-box;
}

/* ============================================================
   LEFT-COLUMN ELEMENTS
   ============================================================ */

/* Step number */
.stp-step{
  grid-area:step;
  position:relative;
  z-index:2;
  align-self:end;
  transform:translate3d(0, 24px, 0);
  opacity:0;
  transition:opacity .85s ease, transform .95s cubic-bezier(.22,.61,.36,1);
}
.stp-slide.is-active .stp-step{
  transform:translate3d(0, 0, 0);
  opacity:1;
}
.stp-step-no{
  font-size:clamp(44px, 11vw, 80px);
  line-height:.9;
  font-weight:900;
  color:var(--stp-accent, #ffd400);
  text-shadow:0 14px 30px rgba(0,0,0,.24);
}

/* Headline */
.stp-copy{
  grid-area:copy;
  align-self:start;
  position:relative;
  z-index:2;
  transform:translate3d(0, 36px, 0);
  opacity:0;
  transition:opacity .85s ease, transform .95s cubic-bezier(.22,.61,.36,1);
  /* FIX: no max-width constraint — let the grid column control width */
}
.stp-copy::after{
  content:"";
  display:block;
  width:60px;
  height:3px;
  margin-top:14px;
  border-radius:999px;
  background:linear-gradient(90deg, var(--stp-accent, #ffd400), rgba(255,255,255,.18));
}
.stp-slide.is-active .stp-copy{
  transform:translate3d(0, 0, 0);
  opacity:1;
}
.stp-copy h2{
  margin:0;
  font-size:clamp(30px, 10vw, 52px);
  line-height:.95;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:-.04em;
  color:var(--stp-text, #f5ece6);
  /* FIX: allow headline to wrap freely — no max-width in ch units here */
  word-break:break-word;
  overflow-wrap:break-word;
  text-shadow:0 14px 28px rgba(0,0,0,.28);
}

/* Meta / side-menu
   FIX: always in grid flow — never absolutely positioned.
   This prevents it from ever overlapping the headline. */
.stp-meta{
  grid-area:meta;
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:10px;
  align-self:end;
  /* Push meta to sit flush at the bottom of its grid row */
  padding-bottom:4px;
  transform:translate3d(0, 8px, 0);
  opacity:0;
  transition:opacity .85s ease, transform .95s cubic-bezier(.22,.61,.36,1);
}
.stp-slide.is-active .stp-meta{
  transform:translate3d(0, 0, 0);
  opacity:1;
}

/* Side menu list */
.stp-side-menu{
  list-style:none;
  margin:0;
  padding:10px 12px 10px 14px;
  display:flex;
  flex-direction:column;
  gap:6px;
  width:fit-content;
  min-width:110px;
  max-width:160px;
  border-radius:14px;
  background:linear-gradient(180deg, rgba(8,12,20,.80), rgba(8,12,20,.55));
  border:1px solid rgba(255,255,255,.10);
  box-shadow:0 10px 24px rgba(0,0,0,.22);
  backdrop-filter:blur(16px);
}
.stp-side-menu li{
  position:relative;
  padding:0 0 0 16px;
  color:rgba(255,255,255,.54);
  font-size:clamp(11px, 1.1vw, 14px);
  line-height:1.25;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.07em;
  transition:color .35s ease;
}
.stp-side-menu li::before{
  content:"";
  position:absolute;
  left:0;
  top:50%;
  width:7px;
  height:7px;
  border-radius:50%;
  background:rgba(255,255,255,.20);
  transform:translateY(-50%);
}
.stp-side-menu li.is-current{
  color:var(--stp-accent, #ffd400);
}
.stp-side-menu li.is-current::before{
  background:var(--stp-accent, #ffd400);
  box-shadow:0 0 0 5px rgba(255,212,0,.14);
}

/* ============================================================
   RIGHT-COLUMN VISUAL (image + description stacked)
   FIX: description is now inside .stp-visual as a flex child,
   always below the image — never overlapping it.
   ============================================================ */
.stp-visual{
  grid-area:visual;
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;       /* image on top, description below */
  align-items:flex-end;        /* both right-aligned */
  justify-content:flex-start;
  gap:10px;
  padding:8px 0 18px;  /* bottom gap keeps description clear of the slider border */
  /* make sure visual fills its grid rows */
  align-self:stretch;
}
.stp-visual::before{
  content:"";
  position:absolute;
  inset:10% 8%;
  border-radius:50%;
  background:radial-gradient(circle, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 70%);
  filter:blur(12px);
  pointer-events:none;
}

/* Product image */
.stp-visual img{
  display:block;
  max-width:100%;
  width:auto;
  /* FIX: flexible height — takes available space but never overflows */
  max-height:52vh;
  object-fit:contain;
  filter:drop-shadow(0 22px 50px rgba(0,0,0,.50));
  transform:translate3d(0, 40px, 0) scale(.96);
  opacity:0;
  position:relative;
  z-index:1;
  transition:opacity .85s ease, transform .95s cubic-bezier(.22,.61,.36,1);
  flex-shrink:1;
  /* keep image from growing beyond available space */
  min-height:0;
}
.stp-slide.is-active .stp-visual img{
  transform:translate3d(0, 0, 0) scale(1);
  opacity:1;
}

/* Description — now a flex child inside .stp-visual, below the image */
.stp-desc{
  /* FIX: removed position:absolute — now in normal flow inside .stp-visual */
  position:relative;
  /* FIX: push description to bottom of the visual column whether or not
     a featured image is present — margin-top:auto absorbs all free space above */
  margin-top:auto;
  width:100%;
  max-width:420px;
  font-size:clamp(13px, 1.1vw, 16px);
  line-height:1.55;
  color:rgba(255,255,255,.92);
  text-align:left;
  transform:translate3d(0, 24px, 0);
  opacity:0;
  padding:13px 16px;
  border-radius:16px;
  background:rgba(7,11,19,.48);
  border:1px solid rgba(255,255,255,.09);
  box-shadow:0 12px 28px rgba(0,0,0,.18);
  backdrop-filter:blur(14px);
  text-wrap:pretty;
  flex-shrink:0;
  transition:opacity .85s ease, transform .95s cubic-bezier(.22,.61,.36,1);
}
.stp-slide.is-active .stp-desc{
  transform:translate3d(0, 0, 0);
  opacity:1;
}

/* ============================================================
   CONTROLS BAR (prev · dots · next)
   FIX: use proper SVG-based arrows; fix dot shape reset for all browsers
   ============================================================ */
.stp-controls{
  position:absolute;
  left:50%;
  bottom:16px;
  transform:translateX(-50%);
  z-index:10;
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(8,12,20,.62);
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 12px 36px rgba(0,0,0,.28);
  backdrop-filter:blur(14px);
  white-space:nowrap;
}

/* Arrow buttons */
.stp-nav{
  /* FIX: explicit reset for every browser */
  -webkit-appearance:none;
  appearance:none;
  margin:0;
  padding:0;
  border:none;
  background:rgba(255,255,255,.12);
  color:#fff;
  width:38px;
  height:38px;
  min-width:38px;
  border-radius:50%;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:background .22s ease, color .22s ease, transform .22s ease;
  flex-shrink:0;
}
.stp-nav:hover,
.stp-nav:focus-visible{
  background:var(--stp-accent, #ffd400);
  color:#05060a;
  transform:translateY(-1px);
  outline:none;
}
/* SVG arrow icons (inline via CSS mask) */
.stp-prev::before,
.stp-next::before{
  content:"";
  display:block;
  width:18px;
  height:18px;
  background-color:currentColor;
  -webkit-mask-repeat:no-repeat;
  mask-repeat:no-repeat;
  -webkit-mask-position:center;
  mask-position:center;
  -webkit-mask-size:contain;
  mask-size:contain;
  flex-shrink:0;
}
.stp-prev::before{
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z' fill='currentColor'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z' fill='currentColor'/%3E%3C/svg%3E");
}
.stp-next::before{
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z' fill='currentColor'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z' fill='currentColor'/%3E%3C/svg%3E");
}

/* Dot indicators */
.stp-dots{
  display:flex;
  align-items:center;
  gap:7px;
}
.stp-dot{
  /* FIX: explicit reset — browsers sometimes apply padding/border to buttons */
  -webkit-appearance:none;
  appearance:none;
  margin:0;
  padding:0;
  border:none;
  width:9px;
  height:9px;
  min-width:9px;
  border-radius:50% !important;  /* !important overrides any theme button reset */
  background:rgba(255,255,255,.35);
  cursor:pointer;
  display:block;
  flex-shrink:0;
  transition:transform .3s ease, background .3s ease, width .3s ease;
}
.stp-dot.is-active{
  width:24px;
  border-radius:999px !important;
  background:var(--stp-accent, #ffd400);
}
.stp-dot:focus-visible{
  outline:2px solid var(--stp-accent, #ffd400);
  outline-offset:3px;
}

/* ------ Empty state ------ */
.stp-empty{
  padding:18px 20px;
  border:1px dashed #ccd1d9;
  border-radius:12px;
  background:#fafafa;
}

/* ------ Keyframe animations ------ */
@keyframes stpShimmer{
  0%  { background-position:center, center, 200% 0; }
  100%{ background-position:center, center, -20% 0; }
}
@keyframes stpFadeIn{
  from{ opacity:.01; transform:translateY(6px); }
  to  { opacity:1;   transform:translateY(0); }
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ------ 768–1100 px: tablet layout ------ */
@media (min-width: 768px) and (max-width: 1100px){
  .stp-slider-wrap{ border-radius:20px; }

  .stp-grid{
    grid-template-columns: minmax(140px, 180px) 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "step  visual"
      "copy  visual"
      "meta  visual";
    gap:14px 22px;
    padding:88px 28px 80px;
  }

  .stp-step-no{ font-size:clamp(52px, 8vw, 90px); }

  .stp-copy h2{
    font-size:clamp(34px, 6.5vw, 68px);
  }

  .stp-visual img{ max-height:48vh; }

  .stp-desc{
    max-width:360px;
    font-size:14px;
  }

  .stp-side-menu{
    min-width:130px;
    max-width:175px;
  }
}

/* ------ ≥ 1101 px: desktop layout ------ */
@media (min-width: 1101px){
  .stp-slider-wrap{ border-radius:28px; }

  .stp-grid{
    /* FIX: 3-area left column keeps step / copy / meta in natural flow,
       so the headline NEVER overlaps the side menu regardless of length */
    grid-template-columns: minmax(280px, .90fr) minmax(300px, .85fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "step  visual"
      "copy  visual"
      "meta  visual";
    gap:16px 44px;
    padding:96px clamp(32px, 4vw, 60px) 80px;
  }

  .stp-step-no{ font-size:clamp(60px, 6.5vw, 110px); }

  .stp-copy{
    max-width:none;        /* let the grid column be the constraint */
    padding-right:12px;
  }
  .stp-copy h2{
    font-size:clamp(44px, 5.4vw, 84px);
    line-height:.92;
  }
  .stp-copy::after{ width:90px; height:4px; margin-top:20px; }

  .stp-visual{
    padding:0 0 0 0;
    gap:14px;
  }
  .stp-visual img{
    max-height:55vh;
    max-width:min(100%, 560px);
  }

  .stp-desc{
    max-width:100%;
    font-size:clamp(14px, 1.05vw, 17px);
  }

  .stp-side-menu{
    min-width:150px;
    max-width:210px;
    font-size:clamp(12px, 1vw, 15px);
  }

  .stp-nav{ width:42px; height:42px; min-width:42px; }
  .stp-prev::before,
  .stp-next::before{ width:20px; height:20px; }
}

/* ------ ≤ 767 px: mobile layout ------ */
@media (max-width: 767px){
  .stp-slider-wrap,
  .stp-slider{
    min-height:max(580px, min(100vh, var(--stp-height)));
    border-radius:18px;
  }

  .stp-grid{
    min-height:max(580px, min(100vh, var(--stp-height)));
    grid-template-columns: minmax(128px, 42%) minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "step  visual"
      "copy  visual"
      "meta  visual";
    gap:10px 14px;
    padding:70px 16px 68px;
  }

  .stp-step-no{ font-size:clamp(38px, 12vw, 60px); }

  .stp-copy{
    min-width:0;
    padding-right:6px;
  }
  .stp-copy h2{
    font-size:clamp(22px, 7vw, 34px);
    line-height:.92;
    word-break:normal;
    overflow-wrap:normal;
    text-wrap:balance;
  }
  .stp-copy::after{ width:50px; height:3px; margin-top:12px; }

  .stp-visual img{
    max-height:34vh;
    max-width:min(100%, 240px);
    object-position:right center;
  }

  .stp-desc{
    font-size:13px;
    line-height:1.5;
    padding:10px 12px;
    border-radius:12px;
    max-width:100%;
  }

  .stp-side-menu{
    padding:8px 10px 8px 12px;
    gap:5px;
    min-width:95px;
    max-width:130px;
    border-radius:11px;
  }
  .stp-side-menu li{
    font-size:10px;
    padding:0 0 0 13px;
    letter-spacing:.05em;
  }
  .stp-side-menu li::before{ width:6px; height:6px; }

  .stp-badge{ top:16px; left:16px; }
  .stp-badge span{ font-size:10px; padding:5px 9px; }

  .stp-controls{
    bottom:12px;
    padding:7px 10px;
    gap:8px;
  }
  .stp-nav{ width:34px; height:34px; min-width:34px; }
  .stp-prev::before,
  .stp-next::before{ width:16px; height:16px; }
  .stp-dot{ width:7px; height:7px; min-width:7px; }
  .stp-dot.is-active{ width:20px; }
}

/* ------ Landscape phones ------ */
@media (max-width: 767px) and (orientation: landscape){
  .stp-slider-wrap,
  .stp-slider{
    min-height:max(420px, min(100vh, var(--stp-height)));
  }
  .stp-grid{
    min-height:max(420px, min(100vh, var(--stp-height)));
    padding:52px 18px 62px;
  }
  .stp-visual img{ max-height:60vh; }
}

/* ------ prefers-reduced-motion ------ */
@media (prefers-reduced-motion: reduce){
  .stp-slide,
  .stp-slide-bg,
  .stp-copy,
  .stp-step,
  .stp-meta,
  .stp-desc,
  .stp-visual img{
    transition:opacity .3s ease !important;
    transform:none !important;
  }
  .stp-slider-wrap.stp-is-loading::before{ animation:none !important; }
  .stp-slider-wrap.stp-is-ready{ animation:none !important; }
}
