/**
 * PRODUCT PAGE STYLES
 * Стили для страницы отдельного товара
 */

/* Хлебные крошки */
.breadcrumbs {
  padding: 20px 0;
  background: var(--surface-color, #ffffff);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.breadcrumbs__nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-secondary, #6b7280);
}

.breadcrumbs__nav a {
  color: var(--text-secondary, #6b7280);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumbs__nav a:hover {
  color: var(--primary-color, #2563eb);
}

.breadcrumbs__nav span {
  color: var(--text-muted, #9ca3af);
}

/* Страница товара */
.product-page {
  padding: 40px 0;
}

.product-loading {
  text-align: center;
  padding: 60px 20px;
}

.product-content {
  margin-top: 20px;
}

/* Layout товара */
.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
  color: var(--text-primary);
}

/* Галерея */
.product-gallery {
  position: sticky;
  top: 100px;
}

.gallery-main {
  width: 100%;
  aspect-ratio: 1280 / 1067;
  background: var(--surface-color, #ffffff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 15px;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
}

.product-discount-reason {
  margin-top: 12px;
  background: rgba(255, 152, 0, 0.12);
  border: 1px solid rgba(255, 152, 0, 0.4);
  color: #b36b00;
  padding: 10px 12px;
}

.product-branding-info {
  margin-top: 12px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: #1e40af;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 600;
  line-height: 1.4;
}

/* Блок МинПромТорг */
.product-minpromtorg-info {
  margin-top: 12px;
  background: rgba(245, 245, 245, 0.7);
  border: 1px solid rgba(200, 200, 200, 0.5);
  color: #4a5568;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 500;
  line-height: 1.6;
}

/* Кнопка 3D просмотра */
.btn-3d {
  width: 100%;
  margin-top: 15px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-3d:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  border-color: transparent;
}

.btn-3d svg {
  animation: rotate3d 4s linear infinite;
}

@keyframes rotate3d {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

.thumb {
  width: 100%;
  height: 100%;
  aspect-ratio: 1280 / 1067;
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  object-fit: contain;
  display: block;
}

.thumb:hover {
  border-color: var(--primary-color, #2563eb);
}

.thumb.active {
  border-color: var(--primary-color, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Информация о товаре */
.product-info {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.product-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.product-sku {
  font-size: 0.95rem;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 8px 0;
  text-align: left;
  line-height: 1.3;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.add-cart-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
  justify-content: center;
}

.add-cart-inline svg {
  color: var(--text-primary);
  stroke: currentColor;
}

.price-current {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color, #2563eb);
}

.price-old {
  font-size: 1.5rem;
  color: var(--text-muted, #9ca3af);
  text-decoration: line-through;
}

.product-stock {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.product-discount-reason {
  margin-top: 10px;
  background: rgba(255, 152, 0, 0.12);
  border: 1px solid rgba(255, 152, 0, 0.4);
  color: #b36b00;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
  line-height: 1.4;
}

.status-in-stock {
  color: #10b981;
}

.status-out-stock {
  color: #f59e0b;
}

/* Атрибуты */
.product-attributes {
  background: var(--card-bg);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 20px;
  color: var(--text-primary);
}

.attributes-table {
  width: 100%;
  border-collapse: collapse;
}

.attributes-table tr {
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.attributes-table tr:last-child {
  border-bottom: none;
}

.attributes-table td {
  padding: 12px 0;
  font-size: 0.95rem;
}

.attributes-table td:first-child {
  color: var(--text-secondary);
  width: 50%;
}

.attributes-table td:last-child {
  color: var(--text-primary);
  text-align: right;
}

/* Кнопки действий */
.product-actions {
  display: flex;
  gap: 15px;
}

.btn-large {
  padding: 15px 30px;
  font-size: 1.1rem;
}

/* Полное описание */
.product-description {
  background: var(--card-bg);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 30px;
  color: var(--text-primary);
}

.product-description h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.5rem;
  color: var(--text-primary);
}

.product-description p {
  line-height: 1.7;
  color: var(--text-secondary);
}

/* Сохранение форматирования текста (отступы, пробелы) */
#productDescription {
  white-space: pre-wrap;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* Доставка */
.product-delivery {
  margin: 20px 0;
}

.delivery-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: rgba(33, 150, 243, 0.05);
  border: 1px solid rgba(33, 150, 243, 0.15);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.delivery-info:hover {
  background: rgba(33, 150, 243, 0.08);
  border-color: rgba(33, 150, 243, 0.25);
}

.delivery-info svg {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--accent-blue, #2196f3);
  margin-top: 2px;
}

.delivery-info__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.delivery-info__time {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.delivery-info__time strong {
  font-weight: 600;
  color: var(--accent-blue, #2196f3);
}

.delivery-info__note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.delivery-info.loading {
  opacity: 0.7;
}

.delivery-info.loading svg {
  animation: delivery-pulse 1.5s ease-in-out infinite;
}

@keyframes delivery-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Адаптивность */
@media (max-width: 992px) {
  .product-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .product-gallery {
    position: relative;
    top: 0;
  }
  
  .product-title {
    font-size: 1.75rem;
  }
  
  .price-current {
    font-size: 1.75rem;
  }
}

@media (max-width: 768px) {
  .product-page {
    padding: 30px 0;
  }
  
  .product-layout {
    gap: 30px;
  }
  
  .product-title {
    font-size: 1.5rem;
  }
  
  .price-current {
    font-size: 1.5rem;
  }
  
  .price-old {
    font-size: 1.2rem;
  }
  
  .product-description {
    padding: 20px;
  }
  
  .attributes-table td {
    font-size: 0.9rem;
  }
  
  .gallery-thumbs {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  }
}

@media (max-width: 480px) {
  .breadcrumbs__nav {
    font-size: 0.8rem;
  }
  
  .product-actions {
    flex-direction: column;
  }
  
  .btn-large {
    width: 100%;
  }
}
