/* =====================================================
   tryon.kz — Virtual Try-On UI (eTryon-inspired)
   Light, minimal, yellow accent — /try/ only
   ===================================================== */

@import url('etryon-tokens.css');

html:has(body.fit-try-viewport-lock) {
  height: 100%;
}

body.fit-try-viewport-lock {
  overflow: hidden !important;
  background: var(--et-bg);
  color: var(--et-text);
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  margin: 0;
  display: flex !important;
  flex-direction: column !important;
}

body.fit-try-viewport-lock > .bg-glow {
  display: none !important;
}

body.fit-try-viewport-lock > .etryon,
body.fit-try-viewport-lock > .etryon-page-backdrop {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-height: 100%;
}

body.fit-try-viewport-lock .bg-glow {
  display: none;
}

.etryon {
  font-family: var(--et-font);
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--et-bg);
  color: var(--et-text);
  -webkit-font-smoothing: antialiased;
}

.etryon-shell {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  background: var(--et-surface);
  box-shadow: var(--et-shadow);
  overflow: hidden;
}

@media (min-width: 640px) {
  .etryon {
    padding: 1rem;
    justify-content: center;
  }
  .etryon-shell {
    max-height: calc(100dvh - 2rem);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--et-border);
  }
}

/* ----- Header ----- */
.etryon-header {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 0.85rem 1rem 0.35rem;
  gap: 0.5rem;
}

.etryon-header__center {
  text-align: center;
  min-width: 0;
}

.etryon-header__product {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: var(--et-muted);
  line-height: 1.25;
}

.etryon-header__btn--ghost {
  visibility: hidden;
  pointer-events: none;
}

.etryon-trust-strip {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.75rem;
  padding: 0 1rem 0.5rem;
  font-size: 0.65rem;
  color: var(--et-muted);
}

.etryon-trust-strip__item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.etryon-trust-strip__item svg {
  flex-shrink: 0;
  color: var(--et-accent-hover);
}

.etryon-header__btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--et-border);
  background: var(--et-surface);
  color: var(--et-text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s;
}
.etryon-header__btn:hover { background: #f9fafb; }

.etryon-header__title {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

/* ----- Steps ----- */
.etryon-steps {
  flex: 0 0 auto;
  padding: 0 1.25rem 0.75rem;
}

.etryon-steps__label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--et-muted);
  text-align: center;
  margin: 0 0 0.5rem;
}

.etryon-steps__bars {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.etryon-steps__bar {
  height: 4px;
  width: 72px;
  max-width: 42%;
  border-radius: 999px;
  background: #e8eaef;
  transition: background 0.25s;
}
.etryon-steps__bar.is-active,
.etryon-steps__bar.is-done {
  background: var(--et-accent);
}

/* ----- Body: всё пространство между шагами и футером ----- */
.etryon-body {
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* ----- Main scroll area ----- */
.etryon-main {
  position: absolute;
  inset: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 1.25rem 1rem;
  -webkit-overflow-scrolling: touch;
}

/* ----- Catalog pane ----- */
.etryon-catalog-pane {
  position: absolute;
  inset: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 1.25rem 0;
  overflow: hidden;
}

/* ----- Step 1: Upload illustration ----- */
.etryon-illus {
  border: 1px solid var(--et-border);
  border-radius: var(--et-radius);
  background: #fafafa;
  padding: 1.25rem 1rem 1rem;
  margin-bottom: 0.85rem;
}

.etryon-illus__scene {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 140px;
}

.etryon-illus__person {
  width: 88px;
  height: 120px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f0f1f4 0%, #e8eaef 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.etryon-illus__person svg {
  width: 70%;
  height: auto;
  opacity: 0.55;
}
.etryon-illus__person svg path,
.etryon-illus__person svg ellipse,
.etryon-illus__person svg rect,
.etryon-illus__person svg circle {
  stroke: rgba(107, 114, 128, 0.42) !important;
  opacity: 1 !important;
}

.etryon-illus__plus {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--et-accent);
  color: var(--et-accent-text);
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px -6px rgba(245, 197, 24, 0.55);
  flex-shrink: 0;
}

.etryon-illus__product {
  width: 88px;
  height: 120px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--et-border);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.etryon-illus__product img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.etryon-illus__product-placeholder {
  font-size: 2rem;
  opacity: 0.35;
}

.etryon-upload-step__hint {
  margin: 0 0 0.65rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--et-text);
}

