/* =====================================================
   Premium AI Try-On Studio — try/index.php only
   GPU-friendly motion, glass, cinematic loading
   ===================================================== */

.fit-ai-page {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  -webkit-text-size-adjust: 100%;
  --fit-violet: rgba(124, 92, 255, 0.55);
  --fit-magenta: rgba(214, 76, 178, 0.38);
  --fit-blue: rgba(56, 189, 248, 0.28);
  --fit-glass: rgba(255, 255, 255, 0.045);
  --fit-glass-border: rgba(255, 255, 255, 0.12);
}

.fit-ai-page .bg-glow-global {
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(99, 102, 241, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 90% 60% at 100% 30%, rgba(168, 85, 247, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 0% 70%, rgba(56, 189, 248, 0.08) 0%, transparent 45%),
    linear-gradient(180deg, #050508 0%, #070712 40%, #06060a 100%);
}

.fit-ai-aurora {
  position: absolute;
  inset: -40% -20%;
  background:
    conic-gradient(from 210deg at 50% 50%,
      rgba(124, 92, 255, 0.09),
      rgba(56, 189, 248, 0.06),
      rgba(214, 76, 178, 0.07),
      rgba(124, 92, 255, 0.09));
  animation: fitAuroraSpin 28s linear infinite;
  opacity: 0.85;
  pointer-events: none;
  filter: blur(70px);
}

@media (prefers-reduced-motion: reduce) {
  .fit-ai-aurora { animation: none; opacity: 0.45; }
}

@keyframes fitAuroraSpin {
  to { transform: rotate(360deg); }
}

.fit-ai-noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.fit-ai-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.fit-ai-particles span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 18px rgba(147, 197, 253, 0.35);
  animation: fitParticle 14s ease-in-out infinite;
}
.fit-ai-particles span:nth-child(1) { left: 12%; top: 22%; animation-delay: 0s; }
.fit-ai-particles span:nth-child(2) { left: 78%; top: 18%; animation-delay: 2s; }
.fit-ai-particles span:nth-child(3) { left: 64%; top: 72%; animation-delay: 4s; }
.fit-ai-particles span:nth-child(4) { left: 28%; top: 58%; animation-delay: 1s; }
.fit-ai-particles span:nth-child(5) { left: 44%; top: 32%; animation-delay: 3.5s; }
.fit-ai-particles span:nth-child(6) { left: 88%; top: 56%; animation-delay: 5s; }

@keyframes fitParticle {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.35; }
  50% { transform: translate3d(8px, -24px, 0) scale(1.2); opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
  .fit-ai-particles span { animation: none; opacity: 0.25; }
}

/* ----- Floating nav ----- */
.fit-ai-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 0.65rem 1rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(6, 7, 12, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fit-ai-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.fit-ai-brand-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.65rem 0.35rem 0.35rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.fit-ai-nav-link {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  transition: color 0.2s ease;
}
.fit-ai-nav-link:hover { color: rgba(255, 255, 255, 0.95); }

/* ----- Страница try: компактный футер всегда внизу колонки (рядом с flex-1 main) ----- */
.fit-ai-footer {
  flex-shrink: 0;
}

.fit-ai-footer__text {
  font-size: clamp(9px, 2.1vmin, 11px);
  color: rgba(255, 255, 255, 0.22);
  letter-spacing: 0.01em;
}

.fit-ai-footer__link {
  color: rgba(255, 255, 255, 0.32);
  text-decoration: none;
  transition: color 0.15s ease;
}

.fit-ai-footer__link:hover {
  color: rgba(255, 255, 255, 0.48);
}

/* ----- Glass buttons (try studio) ----- */
.fit-ai-btn-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.15rem;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}
.fit-ai-btn-glass:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 16px 48px -24px rgba(124, 92, 255, 0.55);
}

/* ----- Step rail ----- */
.fit-step-rail-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem 1.25rem;
}

.fit-step-rail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  align-items: stretch;
}

