/* ========== ДЕТАЛЬНАЯ СТРАНИЦА ТОВАРА - РАСШИРЕННАЯ ========== */

/* Детальная страница */
.detail-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  z-index: 2000;
  overflow-y: auto;
  display: none;
}

.detail-page.active {
  display: block;
  animation: fadeSlideIn 0.3s ease;
}

/* Звёздный фон для детальной страницы */
.detail-page.active::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(2px 2px at 20px 30px, #fff, rgba(0,0,0,0)),
                    radial-gradient(2px 2px at 40px 70px, #a78bfa, rgba(0,0,0,0)),
                    radial-gradient(1px 1px at 90px 40px, #fff, rgba(0,0,0,0)),
                    radial-gradient(2px 2px at 160px 120px, #60a5fa, rgba(0,0,0,0)),
                    radial-gradient(1px 1px at 230px 80px, #fff, rgba(0,0,0,0)),
                    radial-gradient(2px 2px at 300px 30px, #a78bfa, rgba(0,0,0,0)),
                    radial-gradient(1px 1px at 50px 200px, #fff, rgba(0,0,0,0)),
                    radial-gradient(2px 2px at 280px 350px, #60a5fa, rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 400px 400px;
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}

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

/* Общие отступы - ШИРЕ СТРАНИЦА */
.detail-page #detailContent {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px 40px 60px;
}

@media (max-width: 768px) {
  .detail-page #detailContent {
    padding: 20px 16px 60px;
  }
}

@media (min-width: 1280px) {
  .detail-page #detailContent {
    padding: 20px 100px 60px;
  }
}

@media (min-width: 1600px) {
  .detail-page #detailContent {
    padding: 20px 150px 60px;
  }
}

@media (min-width: 1920px) {
  .detail-page #detailContent {
    padding: 20px 250px 60px;
  }
}

/* ===== ВЕРХНЯЯ ЧАСТЬ: ФОТО + ИНФО ===== */
.detail-top-row {
  display: flex;
  gap: 60px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

/* Фото товара - БОЛЬШОЕ */
.detail-image-col {
  flex: 1.2;
  min-width: 400px;
  max-width: 650px;
  position: relative;
}

.product-detail-image {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  border-radius: 28px;
  background: rgba(10, 10, 22, 0.5);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

/* БЕЙДЖ СКИДКИ НА ФОТО (без огня и без мигания) */
.detail-discount-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-size: 1rem;
  font-weight: 800;
  padding: 8px 20px;
  border-radius: 40px;
  z-index: 10;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
  backdrop-filter: blur(4px);
  letter-spacing: 1px;
  /* Убираем анимацию */
  animation: none;
}

/* Удаляем старую анимацию badgePulse, если она есть */
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Информация справа */
.detail-info-col {
  flex: 1.5;
  min-width: 320px;
}

.active-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  padding: 5px 14px;
  border-radius: 30px;
  font-size: 0.7rem;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.active-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.product-detail-name {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
  background: linear-gradient(135deg, #fff, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ЦЕНА */
.product-detail-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.product-detail-price .old-price {
  text-decoration: line-through;
  font-size: 1.1rem;
  color: #8f8f9e;
}

.product-detail-price .current-price {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #22c55e, #10b981);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Кнопка Купить */
.detail-buttons-row {
  margin-bottom: 28px;
}

.buy-button-inline {
  width: 100%;
  padding: 18px 24px;
  background: linear-gradient(105deg, #3b82f6, #2563eb);
  border: none;
  border-radius: 60px;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.buy-button-inline:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 35px rgba(59, 130, 246, 0.6);
}

/* Информация о продавце */
.seller-info-block {
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 20px;
}

.seller-name-large {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.seller-rating {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.seller-rating .stars {
  color: #fbbf24;
  font-size: 0.85rem;
}

/* KPP блок (контакт) */
.kpp-block {
  background: rgba(59, 130, 246, 0.05);
  border-radius: 20px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.kpp-number {
  font-size: 1.2rem;
  font-weight: 700;
  color: #60a5fa;
  font-family: monospace;
  letter-spacing: 1px;
}

/* ОПИСАНИЕ ТОВАРА */
.seller-description-block {
  margin-bottom: 28px;
  padding: 0;
  background: transparent !important;
}

.seller-description-block .block-title {
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  color: white;
}

.seller-contact-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-word;
  background: transparent !important;
  padding: 0 !important;
}

/* ГАРАНТИИ */
.guarantee-block {
  background: rgba(59, 130, 246, 0.05);
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 32px;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.guarantee-title {
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: white;
}

.guarantee-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.guarantee-item {
  font-size: 0.85rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.guarantee-item i {
  color: #22c55e;
  width: 20px;
}

/* ОТЗЫВЫ */
.reviews-section {
  margin: 32px 0;
}

.reviews-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.reviews-section-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
}

.reviews-count-badge {
  background: rgba(59, 130, 246, 0.15);
  padding: 5px 14px;
  border-radius: 30px;
  font-size: 0.75rem;
  color: #60a5fa;
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-item {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 20px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
}

.review-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(59, 130, 246, 0.15);
}

.review-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.review-author {
  font-weight: 600;
  font-size: 0.9rem;
  color: white;
}

.review-stars {
  color: #fbbf24;
  font-size: 0.8rem;
}

.review-date {
  font-size: 0.7rem;
  color: #6b7280;
}

.review-text {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.5;
}

/* ===== ПОХОЖИЕ ТОВАРЫ ===== */
.similar-products-section {
  margin: 48px 0 32px;
  padding: 32px 0 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 15, 30, 0.3);
  border-radius: 32px;
}

.similar-products-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
  padding: 0 8px;
}

.similar-products-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
}

.similar-products-header h3 i {
  color: #fbbf24;
  font-size: 1.4rem;
}

.similar-products-badge {
  background: rgba(59, 130, 246, 0.15);
  padding: 6px 16px;
  border-radius: 40px;
  font-size: 0.75rem;
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.2);
}

.similar-products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 0 8px;
}

@media (max-width: 1024px) {
  .similar-products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .similar-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .similar-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.similar-product-card {
  background: rgba(15, 20, 35, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.similar-product-card:hover {
  transform: translateY(-5px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
  background: rgba(20, 30, 50, 0.8);
}

.similar-product-image-wrapper {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.similar-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.similar-product-card:hover .similar-product-image {
  transform: scale(1.05);
}

.similar-product-discount {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
  z-index: 2;
}

.similar-product-body {
  padding: 14px;
}

.similar-product-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}

.similar-product-price {
  font-size: 0.95rem;
  font-weight: 800;
  background: linear-gradient(135deg, #22c55e, #10b981);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 6px;
}

.similar-product-seller {
  font-size: 0.65rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 4px;
}

.similar-product-seller::before {
  content: '👤';
  font-size: 0.6rem;
  opacity: 0.6;
}

.similar-products-footer {
  text-align: center;
  margin-top: 32px;
  padding-top: 16px;
}

.view-all-similar-btn {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 12px 28px;
  border-radius: 40px;
  color: #60a5fa;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.view-all-similar-btn:hover {
  background: #3b82f6;
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(59, 130, 246, 0.4);
}

/* Пустое состояние для похожих товаров */
.similar-products-empty {
  text-align: center;
  padding: 50px 20px;
  margin: 32px 0;
  background: rgba(10, 15, 30, 0.3);
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.similar-products-empty i {
  font-size: 3rem;
  color: #6b7280;
  margin-bottom: 16px;
  opacity: 0.4;
}

.similar-products-empty p {
  color: #8f8f9e;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

/* Футер ссылки */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-links a {
  color: #6b7280;
  text-decoration: none;
  font-size: 0.7rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #60a5fa;
}