.etryon-photo-tips--inline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.etryon-photo-tip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  line-height: 1.2;
}

.etryon-photo-tip--good {
  background: #f3f4f6;
  color: var(--et-muted);
  border: 1px solid var(--et-border);
}

.etryon-recent-link {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem;
  border: 0;
  background: none;
  font-size: 0.75rem;
  color: var(--et-muted);
  text-decoration: underline;
  cursor: pointer;
}

.etryon-recent-link:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: none;
}

.etryon-recent-link:not(:disabled):hover {
  color: var(--et-text);
}

/* ----- Action cards (upload / take / recent) ----- */
.etryon-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.etryon-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 88px;
  padding: 0.85rem 0.5rem;
  border: 1px solid var(--et-border);
  border-radius: var(--et-radius-sm);
  background: var(--et-surface);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--et-text);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.etryon-action-card--camera {
  border-color: rgba(245, 197, 24, 0.55);
  background: #fffef5;
}

@media (max-width: 767px) {
  .etryon-actions {
    grid-template-columns: 1fr;
  }
  .etryon-action-card--camera {
    order: -2;
    min-height: 96px;
  }
  .etryon-action-card--gallery {
    order: -1;
  }
}

.etryon-action-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 14px -8px rgba(0, 0, 0, 0.12);
}
.etryon-action-card svg {
  width: 22px;
  height: 22px;
  color: var(--et-muted);
}

.etryon-action-wide {
  grid-column: 1 / -1;
  flex-direction: row;
  min-height: 56px;
  gap: 0.5rem;
}
.etryon-action-wide:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ----- Step 2: Photo preview ----- */
.etryon-photo-frame {
  position: relative;
  border-radius: var(--et-radius);
  overflow: hidden;
  background: #f0f1f4;
  aspect-ratio: 3 / 4;
  max-height: min(52dvh, 420px);
  margin: 0 auto 1rem;
}

.etryon-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.etryon-change-photo {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--et-text);
  cursor: pointer;
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.25);
}

/* ----- Primary CTA ----- */
.etryon-cta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: var(--et-radius-sm);
  background: linear-gradient(180deg, #f8d030 0%, var(--et-accent) 45%, #e0ad00 100%);
  color: var(--et-accent-text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 28px -10px rgba(245, 197, 24, 0.65);
  transition: transform 0.15s, box-shadow 0.15s;
}
.etryon-cta:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px -10px rgba(245, 197, 24, 0.75);
}
.etryon-cta:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.etryon-cta__thumb {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
  background: #fff;
}
.etryon-cta__label {
  flex: 1;
  text-align: center;
  padding-right: 40px;
}

/* ----- Product picker grid ----- */
.etryon-catalog__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex-shrink: 0;
}

.etryon-catalog__filters--gender {
  margin-bottom: 0.45rem;
}

.etryon-catalog__filters--category {
  margin-bottom: 0.65rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--et-border);
}

.etryon-filter-pill {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--et-border);
  background: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--et-muted);
  cursor: pointer;
}
.etryon-filter-pill.is-active {
  border-color: var(--et-accent);
  background: #fffbeb;
  color: var(--et-text);
}

.etryon-product-grid {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: min-content;
  gap: 0.55rem;
  align-content: start;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
  scrollbar-gutter: stable;
}

.etryon-product-card {
  border: 2px solid var(--et-border);
  border-radius: var(--et-radius-sm);
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: border-color 0.15s;
}
.etryon-product-card.is-selected {
  border-color: var(--et-accent);
  box-shadow: 0 0 0 1px var(--et-accent);
}
.etryon-product-card__img {
  aspect-ratio: 1;
  width: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #f3f4f6;
}
.etryon-product-card__name {
  padding: 0.4rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ----- Placement (furniture) ----- */
.etryon-placement {
  margin-bottom: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--et-border);
  border-radius: var(--et-radius-sm);
  background: #fafafa;
}
.etryon-placement__canvas-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  width: 100%;
  margin: 0.5rem auto;
  line-height: 0;
}
.etryon-placement__bg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}
.etryon-placement__mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  touch-action: none;
  cursor: crosshair;
}
.etryon-placement canvas {
  max-width: 100%;
  touch-action: none;
}
.etryon-placement__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

