/**
 * СТИЛИ: Модальный баннер
 * Premium Glassmorphism модалка с Breaking the Grid эффектом
 */

/* Оверлей с плавным размытием фона */
.modal-banner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  visibility: hidden;
}

.modal-banner-overlay.active {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  opacity: 1;
  pointer-events: all;
  visibility: visible;
}

@keyframes revealOverlay {
  from {
    backdrop-filter: blur(0px);
  }
  to {
    backdrop-filter: blur(12px);
  }
}

/* Обёртка для группировки стола и карточки - центрируем всю композицию */
.modal-banner-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1100px;
  width: 100%;
  gap: 0;
}

/* Стол - слева, наплывает на карточку */
.modal-banner-product {
  position: relative;
  width: 900px;
  max-width: 60%;
  z-index: 3;
  margin-right: -120px;
  flex-shrink: 0;
  animation: float 4s ease-in-out infinite;
  opacity: 0;
  transition: opacity 0.6s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.modal-banner-overlay.active .modal-banner-product {
  opacity: 1;
  animation: float 4s ease-in-out infinite, scaleInProduct 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s backwards;
}

/* Плавная левитация на 8px */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Анимация появления стола */
@keyframes scaleInProduct {
  from {
    opacity: 0;
    transform: scale(0.7);
    filter: drop-shadow(0 0 0 rgba(255, 140, 0, 0));
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 25px 40px rgba(255, 140, 0, 0.35));
  }
}

/* WebP изображение стола с высоким качеством */
.modal-banner-product-image {
  width: 100%;
  height: auto;
  max-height: 450px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 25px 40px rgba(255, 140, 0, 0.35));
}

/* Glassmorphism карточка - справа */
.modal-banner-card {
  position: relative;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  max-width: 550px;
  width: 100%;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(0.85);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
  flex-shrink: 0;
}

.modal-banner-overlay.active .modal-banner-card {
  transform: scale(1);
  opacity: 1;
  animation: reveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

@keyframes reveal {
  0% {
    transform: scale(0.85);
    opacity: 0;
    filter: blur(10px);
  }
  100% {
    transform: scale(1);
    opacity: 1;
    filter: blur(0px);
  }
}

/* Кнопка закрытия - улучшенная для glassmorphism */
.modal-banner-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-banner-close:hover {
  background: rgba(0, 0, 0, 0.25);
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-banner-close svg {
  color: #fff;
  transition: color 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.modal-banner-close:active {
  transform: scale(0.95) rotate(90deg);
}

/* Контент внутри glassmorphism карточки */
.modal-banner-content {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Заголовок с градиентом */
.modal-banner-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
  background: linear-gradient(135deg, #ff8c00 0%, #ff6b00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #1a1a1a;
}

.modal-banner-subtitle {
  font-size: 1rem;
  line-height: 1.6;
  color: #2a2a2a;
  margin: 0;
}

/* Преимущества */
.modal-banner-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 10px 0;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(255, 140, 0, 0.15);
}

.feature-item svg {
  flex-shrink: 0;
  color: #ff8c00;
  margin-top: 2px;
}

.feature-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feature-item strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a1a1a;
}

.feature-item span {
  font-size: 0.85rem;
  color: #333;
}

/* Блок с ценами (заменил таймер) */
.modal-banner-price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 20px;
  background: rgba(255, 140, 0, 0.1);
  border-radius: 12px;
  border: 2px solid rgba(255, 140, 0, 0.2);
}

.modal-banner-price-old {
  font-size: 1.3rem;
  font-weight: 500;
  color: #666;
  text-decoration: line-through;
}

.modal-banner-price-offer {
  font-size: 2rem;
  font-weight: 800;
  color: #1a1a1a;
  letter-spacing: -0.5px;
}

/* Кнопка CTA с пульсирующим свечением */
.modal-banner-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 32px;
  background: #FF8C00;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 12px;
  box-shadow: 
    0 10px 30px rgba(255, 140, 0, 0.4),
    0 0 20px rgba(255, 140, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: glowPulse 2s ease-in-out infinite;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

/* Кнопка под изображением стола */
.modal-banner-cta-under-image {
  width: 100%;
  max-width: 400px;
  align-self: center;
}

/* Пульсирующее внешнее свечение */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 
      0 10px 30px rgba(255, 140, 0, 0.4),
      0 0 20px rgba(255, 140, 0, 0.3),
      0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  }
  50% {
    box-shadow: 
      0 15px 40px rgba(255, 140, 0, 0.6),
      0 0 40px rgba(255, 140, 0, 0.5),
      0 0 60px rgba(255, 140, 0, 0.3),
      0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  }
}

.modal-banner-cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 20px 50px rgba(255, 140, 0, 0.7),
    0 0 50px rgba(255, 140, 0, 0.6),
    0 0 80px rgba(255, 140, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  background: #ff9500;
}

.modal-banner-cta:active {
  transform: translateY(0) scale(0.98);
}

/* Футер */
.modal-banner-footer {
  font-size: 0.85rem;
  color: #666;
  text-align: center;
  margin: 0;
}

.modal-banner-footer strong {
  color: #ff8c00;
  font-weight: 700;
}

/* Адаптивность - Media Queries для мобильных */
@media (max-width: 968px) {
  .modal-banner-wrapper {
    flex-direction: column;
    gap: 20px;
  }
  
  .modal-banner-product {
    position: relative;
    width: 80%;
    max-width: 400px;
    margin: 0 auto 20px;
    margin-right: auto;
  }
  
  .modal-banner-card {
    max-width: calc(100% - 40px);
  }
}

@media (max-width: 768px) {
  .modal-banner-product {
    width: 85%;
    max-width: 350px;
  }
  
  .modal-banner-product-image {
    max-height: 300px;
  }
  
  .modal-banner-content {
    padding: 30px 20px 20px;
  }
  
  .modal-banner-title {
    font-size: 1.5rem;
  }
  
  .modal-banner-subtitle {
    font-size: 0.9rem;
  }
  
  .modal-banner-features {
    gap: 10px;
  }
  
  .feature-item {
    padding: 10px;
  }
  
  .modal-banner-timer {
    padding: 12px 16px;
    font-size: 0.85rem;
  }
  
  #modalCountdown {
    font-size: 0.95rem;
  }
  
  .modal-banner-cta {
    padding: 16px 24px;
    font-size: 0.9rem;
  }
  
  .modal-banner-close {
    width: 36px;
    height: 36px;
    top: 15px;
    right: 15px;
  }
}

@media (max-width: 480px) {
  .modal-banner-card {
    border-radius: 16px;
  }
  
  .modal-banner-product {
    width: 90%;
    max-width: 280px;
  }
  
  .modal-banner-product-image {
    max-height: 220px;
  }
  
  .modal-banner-title {
    font-size: 1.3rem;
  }
  
  .modal-banner-content {
    padding: 25px 15px 15px;
  }
}