@media (min-width: 768px) {
  .fit-step-rail {
    display: flex;
    align-items: center;
    gap: 0;
  }
}

.fit-step-card {
  position: relative;
  flex: 1;
  padding: 0.85rem 0.65rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}

@media (min-width: 768px) {
  .fit-step-card {
    padding: 1rem 1rem;
    border-radius: 20px;
  }
}

.fit-step-card.active {
  border-color: rgba(147, 151, 255, 0.42);
  box-shadow:
    0 0 0 1px rgba(124, 92, 255, 0.18),
    0 20px 60px -28px rgba(124, 92, 255, 0.38);
  transform: translateY(-1px);
}

.fit-step-card.done {
  border-color: rgba(52, 211, 153, 0.35);
}

.fit-step-icon {
  font-size: 1.35rem;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.fit-step-label {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.02em;
}

.fit-step-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
}

.fit-step-line {
  display: none;
}

@media (min-width: 768px) {
  .fit-step-line {
    display: block;
    flex: 0 0 48px;
    height: 2px;
    align-self: center;
    border-radius: 9999px;
    background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(147,151,255,.55), rgba(255,255,255,.08));
    opacity: 0.35;
    overflow: hidden;
    position: relative;
  }
  .fit-step-line::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
    transform: translateX(-100%);
    animation: fitStepFlow 2.8s ease-in-out infinite;
  }
}

@keyframes fitStepFlow {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .fit-step-line::after { animation: none; }
}

/* ----- Upload runway ----- */
.fit-upload-shell {
  position: relative;
  border-radius: 26px;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(147, 151, 255, 0.35),
    rgba(255, 255, 255, 0.06),
    rgba(214, 76, 178, 0.28)
  );
  background-size: 200% 200%;
  animation: fitBorderShift 8s ease infinite;
}

@keyframes fitBorderShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .fit-upload-shell { animation: none; }
}

.fit-upload-inner {
  border-radius: 25px;
  background: rgba(10, 11, 18, 0.82);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  overflow: hidden;
  position: relative;
}

.fit-upload-zone {
  position: relative;
  min-height: 280px;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: background 0.25s ease;
}

@media (min-width: 1024px) {
  .fit-upload-zone { min-height: 320px; padding: 2rem; }
}

.fit-upload-zone:hover {
  background: rgba(255, 255, 255, 0.02);
}

.fit-upload-zone.is-drag {
  background: rgba(124, 92, 255, 0.09);
}

.fit-upload-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.55;
}

.fit-upload-scan::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 42%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(147, 197, 253, 0.06),
    transparent
  );
  animation: fitScan 3.2s ease-in-out infinite;
}

@keyframes fitScan {
  0% { transform: translateY(-100%); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(220%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .fit-upload-scan::before { animation: none; opacity: 0; }
}

.fit-upload-mesh {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at 50% 35%, black 0%, transparent 72%);
}

.fit-upload-silhouette {
  width: 112px;
  height: auto;
  opacity: 0.5;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.55));
}

.fit-upload-title {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.fit-upload-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.48);
  margin-top: 0.35rem;
}

.fit-upload-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin-top: 1rem;
}

