/* === MODAL (CART & PRODUCT) === */
.modal {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

.modal.open {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: rgba(11, 11, 38, 0.35);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 24px;
  max-width: 1024px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  
  /* Неоновая рамка */
  border: 1px solid rgba(100, 100, 255, 0.3);
  box-shadow: 
    0 0 20px rgba(100, 100, 255, 0.2),
    0 0 40px rgba(100, 100, 255, 0.1),
    inset 0 0 20px rgba(100, 100, 255, 0.1);
  
  /* Анимация появления */
  animation: modalAppear 0.3s ease-out;
  transform: scale(1);
}

/* Анимация появления модального окна */
@keyframes modalAppear {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Кнопка закрытия в неоновом стиле */
.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  background: rgba(255, 50, 50, 0.2);
  border: 1px solid rgba(255, 50, 50, 0.3);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 50, 50, 0.4);
  border-color: rgba(255, 100, 100, 0.6);
  box-shadow: 
    0 0 15px rgba(255, 50, 50, 0.4),
    0 0 30px rgba(255, 50, 50, 0.2);
  transform: scale(1.1);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  margin: 0;
}

/* === PRODUCT MODAL === */
.product-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  flex: 1;
  min-height: 0;
}

/* Адаптив для модального окна */
@media (min-width: 768px) {
  .product-modal-body {
    flex-direction: row;
    gap: 2rem;
  }
  
  .modal-title {
    font-size: 1.8rem;
  }
  
  .modal-header {
    padding: 2rem;
  }
  
  .product-modal-body {
    padding: 2rem;
  }
}

@media (min-width: 1024px) {
  .modal-content {
    max-width: 1200px;
  }
  
  .modal-title {
    font-size: 2rem;
  }
}

/* Мобильные устройства */
@media (max-width: 767px) {
  .modal {
    padding: 0.5rem;
    overflow-y: auto;

  }
  
  .modal-content {
    max-height: 95vh;
    margin: 1rem 0;
    border-radius: 24px;
  }
  
  .modal-header {
    padding: 1rem;
  }
  
  .modal-title {
    font-size: 1.3rem;
  }
  
  .modal-close {
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    font-size: 18px;
  }
  
  .product-modal-body {
    padding: 1rem;
    gap: 1rem;
  }
  
  .product-price {
    font-size: 1.5rem;
  }
  
  .product-title,
  #product-title {
    font-size: 1.2rem;
  }
  
  .product-description,
  #product-description {
    font-size: 0.9rem;
    padding: 0.5rem;
  }
  
  .btn-add,
  .btn-buy {
    padding: 0.75rem;
    font-size: 0.95rem;
  }
  
  .thumbnail {
    width: 3rem;
    height: 3rem;
  }
  
  .product-thumbnails {
    gap: 0.5rem;
    margin-top: 0.75rem;
  }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
  .modal-content {
    margin-top: 100px;
    border-radius: 24px;
  }
  
  
  
  .modal-close {
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  
  .product-modal-body {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  
  .product-price {
    font-size: 1.3rem;
  }
  
  .product-title,
  #product-title {
    font-size: 1rem;
  }
  
  .thumbnail {
    width: 2.5rem;
    height: 2.5rem;
  }
  
  .product-thumbnails {
    gap: 0.25rem;
  }
}

/* === ЛЕВАЯ ЧАСТЬ: изображение и миниатюры === */
.product-modal-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.product-modal-image {
  width: 100%;
  height: 0;
  padding-bottom: calc(100% * 3 / 4);
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.4);
}

.product-modal-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-thumbnails {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-bottom: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.product-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.product-thumbnails::-webkit-scrollbar-track {
  background: transparent;
}

.product-thumbnails::-webkit-scrollbar-thumb {
  background: #6b7280;
  border-radius: 3px;
}

.thumbnail {
  width: 4rem;
  height: 4rem;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.thumbnail:hover {
  transform: scale(1.05);
}

.thumbnail.active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* === ПРАВАЯ ЧАСТЬ: информация и кнопки === */
.product-modal-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 4px;
}

.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem 0;
  min-height: 0;
}

.product-modal-right::-webkit-scrollbar {
  width: 6px;
}

.product-modal-right::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.product-modal-right::-webkit-scrollbar-thumb {
  background: #6b7280;
  border-radius: 3px;
}

.product-title,
#product-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: white;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
  flex-shrink: 0;
}

.product-description,
#product-description {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
  overflow: hidden;
}

.product-price {
  font-size: 1.75rem;
  font-weight: bold;
  color: #ffffff;
  text-align: center;
}

#product-price {
  margin-bottom: 1.5rem;
  text-align: left;
}

/* Контейнер для кнопок */
.buttons-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

