/* Стили для страницы деталей товара */

.breadcrumbs {
  padding: 20px 0;
  font-size: 14px;
  color: #666;
}

.breadcrumbs a {
  color: #666;
  text-decoration: none;
  transition: color 0.3s;
}

.breadcrumbs a:hover {
  color: var(--primary-color);
}

.breadcrumbs span:not([id]) {
  margin: 0 10px;
  color: #999;
}

.product-detail-container {
  background: white;
  border-radius: 10px;
  padding: 30px;
  margin: 30px 0;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  max-width: 100%;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

/* Левая часть - галерея изображений */
.product-images {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-main-image {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  position: relative;
}

.product-main-image img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.3s;
}

.product-main-image img:hover {
  transform: scale(1.05);
}

.product-thumbnails {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.product-thumbnail {
  width: 80px;
  height: 80px;
  border-radius: 5px;
  overflow: hidden;
  border: 2px solid #e9ecef;
  cursor: pointer;
  transition: all 0.3s;
}

.product-thumbnail:hover,
.product-thumbnail.active {
  border-color: var(--primary-color);
  transform: scale(1.05);
}

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

.product-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 8px 15px;
  border-radius: 5px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  z-index: 2;
}

.product-badge.new {
  background: #28a745;
}

.product-badge.hit {
  background: #dc3545;
}

.product-badge.sale,
.product-badge.discount {
  background: #ff5722;
}

/* Правая часть - информация о товаре */
.product-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.product-title {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.product-meta {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #e9ecef;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 5px;
}

.product-rating .stars {
  color: #ffc107;
  font-size: 16px;
}

.product-rating .reviews-count {
  color: #666;
  font-size: 14px;
}

.product-stock {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.product-stock.in-stock {
  color: #28a745;
}

.product-stock.out-of-stock {
  color: #dc3545;
}

.product-stock i {
  font-size: 16px;
}

.product-stock-info {
  font-size: 14px;
  color: #666;
}

.product-code {
  font-size: 14px;
  color: #666;
}

.product-code strong {
  color: #333;
}

.product-price-block {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #e9ecef;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 15px;
  margin-bottom: 10px;
}

.current-price {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-color);
}

.old-price {
  font-size: 20px;
  color: #999;
  text-decoration: line-through;
}

.price-unit {
  font-size: 16px;
  color: #666;
}

.price-note {
  font-size: 14px;
  color: #666;
  font-style: italic;
}

/* Селектор длины листа металлочерепицы */
.sheet-length-selector {
  margin-top: 20px;
  padding: 15px;
  background: #fff8e1;
  border-radius: 8px;
  border: 1px solid #ffcc02;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.sheet-length-selector label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.sheet-length-selector label i {
  color: var(--primary-color);
  margin-right: 8px;
}

.sheet-length-selector select {
  width: 100%;
  padding: 12px 15px;
  font-size: 16px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: white;
  color: #333;
  cursor: pointer;
  transition: border-color 0.3s;
}

.sheet-length-selector select:hover,
.sheet-length-selector select:focus {
  border-color: var(--primary-color);
  outline: none;
}

.sheet-length-note {
  margin-top: 10px;
  font-size: 13px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-length-note i {
  color: #ff9800;
}

.sheet-length-selector h4 {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: #333;
}

.sheet-width-info {
  margin: 0 0 15px 0;
  font-size: 14px;
  color: #666;
}

.sheet-width-info strong {
  color: var(--primary-color);
}

.length-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.length-filter-btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
}

.length-filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.length-filter-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.length-search {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.length-search input {
  flex: 1;
  padding: 10px 15px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
}

.length-search input:focus {
  border-color: var(--primary-color);
  outline: none;
}

.length-search button {
  padding: 10px 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.length-search button:hover {
  background: #b91c1c;
}

.lengths-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 6px;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  box-sizing: border-box;
}

.lengths-grid::-webkit-scrollbar {
  width: 8px;
}

.lengths-grid::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.lengths-grid::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.lengths-grid::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.length-item {
  padding: 8px 5px;
  text-align: center;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.length-item:hover {
  background: #e9ecef;
  border-color: var(--primary-color);
}

.length-item.selected {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  font-weight: 600;
}

.selected-length-info {
  margin-top: 15px;
  padding: 15px;
  background: #e8f5e9;
  border-radius: 8px;
  border: 1px solid #a5d6a7;
}

.selected-length-info p {
  margin: 5px 0;
  font-size: 14px;
}

.selected-length-info strong {
  color: #2e7d32;
}

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

.product-quantity label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.quantity-controls {
  display: flex;
  align-items: center;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}

.quantity-controls button {
  width: 50px;
  height: 50px;
  border: none;
  background: #f8f9fa;
  color: #333;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.quantity-controls button:hover {
  background: #e9ecef;
}

.quantity-controls input {
  width: 80px;
  height: 50px;
  border: none;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.quantity-controls input:focus {
  outline: none;
}

.product-actions {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.btn {
  padding: 15px 30px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  flex: 1;
}

.btn-primary:hover {
  background: #b91c1c;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(220, 38, 38, 0.3);
}

.btn-secondary {
  background: white;
  color: #333;
  border: 2px solid #e9ecef;
}

.btn-secondary:hover {
  background: #f8f9fa;
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-secondary.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.product-description-section {
  margin-top: 30px;
  padding: 25px;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid var(--primary-color);
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.product-description-section h3 {
  margin: 0 0 15px 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.product-description-section p {
  margin: 0;
  line-height: 1.6;
  color: #666;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.product-tabs {
  margin-top: 40px;
  border-top: 2px solid #e9ecef;
  padding-top: 30px;
}

.tabs-header {
  display: flex;
  gap: 10px;
  border-bottom: 2px solid #e9ecef;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 15px 30px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 16px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.3s;
}

.tab-btn:hover {
  color: var(--primary-color);
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s;
}

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

.characteristics-table {
  width: 100%;
  table-layout: fixed;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.characteristics-table tr {
  border-bottom: 1px solid #e9ecef;
}

.characteristics-table td {
  padding: 15px 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 0;
}

.characteristics-table td:first-child {
  font-weight: 600;
  color: #666;
  width: 40%;
}

.characteristics-table td:last-child {
  color: #333;
}

.delivery-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.delivery-option {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #e9ecef;
}

.delivery-option h4 {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 10px;
}

.delivery-option h4 i {
  color: var(--primary-color);
}

.delivery-option p {
  margin: 5px 0;
  font-size: 14px;
  color: #666;
}

.delivery-option .price {
  font-weight: 600;
  color: #28a745;
  font-size: 16px;
}

.loading-indicator {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.loading-indicator i {
  font-size: 48px;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.error-message {
  text-align: center;
  padding: 40px 20px;
}

.error-message h2 {
  color: #dc3545;
  margin-bottom: 15px;
}

.error-message p {
  color: #666;
  margin-bottom: 20px;
}

/* Стили для модального окна с вкладками */
.modal .product-tabs {
  margin-top: 30px;
  border-top: 2px solid #e9ecef;
  padding-top: 20px;
}

.modal .product-meta {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 15px;
}

.modal .product-description-section {
  margin-top: 20px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid var(--primary-color);
}

.modal .product-description-section h3 {
  margin: 0 0 15px 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.modal .delivery-info,
.modal .payment-info {
  padding: 20px 0;
}

.modal .payment-info ul {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}

.modal .payment-info li {
  padding: 10px 0;
  border-bottom: 1px solid #e9ecef;
}

.modal .payment-info li:last-child {
  border-bottom: none;
}

.modal .payment-info i {
  margin-right: 10px;
  color: var(--primary-color);
}

/* Адаптивность */
@media (max-width: 1024px) {
  .product-detail-layout {
    grid-template-columns: 1fr;
  }
  
  .product-tabs {
    margin-top: 30px;
  }
}

@media (max-width: 768px) {
  .product-detail-container {
    padding: 20px;
    margin: 15px 0;
  }
  
  .product-detail-layout {
    gap: 20px;
  }
  
  .product-info {
    max-height: none;
    overflow: visible;
  }
  
  .product-title {
    font-size: 24px;
  }
  
  .current-price {
    font-size: 28px;
  }
  
  .product-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
  
  .product-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .tabs-header {
    flex-wrap: wrap;
  }
  
  .tab-btn {
    padding: 10px 15px;
    font-size: 14px;
  }
  
  .sheet-length-selector {
    padding: 12px;
  }
  
  .lengths-grid {
    max-height: 300px;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 5px;
    padding: 8px;
  }
  
  .length-item {
    padding: 6px 4px;
    font-size: 12px;
  }
  
  .length-filter-tabs {
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .length-filter-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .delivery-info {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .product-main-image {
    min-height: 250px;
  }
  
  .product-price {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  .breadcrumbs {
    font-size: 12px;
  }
}

/* Стили для рейтинга */
.rating-section {
  padding: 20px 0;
}

.rating-section h3 {
  margin-bottom: 15px;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.user-rating-input {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 10px;
  margin-bottom: 30px;
}

.rating-stars-input {
  display: flex;
  gap: 10px;
  font-size: 36px;
  margin-bottom: 10px;
}

.rating-stars-input i {
  color: #ffc107;
  cursor: pointer;
  transition: transform 0.2s;
}

.rating-stars-input i:hover {
  transform: scale(1.2);
}

.rating-hint {
  font-size: 14px;
  color: #666;
  margin: 10px 0;
}

.current-user-rating {
  margin-top: 15px;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
}

.rating-statistics {
  background: white;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid #e9ecef;
}

.rating-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rating-bar {
  display: grid;
  grid-template-columns: 60px 1fr 50px;
  align-items: center;
  gap: 15px;
}

.rating-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 5px;
}

.rating-label i {
  color: #ffc107;
  font-size: 12px;
}

.rating-bar-bg {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.rating-bar-fill {
  height: 100%;
  background: #ffc107;
  transition: width 0.3s;
}

.rating-count {
  font-size: 14px;
  color: #666;
  text-align: right;
}