.fit-tip-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.55rem;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.92);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ----- Product runway ----- */
.fit-catalog-scroll {
  max-height: min(52vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
}

.fit-product-card {
  position: relative;
  border-radius: 26px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

.fit-product-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(147, 151, 255, 0.28);
  box-shadow:
    0 24px 70px -34px rgba(0, 0, 0, 0.85),
    0 0 48px -24px rgba(124, 92, 255, 0.35);
}

.fit-product-card.selected {
  border-color: rgba(147, 151, 255, 0.55);
  box-shadow:
    0 0 0 1px rgba(124, 92, 255, 0.22),
    0 28px 80px -30px rgba(124, 92, 255, 0.45);
}

.fit-product-visual {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 1;
  background: #0c0d14;
}

/* Горизонтальный свайп обрабатывает Alpine; вертикаль — скролл страницы. Pinch страницы отключён viewport’ом, зум — только в модалке. */
.fit-product-carousel {
  touch-action: pan-y;
}

.fit-product-carousel__viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

.fit-product-carousel__track {
  display: flex;
  height: 100%;
  will-change: transform;
}

.fit-product-carousel__slide {
  height: 100%;
  min-height: 0;
}

.fit-product-carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.fit-product-card:hover .fit-product-carousel__slide img {
  transform: scale(1.06);
}

.fit-product-carousel__zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(6, 7, 12, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.fit-product-carousel__zoom:hover {
  transform: scale(1.05);
  background: rgba(6, 7, 12, 0.85);
}

.fit-product-carousel__zoom:active {
  transform: scale(0.96);
}

.fit-product-carousel__arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  translate: 0 -50%;
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(6, 7, 12, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.fit-product-carousel__arrow svg {
  width: 18px;
  height: 18px;
}

.fit-product-card:hover .fit-product-carousel__arrow,
.fit-product-card:focus-visible .fit-product-carousel__arrow {
  opacity: 1;
}

.fit-product-carousel__arrow--prev {
  left: 8px;
}

.fit-product-carousel__arrow--next {
  right: 8px;
}

.fit-product-carousel__arrow:active {
  transform: translateY(-50%) scale(0.94);
}

@media (max-width: 1023px) {
  .fit-product-carousel__arrow {
    opacity: 0.92;
  }
}

.fit-product-carousel__dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 9999px;
  background: rgba(6, 7, 12, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.fit-product-carousel__dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.35);
  transition: transform 0.2s ease, background 0.2s ease;
}

.fit-product-carousel__dot.is-active {
  background: rgba(255, 255, 255, 0.92);
  transform: scale(1.25);
}

.fit-catalog-zoom-layer {
  overscroll-behavior: contain;
}

.fit-product-ai-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 9px;
  border-radius: 9999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(6, 7, 12, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

.fit-product-cta {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.fit-product-cta span.name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.94);
  word-break: break-word;
  overflow-wrap: anywhere;
  min-height: 2.7em;
}

.fit-product-cta span.try-btn {
  align-self: flex-start;
  padding: 7px 14px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  color: #fff;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.95), rgba(79, 70, 229, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 36px -16px rgba(124, 92, 255, 0.65);
}

.fit-product-card.selected .fit-product-cta span.try-btn {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.95), rgba(16, 185, 129, 0.88));
  box-shadow: 0 12px 36px -16px rgba(16, 185, 129, 0.55);
}

.fit-panel {
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 32px 90px -44px rgba(0, 0, 0, 0.85);
  /* В grid вторую колонку иначе «раздувает» min-content и обрезает справа на ПК */
  min-width: 0;
  max-width: 100%;
}

/* ----- Stage canvas (preview / result) ----- */
.fit-stage-frame {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(124, 92, 255, 0.08), #070712);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 40px 100px -44px rgba(0, 0, 0, 0.9);
}