/* ----- Loading / Generating ----- */
.etryon-generating {
  text-align: center;
  padding: 0.5rem 0 0.75rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.etryon-loading-compose {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  min-height: 0;
}

.etryon-loading-scene {
  position: relative;
  width: 100%;
  max-width: min(100%, 280px);
  margin: 0 auto;
  aspect-ratio: 4 / 5;
  max-height: min(52dvh, 340px);
  border-radius: 16px;
  overflow: hidden;
  background: #e8eaef;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 16px 40px -20px rgba(17, 24, 39, 0.22);
  isolation: isolate;
}

.etryon-loading-scene__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  animation: etryonScenePulse 2.6s ease-in-out infinite;
}

.etryon-loading-scene__fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.etryon-loading-scene__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 197, 24, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 197, 24, 0.07) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.5;
  animation: etryonGridPulse 2.2s ease-in-out infinite;
}

.etryon-loading-scene__sweep {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #f5c518 40%, #fff9c4 50%, #f5c518 60%, transparent);
  box-shadow: 0 0 16px rgba(245, 197, 24, 0.75);
  animation: etryonSceneSweep 2.4s ease-in-out infinite;
}

.etryon-loading-scene__shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 42%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 58%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: etryonSceneShimmer 2.8s ease-in-out infinite;
}

.etryon-loading-scene__pulse {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border: 2px dashed rgba(245, 197, 24, 0.55);
  border-radius: 999px;
  z-index: 3;
  pointer-events: none;
  animation: etryonPulseTarget 2s ease-in-out infinite;
}

.etryon-loading-product {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px -8px rgba(0, 0, 0, 0.18);
  text-align: left;
  animation: etryonProductSlideIn 0.45s ease-out;
}

.etryon-loading-product__thumb {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: contain;
  object-position: center;
  background: #f3f4f6;
  border: 1px solid var(--et-border);
}

.etryon-loading-product__meta {
  min-width: 0;
  flex: 1;
}

.etryon-loading-product__label {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--et-accent-hover);
  margin-bottom: 0.15rem;
}