/* Кнопки */
.btn-add,
.btn-buy {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.btn-add:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-buy {
  background: linear-gradient(90deg, #3b82f6, #9333ea);
  color: white;
}

.btn-buy:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}



/* Блокировка скролла */
body.modal-open {
  overflow: hidden;
  padding-right: var(--scrollbar-width, 0px);
}

#send-order {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(90deg, #3b82f6, #9333ea);
  border: none;
  color: white;
  font-weight: 600;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.7;
  pointer-events: none;
}

#send-order:enabled {
  opacity: 1;
  pointer-events: all;
}

#send-order:enabled:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

#send-order:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Адаптив для формы заказа */
@media (max-width: 767px) {
  #send-order {
    padding: 0.875rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  #send-order {
    padding: 0.75rem;
    font-size: 0.95rem;
  }
}


/* Стили для вариантов в модальном окне (Неоново-голографический стиль) */
.product-variants-container {
    margin-top: 20px;
    padding-top: 15px;
    /* Голографический градиентный бордер */
    /* border-top: 1px solid; */
    /* border-image: linear-gradient(90deg, #00dbde, #fc00ff, #00dbde) 1; */
    /* Более простая альтернатива с прозрачностью */
     border-top: 1px solid rgba(0, 219, 222, 0.3); /* Неоново-голубой с прозрачностью */
}

.product-variants {
    display: flex;
    flex-wrap: wrap;
    /* Неоновый голографический градиентный фон для контейнера (очень легкий) */
    /* background: linear-gradient(90deg, rgba(0, 219, 222, 0.05), rgba(252, 0, 255, 0.05), rgba(0, 219, 222, 0.05)); */
    gap: 12px; /* Увеличенный отступ для динамики */
    margin-top: 15px;
    padding: 5px; /* Немного внутреннего отступа */
    border-radius: 8px; /* Скругление контейнера */
}

.product-variant-btn {
    padding: 10px 15px; /* Увеличенные отступы */
    /* Неоновая рамка по умолчанию */
    border: 2px solid rgba(128, 128, 128, 0.3); /* Светло-серая полупрозрачная рамка как основа */
    border-radius: 8px; /* Более выраженные скругления */
    /* Полупрозрачный фон */
    background-color: rgba(249, 249, 249, 0.1); /* Очень светлый фон с низкой непрозрачностью */
    backdrop-filter: blur(5px); /* Эффект размытия фона (поддержка может варьироваться) */
    cursor: pointer;
    transition: all 0.3s ease; /* Более плавный переход */
    font-size: 0.95em; /* Немного увеличенный шрифт */
    font-weight: 500; /* Средняя насыщенность */
    color: #ffffff; /* Основной цвет текста */
    /* Для размещения изображения и текста */
    display: flex;
    align-items: center; /* Выравнивание по вертикальному центру */
    gap: 10px; /* Расстояние между изображением и текстом */
    min-height: 45px; /* Минимальная высота */
    /* Тень по умолчанию (очень легкая) */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.product-variant-btn:hover {
    /* Неоновое свечение при наведении (голографический оттенок) */
    /* border-color: rgba(0, 219, 222, 0.7); */ /* Неоново-голубой */
    border-color: rgba(252, 0, 255, 0.5); /* Неоново-фиолетовый */
    background-color: rgba(230, 240, 255, 0.2); /* Слегка светлее фон при наведении */
    /* box-shadow: 0 0 8px rgba(0, 219, 222, 0.4); */ /* Свечение голубое */
    box-shadow: 0 0 10px rgba(252, 0, 255, 0.3); /* Свечение фиолетовое */
    /* transform: translateY(-2px); */ /* Легкое приподнимание */
    color: #ffffff; /* Немного темнее текст при наведении для контраста */
}

/* Подсветка ВЫБРАННОГО варианта (основной неоновый акцент) */
.product-variant-btn.selected {
    /* Яркая неоновая рамка */
    border: 2px solid #00dbde; /* Основной неоново-голубой */
    /* Фон с голографическим отливом */
    background: linear-gradient(90deg, rgba(0, 219, 222, 0.2), rgba(252, 0, 255, 0.2), rgba(0, 219, 222, 0.2));
    /* Насыщенное неоновое свечение */
    box-shadow: 0 0 15px rgba(0, 219, 222, 0.6), 0 0 10px rgba(252, 0, 255, 0.4);
    color: #ffffff; 
    font-weight: bold;
    /* transform: scale(1.03); */ /* Легкое увеличение */
}

/* Стиль для миниатюры внутри кнопки варианта */
.product-variant-btn .variant-thumbnail {
    width: 35px; /* Немного увеличенная ширина */
    height: 35px; /* Немного увеличенная высота */
    object-fit: cover;
    border-radius: 4px; /* Скругление миниатюры */
    flex-shrink: 0;
    /* Рамка вокруг миниатюры */
    
}