.fit-stage-loading {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(4, 5, 10, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.fit-stage-loading--immersive {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.fit-ai-process-stack {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

.fit-ai-process-photo-wrap {
  position: absolute;
  inset: 0;
}

.fit-ai-process-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
  filter: saturate(1.08) contrast(1.04);
  animation: fitAiProcessKen 10s ease-in-out infinite alternate;
}

.fit-ai-process-post {
  position: absolute;
  inset: 0;
  mix-blend-mode: overlay;
  background:
    radial-gradient(ellipse 90% 70% at 50% 40%, rgba(147, 197, 253, 0.14), transparent 62%),
    radial-gradient(ellipse 80% 50% at 70% 80%, rgba(192, 132, 252, 0.1), transparent 55%);
  opacity: 0.95;
  pointer-events: none;
}

.fit-ai-process-grid {
  position: absolute;
  inset: -2%;
  opacity: 0.22;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(147, 197, 253, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(192, 132, 252, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  animation: fitAiGridDrift 14s linear infinite;
  mask-image: radial-gradient(ellipse 72% 68% at 50% 48%, black 12%, transparent 72%);
}

.fit-ai-process-scan {
  position: absolute;
  left: -5%;
  right: -5%;
  top: -25%;
  height: 42%;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(56, 189, 248, 0.06) 35%,
    rgba(147, 197, 253, 0.35) 50%,
    rgba(192, 132, 252, 0.22) 52%,
    rgba(56, 189, 248, 0.06) 68%,
    transparent 100%
  );
  filter: blur(0.5px);
  animation: fitAiScanSweep 2.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  mix-blend-mode: screen;
}

.fit-ai-process-shimmer {
  position: absolute;
  inset: -40%;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 42%,
    rgba(255, 255, 255, 0.07) 48%,
    rgba(147, 197, 253, 0.18) 50%,
    rgba(255, 255, 255, 0.06) 52%,
    transparent 58%
  );
  animation: fitAiShimmer 4.5s ease-in-out infinite;
  mix-blend-mode: soft-light;
}

.fit-ai-process-reticle {
  position: absolute;
  inset: 10%;
  pointer-events: none;
  opacity: 0.85;
}

.fit-ai-process-reticle svg {
  width: 100%;
  height: 100%;
}

.fit-ai-reticle-path {
  animation: fitAiReticlePulse 2s ease-in-out infinite;
}

.fit-ai-process-pulse {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(147, 197, 253, 0.22),
    0 0 0 0 rgba(147, 197, 253, 0.15);
  animation: fitAiRingPulse 2.4s ease-out infinite;
}

.fit-ai-process-fallback {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 35%, rgba(124, 92, 255, 0.12), #070712);
}

.fit-neural--solo {
  inset: 6%;
  opacity: 0.5;
}

.fit-ai-loading-copy--immersive {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  width: 100%;
  max-width: none;
  margin-top: 0;
  padding: 1.35rem 1rem 1.35rem;
  box-sizing: border-box;
  border-radius: 0 0 28px 28px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(4, 5, 10, 0.72) 28%,
    rgba(4, 5, 10, 0.92) 100%
  );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.fit-ai-loading-copy--immersive .fit-ai-loading-title {
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.88);
}

.fit-ai-loading-copy--immersive .fit-ai-loading-stage {
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.85);
}

.fit-ai-loading-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.65rem;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(124, 92, 255, 0.22);
  border: 1px solid rgba(147, 197, 253, 0.28);
  box-shadow: 0 0 28px -8px rgba(147, 197, 253, 0.45);
}

.fit-ai-loading-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: rgba(52, 211, 153, 0.95);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.65);
  animation: fitAiChipBlink 1.2s ease-in-out infinite;
}

@keyframes fitAiProcessKen {
  0% { transform: scale(1.03) translate(0, 0); }
  100% { transform: scale(1.07) translate(-0.8%, 0.6%); }
}

@keyframes fitAiGridDrift {
  0% { transform: translate(0, 0); opacity: 0.18; }
  50% { opacity: 0.28; }
  100% { transform: translate(-24px, -18px); opacity: 0.18; }
}

@keyframes fitAiScanSweep {
  0% { transform: translateY(-115%); opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { transform: translateY(320%); opacity: 0; }
}

@keyframes fitAiShimmer {
  0%, 100% { transform: translate(-18%, -8%) rotate(0deg); opacity: 0.35; }
  50% { transform: translate(14%, 10%) rotate(2deg); opacity: 0.85; }
}

@keyframes fitAiReticlePulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@keyframes fitAiRingPulse {
  0% {
    box-shadow:
      inset 0 0 0 1px rgba(147, 197, 253, 0.35),
      0 0 0 0 rgba(147, 197, 253, 0.25);
  }
  70% {
    box-shadow:
      inset 0 0 0 1px rgba(147, 197, 253, 0.08),
      0 0 0 28px rgba(147, 197, 253, 0);
  }
  100% {
    box-shadow:
      inset 0 0 0 1px rgba(147, 197, 253, 0.35),
      0 0 0 0 rgba(147, 197, 253, 0);
  }
}

@keyframes fitAiChipBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.92); }
}