.etryon-loading-product__name {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--et-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes etryonScenePulse {
  0%, 100% { filter: brightness(0.98) saturate(0.96); }
  50% { filter: brightness(1.03) saturate(1.02); }
}

@keyframes etryonSceneSweep {
  0%, 100% { top: 8%; opacity: 0.45; }
  50% { top: 88%; opacity: 1; }
}

@keyframes etryonSceneShimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

@keyframes etryonPulseTarget {
  0%, 100% { transform: scale(0.92); opacity: 0.35; }
  50% { transform: scale(1.08); opacity: 0.85; }
}

@keyframes etryonProductSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.etryon-loading-slow {
  padding: 0.45rem 0.65rem;
  border-radius: var(--et-radius-sm);
  background: #fffef5;
  border: 1px solid rgba(245, 197, 24, 0.35);
  font-size: 0.75rem;
  color: var(--et-muted);
}

.etryon-scan-wrap {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto 1.25rem;
  border-radius: 999px;
  overflow: visible;
  isolation: isolate;
}
.etryon-scan-wrap img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  object-position: center top;
  animation: etryonPhotoPulse 2.4s ease-in-out infinite;
}
.etryon-scan-ring {
  position: absolute;
  inset: -5px;
  border-radius: 999px;
  border: 2px solid transparent;
  border-top-color: var(--et-accent);
  border-right-color: rgba(245, 197, 24, 0.45);
  animation: etryonRingSpin 1.35s linear infinite;
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 0 0 4px rgba(245, 197, 24, 0.12), 0 16px 40px -12px rgba(245, 197, 24, 0.45);
}
.etryon-scan-ring::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  border: 1px dashed rgba(245, 197, 24, 0.35);
  animation: etryonRingSpin 4s linear infinite reverse;
}
.etryon-scan-grid {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  clip-path: circle(50% at 50% 50%);
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(245, 197, 24, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 197, 24, 0.08) 1px, transparent 1px);
  background-size: 14px 14px;
  opacity: 0.55;
  animation: etryonGridPulse 2s ease-in-out infinite;
  overflow: hidden;
}
.etryon-scan-line {
  position: absolute;
  left: 6%;
  right: 6%;
  height: 2px;
  border-radius: 999px;
  clip-path: circle(50% at 50% 50%);
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, #f5c518 35%, #fff9c4 50%, #f5c518 65%, transparent);
  box-shadow: 0 0 14px rgba(245, 197, 24, 0.95), 0 0 4px rgba(255, 255, 255, 0.6);
  animation: etryonScanSweep 2.1s ease-in-out infinite;
}
.etryon-scan-shimmer {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  clip-path: circle(50% at 50% 50%);
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 0%,
    transparent 42%,
    rgba(255, 255, 255, 0.28) 50%,
    transparent 58%,
    transparent 100%
  );
  background-size: 220% 100%;
  animation: etryonShimmerSweep 2.8s ease-in-out infinite;
  mix-blend-mode: soft-light;
}
.etryon-scan-pixels {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  clip-path: circle(50% at 50% 50%);
  z-index: 3;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 28%, rgba(245, 197, 24, 0.55) 0 2px, transparent 2px),
    radial-gradient(circle at 72% 38%, rgba(245, 197, 24, 0.45) 0 2px, transparent 2px),
    radial-gradient(circle at 42% 68%, rgba(245, 197, 24, 0.5) 0 3px, transparent 3px),
    radial-gradient(circle at 82% 72%, rgba(245, 197, 24, 0.4) 0 2px, transparent 2px),
    radial-gradient(circle at 55% 45%, rgba(255, 255, 255, 0.35) 0 1px, transparent 1px);
  animation: etryonPixel 1.4s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes etryonRingSpin {
  to { transform: rotate(360deg); }
}
@keyframes etryonScanSweep {
  0%, 100% { top: 10%; opacity: 0.55; }
  50% { top: 86%; opacity: 1; }
}
@keyframes etryonShimmerSweep {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}
@keyframes etryonGridPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.7; }
}
@keyframes etryonPhotoPulse {
  0%, 100% { filter: saturate(0.88) brightness(0.98); }
  50% { filter: saturate(1.05) brightness(1.04); }
}
@keyframes etryonPixel {
  from { opacity: 0.3; transform: scale(1); }
  to { opacity: 0.9; transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .etryon-scan-wrap img,
  .etryon-scan-ring,
  .etryon-scan-ring::after,
  .etryon-scan-grid,
  .etryon-scan-line,
  .etryon-scan-shimmer,
  .etryon-scan-pixels,
  .etryon-loading-scene__photo,
  .etryon-loading-scene__grid,
  .etryon-loading-scene__sweep,
  .etryon-loading-scene__shimmer,
  .etryon-loading-scene__pulse,
  .etryon-loading-product {
    animation: none !important;
  }
  .etryon-scan-line,
  .etryon-loading-scene__sweep { top: 50%; opacity: 0.7; }
}

.etryon-badge-dark {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: #374151;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  max-width: 100%;
}

.etryon-generating__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.85rem;
  color: var(--et-text);
  line-height: 1.35;
}

.etryon-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--et-muted);
  margin-bottom: 0.35rem;
  padding: 0 0.15rem;
}
.etryon-progress-meta strong {
  color: var(--et-accent-hover);
}

.etryon-progress-bar {
  height: 4px;
  border-radius: 999px;
  background: #e8eaef;
  overflow: hidden;
  margin-bottom: 1rem;
}
.etryon-progress-bar i {
  display: block;
  height: 100%;
  background: var(--et-accent);
  border-radius: inherit;
  transition: width 0.4s ease;
}

.etryon-tip-box {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(245, 197, 24, 0.45);
  border-radius: var(--et-radius-sm);
  background: #fffef5;
  font-size: 0.8rem;
  color: var(--et-muted);
  line-height: 1.45;
}
.etryon-tip-box::before {
  content: "●";
  color: var(--et-accent);
  margin-right: 0.4rem;
}

/* ----- Upload overlay ----- */
.etryon-upload-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  border-radius: inherit;
}

.etryon-upload-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--et-border);
  box-shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.2);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--et-muted);
}

.etryon-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #e5e7eb;
  border-top-color: var(--et-muted);
  border-radius: 999px;
  animation: etryonSpin 0.7s linear infinite;
}
@keyframes etryonSpin { to { transform: rotate(360deg); } }

