/* Smart glass demo v3 — стили изолированы от обычной галереи категорий. */
/* 80% родительского блока; само изображение ещё на 10% уже, чем в v2:
   80% (прежняя ширина stage) × 0.9 = 72% ширины секции. */
.smart-glass-demo {
  width: 80%;
  max-width: 1440px;
  margin: 24px auto 154px; /* 116px выхода пульта вниз + 38px до следующего блока */
  padding: 0;
}

.smart-glass-demo__layout {
  position: relative;
  width: 72%;
  margin-inline: auto;
}

.smart-glass-demo__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #e6e8ea;
  border-radius: 12px;
  isolation: isolate;
  box-shadow: 0 12px 34px rgba(25, 35, 50, .10);
}

.smart-glass-demo__picture {
  display: block;
  width: 100%;
  height: 100%;
}

.smart-glass-demo__picture--matte {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.smart-glass-demo.is-matte .smart-glass-demo__picture--matte { opacity: 1; }

.smart-glass-demo__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Desktop: пульт полностью внутри изображения по горизонтали.
   Справа оставляем 56px = 1/2 ширины пульта, а вниз он выступает на 75%. */
.smart-glass-demo__controls {
  position: absolute;
  z-index: 2;
  right: 56px;
  bottom: 0;
  transform: translateY(75%);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 155px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.smart-glass-demo__remote {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  flex: none;
  width: 112px;
  height: 155px;
  min-height: 155px;
  padding: 17px 12px;
  background: linear-gradient(145deg, #fff, #f1f1ef);
  border: 1px solid #dddcd8;
  border-radius: 27px;
  box-shadow: inset 0 1px 1px #fff, 0 6px 12px rgba(0, 0, 0, .13);
  color: #555;
  font: inherit;
  transition: box-shadow .16s ease, transform .16s ease;
}

.smart-glass-demo__remote:hover {
  box-shadow: inset 0 1px 1px #fff, 0 8px 16px rgba(0, 0, 0, .18);
}
.smart-glass-demo__remote:active { transform: translateY(2px); }
.smart-glass-demo__remote:focus-visible { outline: 3px solid #246cc3; outline-offset: 4px; }

.smart-glass-demo__remote-button {
  display: block;
  width: 70px;
  height: 70px;
  flex: 0 0 70px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 27%, #f5c1c1 0%, #cc7979 44%, #a95b5b 100%);
  border: 3px solid #e4d5d5;
  box-shadow: inset 0 3px 7px rgba(255, 255, 255, .55), inset 0 -5px 8px rgba(95, 0, 0, .2), 0 4px 8px rgba(0, 0, 0, .18);
  transition: background .12s ease, box-shadow .12s ease;
}

.smart-glass-demo.is-matte .smart-glass-demo__remote-button {
  background: radial-gradient(circle at 34% 27%, #ff8a8e 0%, #ed202a 43%, #a90010 100%);
  box-shadow: inset 0 3px 7px rgba(255, 255, 255, .45), inset 0 -5px 8px rgba(90, 0, 0, .3), 0 0 18px rgba(224, 22, 36, .28), 0 4px 8px rgba(0, 0, 0, .18);
}

.smart-glass-demo__remote-brand {
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .18em;
  color: #777;
}
.smart-glass-demo__remote-caption {
  font-size: .76rem;
  font-weight: 700;
  color: #51565c;
}

/* Desktop: подпись слева от пульта. Абсолютное позиционирование
   не влияет на размер .smart-glass-demo__controls и не сдвигает пульт. */
.smart-glass-demo__state {
  position: absolute;
  top: 0;
  right: calc(100% + 20px);
  width: clamp(320px, 34vw, 460px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 6px;
  box-sizing: border-box;
}
.smart-glass-demo__state-label {
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.4;
  color: #243146;
}
.smart-glass-demo__noscript { text-align: center; margin-top: 12px; font-size: .9rem; }

@media (min-width: 768px) and (max-width: 991.98px) {
  .smart-glass-demo { width: 92%; margin-bottom: 132px; }
  .smart-glass-demo__controls { width: 96px; height: 134px; right: 48px; }
  .smart-glass-demo__remote { width: 96px; height: 134px; min-height: 134px; gap: 7px; padding: 11px 8px; }
  .smart-glass-demo__remote-button { width: 62px; height: 62px; flex-basis: 62px; }
}

@media (max-width: 767.98px) {
  /* Изображение на всю ширину viewport, даже если PHP-view лежит в Bootstrap-колонке. */
  .smart-glass-demo {
    width: 100vw;
    max-width: none;
    margin: 18px 0 28px;
    margin-left: calc(50% - 50vw);
    padding: 0;
  }

  .smart-glass-demo__layout { width: 100%; }
  .smart-glass-demo__stage {
    width: 100%;
    border-radius: 0;
  }

  /* Пульт под изображением, но заходит на него на четверть своей высоты.
     Текст состояния — слева от пульта, по центру обеих осей. */
  .smart-glass-demo__controls {
    position: relative;
    right: auto;
    bottom: auto;
    transform: none;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: calc(100% - 32px);
    height: 125px;
    margin: -31.25px auto 0; /* 25% высоты пульта */
    padding: 0;
  }

  .smart-glass-demo__remote {
    order: 2;
    width: 104px;
    height: 125px;
    min-height: 125px;
    padding: 10px;
    gap: 7px;
    flex: 0 0 104px;
  }
  .smart-glass-demo__remote-button { width: 64px; height: 64px; flex-basis: 64px; }

  .smart-glass-demo__state {
    position: static;
    right: auto;
    top: auto;
    order: 1;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 4px;
  }
  .smart-glass-demo__state-label { font-size: clamp(.88rem, 3.3vw, 1.06rem); }
}

@media (prefers-reduced-motion: reduce) {
  .smart-glass-demo__picture--matte,
  .smart-glass-demo__remote,
  .smart-glass-demo__remote-button { transition: none; }
}

/* v5: мягкий пульс приглашения к первому нажатию.
   Пульт и геометрию демонстрации из v4 не меняем. */
.smart-glass-demo__state-label--prompt {
  display: inline-block;
  color: #bd0f15;
  font-size: 1.25rem;
  animation: smart-glass-demo-prompt-pulse 1.65s ease-in-out infinite;
  transform-origin: center;
}

@keyframes smart-glass-demo-prompt-pulse {
  0%, 100% { transform: scale(1); opacity: .76; }
  50% { transform: scale(1.055); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .smart-glass-demo__state-label--prompt { animation: none; opacity: 1; }
}