@media (prefers-reduced-motion: reduce) {
  .fit-ai-process-photo {
    animation: none;
    transform: scale(1.04);
  }
  .fit-ai-process-grid,
  .fit-ai-process-scan,
  .fit-ai-process-shimmer,
  .fit-ai-reticle-path,
  .fit-ai-process-pulse,
  .fit-ai-loading-chip-dot {
    animation: none;
  }
  .fit-ai-process-scan {
    top: 38%;
    height: 22%;
    opacity: 0.65;
    transform: none;
  }
}

.fit-neural {
  position: absolute;
  inset: 8%;
  opacity: 0.35;
  pointer-events: none;
}

.fit-neural svg {
  width: 100%;
  height: 100%;
}

.fit-ai-loading-copy {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 1.25rem;
}

/* Обычный режим загрузки (не поверх фото): узкая колонка текста */
.fit-ai-loading-copy:not(.fit-ai-loading-copy--immersive) {
  max-width: 22rem;
}

.fit-ai-loading-title {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.fit-ai-loading-stage {
  margin-top: 0.65rem;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.62);
  min-height: 2.5rem;
  transition: opacity 0.45s ease;
}

.fit-ai-loading-bar {
  margin-top: 1.25rem;
  height: 4px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.fit-ai-loading-bar > i {
  display: block;
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.15), rgba(147, 197, 253, 0.95), rgba(214, 76, 178, 0.85));
  box-shadow: 0 0 24px rgba(147, 197, 253, 0.35);
  transition: width 0.35s ease;
}

.fit-result-img {
  position: absolute;
  inset: 0;
  opacity: 0;
  filter: blur(18px) saturate(1.05);
  transform: scale(1.04);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    filter 1s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.05s cubic-bezier(0.22, 1, 0.36, 1);
}

.fit-result-img.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

.fit-result-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.fit-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.fit-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
}

.fit-chip.active {
  border-color: rgba(147, 151, 255, 0.55);
  box-shadow: 0 0 24px -10px rgba(124, 92, 255, 0.55);
}

.fit-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.fit-action-grid .fit-ai-btn-glass {
  width: 100%;
  border-radius: 16px;
  padding: 0.75rem 0.65rem;
}

.fit-primary-runway {
  width: 100%;
  border-radius: 18px;
  padding: 1rem 1.15rem;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  border: 0;
  cursor: pointer;
  background: linear-gradient(135deg, #7c5cff 0%, #6366f1 45%, #c084fc 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 24px 70px -28px rgba(124, 92, 255, 0.75);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.fit-primary-runway:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 30px 90px -28px rgba(192, 132, 252, 0.55);
}

.fit-primary-runway:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Mobile sticky dock */
.fit-mobile-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(5, 6, 10, 0.92) 28%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (min-width: 1024px) {
  .fit-mobile-dock { display: none; }
}

.fit-mobile-dock-inner {
  max-width: 560px;
  margin: 0 auto;
}

/* Compare in studio — match aspect */
.fit-stage-frame .compare.compare--contain-full {
  position: absolute;
  inset: 0;
  aspect-ratio: unset;
  border-radius: 0;
  border: 0;
  background: #070712;
}

.fit-stage-frame .compare.compare--contain-full img {
  object-fit: contain;
  object-position: center center;
}

/* Modal polish */
.fit-modal-dark {
  background: rgba(3, 4, 8, 0.94);
  backdrop-filter: blur(18px);
}

.fit-modal-close {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.2s ease, transform 0.2s ease;
}

.fit-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.03);
}

/* Utility */
.fit-ai-page .no-scrollbar::-webkit-scrollbar { display: none; }
.fit-ai-page .no-scrollbar { scrollbar-width: none; }

/* =====================================================
   Одноэкранный режим try (без прокрутки документа)
   ===================================================== */