/* ----- Result ----- */
.etryon-result-block {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.etryon-result-block.is-revealed {
  opacity: 1;
}

.etryon-result-head {
  text-align: center;
  margin-bottom: 0.75rem;
}
.etryon-result-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.etryon-result-head p {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--et-muted);
}

.etryon-result-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.etryon-btn-secondary--compact {
  padding: 0.45rem 0.65rem;
  font-size: 0.68rem;
  letter-spacing: 0;
  text-transform: none;
  width: auto;
  flex: 0 1 auto;
}

.etryon-cta--wa {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.etryon-cta--wa .etryon-cta__label {
  color: #166534;
}

.etryon-cta__wa-icon {
  flex-shrink: 0;
}

.etryon-result-frame {
  position: relative;
  width: 100%;
  border: none;
  padding: 0;
  border-radius: var(--et-radius);
  overflow: hidden;
  background: #f0f1f4;
  aspect-ratio: 3 / 4;
  max-height: min(52dvh, 420px);
  margin: 0 auto 1rem;
}

/* Result swipe carousel (как в соцсетях) */
.etryon-result-slider {
  position: relative;
  width: 100%;
  height: 100%;
  contain: layout style paint;
}

.etryon-result-slider__track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x;
}

.etryon-result-slider__track::-webkit-scrollbar {
  display: none;
}

.etryon-result-slider__slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
}

.etryon-result-slider__tap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
}

.etryon-result-slider__tap:focus-visible {
  outline: 2px solid var(--et-accent);
  outline-offset: -2px;
}

.etryon-result-slider__tap img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  object-position: center center;
  background: #f0f1f4;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.etryon-result-slider__meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 1.5rem 0.75rem 0.65rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45) 0%, transparent 100%);
  pointer-events: none;
  text-align: center;
}

.etryon-result-slider__dots {
  display: flex;
  gap: 5px;
  justify-content: center;
  align-items: center;
}

.etryon-result-slider__dots button {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  pointer-events: auto;
  transition: width 0.2s ease, background 0.2s ease;
}

.etryon-result-slider__dots button.is-active {
  width: 18px;
  background: #fff;
}

.etryon-result-slider__label {
  margin: 0.35rem 0 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.02em;
}

/* Floating actions on result (как в референсе) */
.etryon-result-fab {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.etryon-result-fab__btn {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.16);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.etryon-result-fab__btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.22);
  background: #fff;
}

.etryon-result-fab__btn:active {
  transform: scale(0.96);
}

.etryon-result-fab__btn:focus-visible {
  outline: 2px solid var(--et-accent);
  outline-offset: 2px;
}

.etryon-result-fab--fs {
  top: max(58px, calc(env(safe-area-inset-top) + 52px));
  right: max(12px, env(safe-area-inset-right));
  z-index: 6;
}

/* Fullscreen result (как в соцсетях) */
.etryon-fs-viewer {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 0 max(12px, env(safe-area-inset-bottom));
  touch-action: pan-x;
}

.etryon-fs-slider {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  contain: layout style paint;
}

.etryon-fs-slider__track {
  display: flex;
  width: 100%;
  height: 100%;
  max-height: calc(100dvh - 100px);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x;
}

.etryon-fs-slider__track::-webkit-scrollbar {
  display: none;
}

.etryon-fs-slider__slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  box-sizing: border-box;
}

.etryon-fs-slider__slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center center;
  user-select: none;
  -webkit-user-drag: none;
}

.etryon-fs-slider__meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(64px, calc(12px + env(safe-area-inset-bottom) + 44px));
  z-index: 2;
  text-align: center;
  pointer-events: none;
}

.etryon-fs-slider__dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
}

.etryon-fs-slider__dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  pointer-events: auto;
  transition: width 0.2s ease, background 0.2s ease;
}

.etryon-fs-slider__dots button.is-active {
  width: 20px;
  background: #fff;
}

.etryon-fs-slider__label {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}
.etryon-fs-viewer__close {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: 10px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s;
}
.etryon-fs-viewer__close:hover {
  background: rgba(255, 255, 255, 0.24);
}

.etryon-fs-viewer__toolbar {
  position: absolute;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100% - 24px);
}

