/* JS Onboarding Styles */
.js-onboarding {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #00A110;
  display: flex;
  flex-direction: column;
  z-index: 10000;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  overflow: hidden;
}

/* Немного выносит SVG-фон за края экрана, оставаясь респонсивным */
.js-onboarding::before {
  content: '';
  position: absolute;
  inset: -6vw; /* overscan */
  background-image: url('assets/assets/svg/onboarding/bg_image.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  pointer-events: none;
}

.js-onboarding.hidden {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.slides-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* DEBUG: Отключаем transitions во время инициализации */
.js-onboarding.no-transitions .slide {
  transition: none !important;
}

.slide.active {
  opacity: 1;
  transform: translateX(0);
}

.slide.prev {
  opacity: 1;
  transform: translateX(-100%);
}

.slide.next {
  opacity: 1;
  transform: translateX(100%);
}

.slide-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Skip button - текстовая кнопка без фона */
.skip-button {
  position: absolute;
  top: 50px;
  right: 20px;
  padding: 8px 12px;
  border: none;
  background: none;
  color: #666666;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s ease;
  z-index: 10001;
  text-decoration: none;
}

.skip-button:hover {
  color: #333333;
}

.skip-button:active {
  color: #000000;
}

/* CTA button - в стиле приложения */
.cta-button {
  margin-top: 32px;
  padding: 19px 24px;
  border: none;
  border-radius: 99px;
  background-color: #ffffff;
  color: #00A110;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-size: 17px;
  line-height: 20px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transition: all 0.2s ease;
  width: 100%;
  max-width: 280px;
}

.cta-button:hover {
  background-color: #f8fff8;
  box-shadow: 0 8px 24px rgba(0, 161, 16, 0.25);
  transform: translateY(-1px);
}

.cta-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.slide-image-direct {
  width: 350px;
  height: 350px;
  object-fit: contain;
  margin-bottom: 40px;
  display: block;
}

.slide-text {
  text-align: left;
  width: 100%;
  max-width: 400px;
}

.slide-text h3 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px 0;
}

.slide-text p {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

/* Индикаторы прогресса сторис */
.slide-indicators {
  position: absolute;
  top: 40px;
  left: 16px;
  right: 16px; /* запас справа под спиннер */
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.indicator {
  position: relative;
  flex: 1 1 auto;
  min-width: 40px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  cursor: pointer;
  overflow: hidden;
}

.indicator::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background: #ffffff;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 3s linear;
  will-change: transform;
}

/* Отключение анимации при мгновенном сбросе */
.indicator.no-anim::after {
  transition: none !important;
}

/* Активный индикатор заполняется белым */
.indicator.filling::after {
  transform: scaleX(1);
}

/* Прошедшие сторис остаются полностью белыми, без анимации */
.indicator.completed::after {
  transform: scaleX(1);
  transition: none;
}

.loading-status {
  position: absolute;
  top: 36px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(0, 161, 16, 0.2);
  border-top: 3px solid #00A110;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

/* loading-text removed by design */

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Promo Banner Styles */
.promo-banner {
  position: absolute;
  top: 60px;
  left: 16px;
  right: 16px;
  z-index: 10001;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  animation: slideInFromTop 0.6s ease-out;
}

@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.promo-content {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.promo-image {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
}

.promo-product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.promo-text {
  flex: 1;
  min-width: 0;
}

.promo-product-name {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 4px 0;
  line-height: 1.2;
}

.promo-price-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.promo-price-label {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #666666;
}

.promo-price {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  background: #fff3cd;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.promo-seller {
  display: flex;
  align-items: center;
  gap: 4px;
}

.promo-label {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #00A110;
}

.promo-seller-name {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #999999;
}

/* Индикатор загрузки в промо-баннере */
.promo-loading {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.promo-loading .loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(0, 161, 16, 0.2);
  border-top: 2px solid #00A110;
  border-radius: 50%;
  animation: promoSpin 1s linear infinite;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@keyframes promoSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .slide-text p {
    font-size: 16px;
  }
  
  .slide-image-direct {
    width: 280px;
    height: 280px;
  }
  
  .loading-status {
    right: 12px;
    top: 28px;
  }
  
  .promo-banner {
    top: 50px;
    left: 12px;
    right: 12px;
  }
  
  .promo-content {
    padding: 12px;
    gap: 10px;
  }
  
  .promo-image {
    width: 50px;
    height: 50px;
    border-radius: 10px;
  }
  
  .promo-product-name {
    font-size: 15px;
  }
  
  .promo-price-label,
  .promo-price {
    font-size: 13px;
  }
  
  .promo-label,
  .promo-seller-name {
    font-size: 11px;
  }
}