html:has(body.fit-try-viewport-lock) {
  height: 100%;
  overflow: hidden;
}

body.fit-try-viewport-lock {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.fit-ai-page--viewport {
  height: 100vh;
  max-height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
}

.fit-ai-page--viewport > .fit-ai-nav {
  flex-shrink: 0;
  position: relative;
}

@media (min-width: 1024px) {
  .fit-stage-frame.fit-stage-frame--fill-height {
    aspect-ratio: unset;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
  }

  .fit-stage-frame.fit-stage-frame--fill-height .compare.compare--contain-full {
    height: 100%;
    width: 100%;
  }
}

.fit-upload-shell--flex {
  min-height: 0;
}

.fit-upload-shell--flex .fit-upload-zone {
  min-height: 0 !important;
}

@media (min-width: 1024px) {
  /* ПК: зона загрузки не схлопывается в flex; читаемые отступы */
  .fit-ai-page--viewport .fit-upload-shell--flex .fit-upload-zone {
    min-height: clamp(300px, 38vh, 460px) !important;
    padding: 1.35rem 1.35rem 1.5rem !important;
    justify-content: center;
  }

  .fit-ai-page--viewport .fit-upload-shell--flex .fit-upload-zone:not(:hover) {
    background: rgba(255, 255, 255, 0.015);
  }

  .fit-ai-page--viewport .fit-panel--desktop-photo .fit-upload-silhouette {
    width: min(148px, 22vw);
    max-height: 240px;
    opacity: 0.58;
    margin-bottom: 1rem;
  }

  .fit-ai-page--viewport .fit-panel--desktop-photo .fit-upload-title {
    font-size: 1.22rem;
    line-height: 1.25;
    max-width: 22rem;
    margin-inline: auto;
  }

  .fit-ai-page--viewport .fit-panel--desktop-photo .fit-upload-hint {
    font-size: 13px;
    line-height: 1.45;
    max-width: 24rem;
    margin-inline: auto;
    margin-top: 0.45rem;
    color: rgba(255, 255, 255, 0.52);
  }

  .fit-ai-page--viewport .fit-panel--desktop-photo .fit-upload-tips {
    margin-top: 1.15rem;
    gap: 0.45rem;
    max-width: 26rem;
    margin-inline: auto;
  }

  .fit-ai-page--viewport .fit-panel--desktop-photo .fit-tip-pill {
    font-size: 12px;
    padding: 0.3rem 0.65rem;
  }

  /* Studio (3 колонки): каталог в сетке 2×N — компактные квадратные превью */
  .fit-ai-page--viewport .fit-workbench--desktop-studio .fit-product-card {
    padding: 10px 11px;
  }

  .fit-ai-page--viewport .fit-workbench--desktop-studio .fit-product-visual {
    aspect-ratio: 1 / 1;
    border-radius: 18px;
  }

  .fit-ai-page--viewport .fit-panel--desktop-pick .fit-product-cta span.name {
    font-size: 14px;
    line-height: 1.35;
  }

  .fit-ai-page--viewport .fit-panel--desktop-pick .fit-product-cta span.try-btn {
    font-size: 12px;
  }

  .fit-ai-page--viewport .fit-panel--desktop-pick .tabular-nums {
    font-size: 13px;
  }

  /* Узкая колонка «Фото» — зона загрузки не выталкивает сетку */
  .fit-ai-page--viewport .fit-workbench--desktop-studio .fit-upload-shell--flex .fit-upload-zone {
    min-height: clamp(248px, 32vh, 400px) !important;
    padding: 1.15rem 1.15rem 1.35rem !important;
  }

  /* Три колонки студии: читаемые границы и глубина */
  .fit-ai-page--viewport .fit-desktop-col-photo.fit-panel,
  .fit-ai-page--viewport .fit-desktop-col-result.fit-panel {
    background: linear-gradient(165deg, rgba(14, 15, 24, 0.96) 0%, rgba(8, 9, 14, 0.78) 100%);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.06),
      0 28px 85px -42px rgba(0, 0, 0, 0.88);
  }

  .fit-ai-page--viewport .fit-desktop-col-mid {
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.085);
    background: rgba(11, 12, 20, 0.76);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.045),
      0 26px 72px -46px rgba(124, 92, 255, 0.28);
    padding: 0.75rem 0.85rem 0.85rem;
  }

  .fit-ai-page--viewport .fit-desktop-col-mid > .fit-panel {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.022);
    border: 1px solid rgba(255, 255, 255, 0.055);
    box-shadow: none;
  }

  /* Шаги сверху — чуть крупнее на широком экране */
  .fit-ai-page--viewport .fit-step-rail-wrap--studio-desktop {
    padding-bottom: 0.65rem;
    max-width: 1440px;
  }

  .fit-ai-page--viewport .fit-step-rail--studio-desktop .fit-step-card {
    min-height: 80px;
    padding: 0.95rem 1.1rem;
  }

  .fit-ai-page--viewport .fit-step-rail--studio-desktop .fit-step-icon {
    font-size: 1.45rem;
    margin-bottom: 0.25rem;
  }

  .fit-ai-page--viewport .fit-step-rail--studio-desktop .fit-step-label {
    font-size: 13px;
  }

  .fit-ai-page--viewport .fit-step-rail--studio-desktop .fit-step-sub {
    font-size: 11px;
    line-height: 1.35;
  }

  .fit-ai-page--viewport .fit-step-rail--studio-desktop .fit-step-line {
    flex-basis: 56px;
    opacity: 0.42;
  }
}