.etryon-fs-viewer__tool {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.etryon-fs-viewer__tool:hover {
  background: rgba(255, 255, 255, 0.26);
}

.etryon-result-badge {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 2px solid #fff;
  object-fit: cover;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.3);
}

.etryon-result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.etryon-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: var(--et-radius-sm);
  border: 1px solid var(--et-border);
  background: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--et-text);
  cursor: pointer;
}
.etryon-btn-secondary:hover { background: #f9fafb; }

/* ----- Product bar (footer) ----- */
.etryon-product-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--et-border);
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
}

.etryon-product-bar__info {
  flex: 1;
  min-width: 0;
}
.etryon-product-bar__name {
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.etryon-product-bar__price {
  font-size: 0.75rem;
  color: var(--et-muted);
  margin: 0.15rem 0 0;
}

.etryon-product-bar__change {
  flex-shrink: 0;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--et-border);
  background: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--et-text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.etryon-product-bar__change:hover {
  background: #fffbeb;
  border-color: var(--et-accent);
}

.etryon-product-bar__thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: contain;
  background: #f3f4f6;
  border: 1px solid var(--et-border);
  flex-shrink: 0;
  background: #f3f4f6;
}

/* ----- Legal footer ----- */
.etryon-legal {
  flex: 0 0 auto;
  padding: 0.5rem 1.25rem 0.75rem;
  font-size: 0.68rem;
  line-height: 1.45;
  color: #9ca3af;
  text-align: center;
  border-top: 1px solid var(--et-border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.etryon-legal__trust {
  color: var(--et-muted);
}

.etryon-legal a {
  color: var(--et-muted);
  text-decoration: underline;
}

a.etryon-btn-secondary {
  text-decoration: none;
  box-sizing: border-box;
}

/* ----- Lead modal ----- */
.etryon-lead-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: end center;
  padding: 0;
}
@media (min-width: 640px) {
  .etryon-lead-overlay { place-items: center; padding: 1rem; }
}

.etryon-lead-panel {
  width: 100%;
  max-width: 420px;
  background: var(--et-surface);
  border-radius: 24px 24px 0 0;
  padding: 1.5rem;
  box-shadow: var(--et-shadow);
}
@media (min-width: 640px) {
  .etryon-lead-panel { border-radius: 20px; }
}

.etryon-lead-panel .label {
  color: var(--et-text);
  font-size: 0.85rem;
}
.etryon-lead-panel .input,
.etryon-lead-panel .textarea {
  background: #f9fafb;
  border-color: var(--et-border);
  color: var(--et-text);
  border-radius: 12px;
}
.etryon-lead-panel .btn-primary {
  background: linear-gradient(180deg, #f8d030 0%, var(--et-accent) 100%);
  color: var(--et-accent-text);
  border-radius: 12px;
  font-weight: 600;
}
.etryon-lead-panel .btn-secondary {
  background: #f3f4f6;
  color: var(--et-text);
  border: 1px solid var(--et-border);
  border-radius: 12px;
}

/* Standalone /try/ = fullscreen modal overlay (not a separate «page» feel) */
body.etryon-standalone-page {
  overflow: hidden;
  background: var(--et-bg);
}

body.etryon-embed {
  overflow: hidden;
  background: var(--et-bg);
}

.etryon-page-backdrop {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  z-index: 0;
  background: rgba(17, 24, 39, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  animation: etryon-backdrop-in 0.2s ease-out;
}

@keyframes etryon-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.etryon--standalone {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  min-height: 0 !important;
  max-height: 100% !important;
  height: 100% !important;
}

.etryon--standalone .etryon-shell {
  height: 100%;
  max-height: 100%;
  border-radius: 24px;
  box-shadow: var(--et-shadow), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.etryon--embed {
  min-height: 100% !important;
  max-height: 100%;
  height: 100%;
  background: var(--et-bg);
}

.etryon--embed .etryon-shell {
  max-width: 100%;
  max-height: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 640px) {
  .etryon-page-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .etryon--standalone {
    max-width: 100%;
    max-height: min(96dvh, 100%);
    height: min(96dvh, 100%);
  }
  .etryon--standalone .etryon-shell {
    border-radius: 24px 24px 0 0;
  }
}
