/* Enhanced Product Details CSS with Overflow Fixes */

/* Related Products Section */
.related-products-section .product-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin-bottom: 25px;
  text-align: center;
  padding: 25px;
  border: 2px solid transparent;
  position: relative;
  min-height: 380px;
  backdrop-filter: blur(10px);
}

.related-products-section .product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 123, 255, 0.05), rgba(0, 86, 179, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.related-products-section .product-card:hover::before {
  opacity: 1;
}

.related-products-section .product-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 123, 255, 0.15);
  border: 2px solid #007bff;
}

.related-products-section .product-item {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.related-products-section .product-thumbnail {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 20px;
  transition: all 0.4s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.related-products-section .product-card:hover .product-thumbnail {
  transform: scale(1.08) rotate(1deg);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.related-products-section .product-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 12px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 2.8rem;
  word-wrap: break-word;
  hyphens: auto;
}

.related-products-section .product-description {
  font-size: 0.9rem;
  color: #6c757d;
  line-height: 1.5;
  margin-bottom: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  min-height: 4rem;
  word-wrap: break-word;
  hyphens: auto;
}

.related-products-section .product-price {
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(45deg, #28a745, #20c997);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  display: block;
  min-height: 1.5rem;
}

.related-products-section .enquire-btn {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  background: linear-gradient(135deg, #007bff, #0056b3);
  border: none;
  border-radius: 12px;
  color: #fff;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.related-products-section .enquire-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.related-products-section .enquire-btn:hover::before {
  left: 100%;
}

.related-products-section .enquire-btn:hover {
  background: linear-gradient(135deg, #0056b3, #003d80);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

.related-products-section .row {
  margin-left: -15px;
  margin-right: -15px;
}

.related-products-section .col-12,
.related-products-section .col-md-3 {
  padding-left: 15px;
  padding-right: 15px;
  margin-bottom: 20px;
}

/* Product Details Section */
.product-section {
  padding: 60px 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  position: relative;
}

.product-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23000" opacity="0.02"/><circle cx="75" cy="75" r="1" fill="%23000" opacity="0.02"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.5;
  pointer-events: none;
}

.product-image-container {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  padding: 20px;
  transition: all 0.4s ease;
  position: relative;
}

.product-image-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(0, 123, 255, 0.03), rgba(0, 86, 179, 0.03));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.product-image-container:hover::before {
  opacity: 1;
}

.product-image-container:hover {
  transform: scale(1.03);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.product-thumbnail {
  width: 100%;
  height: auto;
  max-height: 450px;
  object-fit: contain;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.product-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(45deg, #2c3e50, #34495e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  line-height: 1.2;
  word-wrap: break-word;
  hyphens: auto;
}

.product-category {
  font-size: 1.1rem;
  font-weight: 600;
  color: #6c757d;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(108, 117, 125, 0.1);
  border-radius: 25px;
  display: inline-flex;
  word-wrap: break-word;
}

.product-price {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(45deg, #28a745, #20c997);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-info-section {
  background: #ffffff;
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 25px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 123, 255, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.product-info-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(45deg, #007bff, #0056b3);
  transition: width 0.3s ease;
}

.product-info-section:hover::before {
  width: 8px;
}

.product-info-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

.product-info-section .section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e9ecef;
}

.product-info-section .section-title i {
  font-size: 1.2rem;
  color: #007bff;
}

.product-info-section p {
  font-size: 1.05rem;
  color: #555;
  line-height: 1.7;
  word-wrap: break-word;
  hyphens: auto;
  overflow-wrap: break-word;
}

/* Enhanced Specifications Grid */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.spec-item {
  display: flex;
  flex-direction: column;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 12px;
  border-left: 4px solid #007bff;
  transition: all 0.3s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.spec-item:hover {
  background: #e3f2fd;
  transform: translateX(5px);
}

.spec-key {
  font-weight: 700;
  color: #2c3e50;
  font-size: 1rem;
  margin-bottom: 5px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.spec-value {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  white-space: pre-wrap;
}

/* Enhanced Features and Applications Lists */
.features-list, .applications-list {
  list-style: none;
  padding: 0;
  margin: 15px 0 0 0;
  display: grid;
  gap: 12px;
}

.features-list li, .applications-list li {
  font-size: 1rem;
  color: #555;
  position: relative;
  padding: 12px 12px 12px 40px;
  background: #f8f9fa;
  border-radius: 8px;
  transition: all 0.3s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.6;
}

.features-list li:hover, .applications-list li:hover {
  background: #e3f2fd;
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
}

.features-list li::before, .applications-list li::before {
  content: '\f058';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: #007bff;
  position: absolute;
  left: 12px;
  top: 14px;
  font-size: 1.1rem;
}

/* Enhanced Buttons */
.back-button, .enquiry-button {
  padding: 15px 30px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.back-button {
  background: linear-gradient(135deg, #6c757d, #5a6268);
  color: #fff;
}

.back-button:hover {
  background: linear-gradient(135deg, #5a6268, #495057);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(108, 117, 125, 0.3);
  color: #fff;
}

.enquiry-button {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: #fff;
}

.enquiry-button:hover {
  background: linear-gradient(135deg, #0056b3, #003d80);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
  color: #fff;
}

.back-button::before, .enquiry-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.back-button:hover::before, .enquiry-button:hover::before {
  left: 100%;
}

/* Enhanced Error State */
.product-not-found {
  text-align: center;
  padding: 60px 40px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: 2px dashed #dc3545;
}

.product-not-found h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #dc3545;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.product-not-found p {
  font-size: 1.1rem;
  color: #6c757d;
  margin-bottom: 30px;
  line-height: 1.6;
}

/* Enhanced Section Title */
.section-title {
  position: relative;
  padding-bottom: 15px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(45deg, #007bff, #0056b3);
  border-radius: 2px;
}

/* Breadcrumb Enhancement */
.breadcrumb-section {
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  padding: 20px 0;
  border-bottom: 1px solid #e9ecef;
}

.breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0;
}

.breadcrumb-item a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
  color: #0056b3;
}

.breadcrumb-item.active {
  color: #6c757d;
  font-weight: 600;
}

/* Loading States */
.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design Enhancements */
@media (max-width: 1200px) {
  .specs-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
  }
}

@media (max-width: 991px) {
  .related-products-section .product-card {
    min-height: 350px;
    padding: 20px;
  }
  
  .related-products-section .product-thumbnail {
    height: 160px;
  }
  
  .related-products-section .product-title {
    font-size: 1.05rem;
    min-height: 2.6rem;
  }
  
  .related-products-section .product-price {
    font-size: 1rem;
  }
  
  .related-products-section .enquire-btn {
    padding: 10px 14px;
    font-size: 0.9rem;
  }
  
  .product-title {
    font-size: 2rem;
  }
  
  .product-price {
    font-size: 1.5rem;
  }
  
  .product-info-section {
    padding: 25px;
  }
  
  .product-info-section .section-title {
    font-size: 1.25rem;
  }
  
  .back-button, .enquiry-button {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
  
  .specs-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 767px) {
  .product-section {
    padding: 40px 0;
  }
  
  .related-products-section .product-card {
    min-height: 320px;
    padding: 15px;
  }
  
  .related-products-section .product-thumbnail {
    height: 140px;
  }
  
  .related-products-section .product-title {
    font-size: 1rem;
    min-height: 2.4rem;
  }
  
  .related-products-section .product-description {
    font-size: 0.85rem;
    min-height: 3.5rem;
    -webkit-line-clamp: 2;
  }
  
  .related-products-section .product-price {
    font-size: 0.95rem;
  }
  
  .related-products-section .enquire-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  
  .product-title {
    font-size: 1.75rem;
  }
  
  .product-price {
    font-size: 1.25rem;
  }
  
  .product-info-section {
    padding: 20px;
  }
  
  .product-info-section .section-title {
    font-size: 1.15rem;
  }
  
  .back-button, .enquiry-button {
    padding: 10px 20px;
    font-size: 0.9rem;
    width: 100%;
    margin-bottom: 10px;
    justify-content: center;
  }
  
  .product-image-container {
    padding: 15px;
  }
  
  .product-thumbnail {
    max-height: 350px;
  }
  
  .spec-item {
    padding: 12px;
  }
  
  .features-list li, .applications-list li {
    padding: 10px 10px 10px 35px;
    font-size: 0.95rem;
  }
  
  .features-list li::before, .applications-list li::before {
    left: 10px;
    top: 12px;
  }
}

@media (max-width: 576px) {
  .related-products-section .col-md-3 {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  .product-category {
    font-size: 1rem;
    padding: 6px 12px;
  }
  
  .product-info-section {
    padding: 15px;
  }
  
  .spec-item {
    padding: 10px;
  }
  
  .spec-key {
    font-size: 0.95rem;
  }
  
  .spec-value {
    font-size: 0.9rem;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus States for Better Accessibility */
.product-card:focus-within,
.enquiry-btn:focus,
.back-button:focus,
.enquiry-button:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .related-products-section,
  .back-button,
  .enquiry-button {
    display: none !important;
  }
  
  .product-section {
    background: white !important;
  }
  
  .product-info-section {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}