/* Каталог заполняет оставшуюся высоту левой колонки; прокрутка только внутри сетки */
.fit-catalog-scroll--fill {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.fit-ai-page--viewport .fit-catalog-scroll--fill {
  scrollbar-width: thin;
}

.fit-ai-page--viewport .fit-step-rail-wrap {
  padding-bottom: 0.35rem;
}

.fit-ai-page--viewport .fit-step-card {
  padding: 0.55rem 0.5rem;
}

.fit-ai-page--viewport .fit-step-icon {
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}

.fit-ai-page--viewport .fit-step-label {
  font-size: 12px;
}

.fit-ai-page--viewport .fit-step-sub {
  font-size: 10px;
}

.fit-ai-page--viewport .fit-product-card:hover {
  transform: translateY(-2px) scale(1.01);
}

/* ----- Полноэкранный просмотр результата (мобильный крестик всегда в хроме) ----- */
.fit-result-fullscreen {
  touch-action: manipulation;
}

.fit-result-fullscreen button {
  touch-action: manipulation;
}

.fit-catalog-zoom-layer button {
  touch-action: manipulation;
}

.fit-result-fullscreen__stage {
  isolation: isolate;
}

/* Тулбар закреплён по верху внутри рамки фото (не отдельная полоса экрана) */
.fit-result-fullscreen__viewport {
  isolation: isolate;
}

.fit-result-fullscreen__inphoto-toolbar {
  position: absolute;
  inset-inline: 0;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding-inline: 0.5rem;
  padding-top: max(0.35rem, env(safe-area-inset-top, 0px));
  padding-bottom: 0.45rem;
}

/* Подписи До/После на слайдере — ниже оверлея с переключателем */
.fit-result-fullscreen .fit-result-fullscreen__compare .compare-pill {
  position: absolute;
  top: calc(3.35rem + env(safe-area-inset-top, 0px));
  z-index: 6;
}

.fit-result-fullscreen .fit-result-fullscreen__compare .compare-pill--accent-left {
  left: 12px;
}

.fit-result-fullscreen .fit-result-fullscreen__compare .compare-pill--accent-right {
  right: 12px;
}

.fit-result-fullscreen .fit-result-fullscreen__compare.compare--modal-fit {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  aspect-ratio: unset;
}

.fit-result-fullscreen .fit-result-fullscreen__img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

@media (max-width: 480px) {
  .fit-result-fullscreen .fit-result-fullscreen__compare .compare-pill {
    font-size: 10px;
    padding: 0.25rem 0.55rem;
    top: calc(3.15rem + env(safe-area-inset-top, 0px));
  }
}

/* ----- Контент блоков под размер панели (try viewport), без вылезания ----- */
.fit-ai-page--viewport .fit-panel {
  container-type: inline-size;
  container-name: fitblk;
}

.fit-ai-page--viewport .fit-upload-title {
  font-size: clamp(0.78rem, 2.6vmin + 0.32rem, 1.05rem);
  line-height: 1.22;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.fit-ai-page--viewport .fit-upload-hint {
  font-size: clamp(10px, 2.35vmin, 12px);
  line-height: 1.35;
  overflow-wrap: anywhere;
  padding-inline: 0.25rem;
}

.fit-ai-page--viewport .fit-upload-tips {
  gap: clamp(0.2rem, 1vmin, 0.35rem);
  margin-top: clamp(0.45rem, 2vmin, 1rem);
}

.fit-ai-page--viewport .fit-tip-pill {
  font-size: clamp(9px, 2vmin, 11px);
  padding: clamp(0.15rem, 0.8vmin, 0.25rem) clamp(0.4rem, 1.6vmin, 0.55rem);
  max-width: 100%;
}

.fit-ai-page--viewport .fit-upload-silhouette {
  width: clamp(52px, 19vmin, 112px);
  margin-bottom: clamp(0.35rem, 1.8vmin, 0.75rem);
}

.fit-ai-page--viewport .fit-ai-loading-title {
  font-size: clamp(1rem, 4.2vmin + 0.35rem, 1.28rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
  padding-inline: 0.35rem;
}

.fit-ai-page--viewport .fit-ai-loading-stage {
  font-size: clamp(11px, 2.6vmin, 13px);
  line-height: 1.35;
  min-height: 0;
  overflow-wrap: anywhere;
  padding-inline: 0.35rem;
}

.fit-ai-page--viewport .fit-ai-loading-copy--immersive {
  padding-left: clamp(0.65rem, 3vmin, 1rem);
  padding-right: clamp(0.65rem, 3vmin, 1rem);
  padding-bottom: clamp(0.65rem, 2.5vmin, 1.35rem);
}

.fit-ai-page--viewport .fit-ai-loading-chip {
  font-size: clamp(9px, 2vmin, 10px);
}

.fit-ai-page--viewport .fit-product-card {
  padding: clamp(6px, 1.6vmin, 10px);
}

.fit-ai-page--viewport .fit-product-cta span.name {
  font-size: clamp(11px, 2.65vmin, 13px);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 0;
  max-height: 2.75em;
}

.fit-ai-page--viewport .fit-product-cta span.try-btn {
  font-size: clamp(10px, 2.3vmin, 11px);
  padding: clamp(5px, 1.4vmin, 7px) clamp(10px, 2.6vmin, 14px);
}

.fit-ai-page--viewport .fit-product-ai-badge {
  font-size: clamp(8px, 1.9vmin, 9px);
  padding: clamp(3px, 0.9vmin, 4px) clamp(7px, 1.8vmin, 9px);
}

.fit-ai-page--viewport .fit-selected-strip-thumb {
  width: clamp(2.75rem, 11vmin, 4rem);
  height: clamp(2.75rem, 11vmin, 4rem);
}

@container fitblk (max-width: 300px) {
  .fit-product-carousel__zoom {
    width: 32px;
    height: 32px;
  }

  .fit-product-carousel__arrow {
    width: 30px;
    height: 30px;
  }
}

.fit-ai-page--viewport .fit-stage-frame img {
  max-width: 100%;
  max-height: 100%;
}

.fit-ai-page--viewport .fit-result-toolbar .fit-chip {
  font-size: clamp(11px, 2.5vmin, 12px);
  padding: 0.35rem 0.65rem;
}
