/* ============================================
   ESTILOS ESPECÍFICOS PARA DETALLE DE PRODUCTO
   ============================================ */

/* Breadcrumb Container */
.breadcrumb-container {
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  padding: 1rem 0;
}

.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #6c757d;
}

.breadcrumb a {
  color: #007bff;
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: #0056b3;
}

.breadcrumb span {
  color: #adb5bd;
}

.breadcrumb strong {
  color: #495057;
  font-weight: 600;
}

/* Main Product Detail Container */
.product-detail-main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Product Detail Container */
.product-detail-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
  animation: fadeIn 0.6s ease;
}

/* Product Image Section */
.product-image-section {
  position: sticky;
  top: 2rem;
  height: fit-content;
}

.main-image {
  width: 100%;
  height: 500px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.main-image img:hover {
  transform: scale(1.05);
}

.no-image-large {
  font-size: 4rem;
  color: #adb5bd;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Product Info Section */
.product-info-section {
  padding: 1rem 0;
}

.product-header {
  margin-bottom: 2rem;
}

.product-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #212529;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.product-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.category-tag,
.brand-tag {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.brand-tag {
  background: linear-gradient(135deg, #28a745, #1e7e34);
}

/* Product Description */
.product-description {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #2563eb;
}

.product-description h3 {
  margin-bottom: 1rem;
  color: #1f2937;
  font-size: 1.2rem;
  font-weight: 600;
}

.product-description p {
  line-height: 1.8;
  color: #4b5563;
  white-space: pre-wrap;
  /* ✅ ESTO RESPETA LOS SALTOS DE LÍNEA */
  overflow-wrap: break-word;
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
  /* ✅ ALTURA AUTOMÁTICA */
  text-align: left;
  display: block;
  /* ✅ ASEGURA QUE SE MUESTRE COMPLETO */
  word-wrap: break-word;
}
/* Pricing Section */
.pricing-section {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.pricing-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #007bff, #28a745, #17a2b8);
}

/* Pricing for logged users */
.logged-in-pricing {
  text-align: center;
}

.price-comparison {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.price-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.price-item.featured {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: #212529; /* Ensure text is dark for readability */
  padding: 1.5rem;
  border-radius: 12px;
  position: relative;
  transform: scale(1.02);
  box-shadow: 0 10px 25px rgba(40, 167, 69, 0.3);
}

.price-item.crossed-out {
  opacity: 0.6;
  position: relative;
}

.price-label {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #212529; /* Dark text for all price labels */
}

.price-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #212529; /* Dark text for all price values */
}

.public-price-crossed {
  text-decoration: line-through;
  color: #dc3545;
  font-size: 1.8rem;
}

.installer-price {
  color: #2b6bcc;
}

.discount-badge {
  background: #ffc107;
  color: #212529;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.5rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Pricing for non-logged users */
.not-logged-pricing {
  text-align: center;
}

.public-price-section .price-value {
  font-size: 2.8rem;
  font-weight: 700;
  color: #007bff;
  margin-bottom: 1rem;
}

.login-prompt {
  background: linear-gradient(135deg, #17a2b8, #138496);
  color: white;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.login-link {
  color: #ffc107;
  background: none;
  border: none;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
}

.login-link:hover {
  color: #fff3cd;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.add-to-cart-btn,
.login-for-discount-btn,
.contact-btn {
  width: 100%;
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.add-to-cart-btn {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.login-for-discount-btn {
  background: linear-gradient(135deg, #ffc107, #f39c12);
  color: #212529;
  box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.login-for-discount-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 193, 7, 0.4);
}

.contact-btn {
  background: linear-gradient(135deg, #17a2b8, #138496);
  color: white;
  box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.contact-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(23, 162, 184, 0.4);
}

/* Accessories Section */
.accessories-section {
  padding: 2rem 0;
  background: #f9fafb;
  animation: fadeIn 0.8s ease;
}

.accessories-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: #6b7280;
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* Accessories Carousel */
.accessories-carousel-container {
  position: relative;
  overflow: hidden;
  margin: 0 2rem;
  padding: 0 60px;
}

.accessories-carousel-wrapper {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.accessories-carousel {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  gap: 1rem;
  width: fit-content;
}

.accessory-card {
  flex: 0 0 calc((100% / var(--slides-to-show, 4)) - 1rem);
  min-width: calc((100% / var(--slides-to-show, 4)) - 1rem);
  max-width: calc((100% / var(--slides-to-show, 4)) - 1rem);
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: auto;
  overflow: hidden;
  visibility: visible !important;
  display: flex !important;
  flex-direction: column;
}

.accessory-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.accessory-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  cursor: pointer;
}

.accessory-image img,
.no-image-accessory {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 2rem;
  cursor: pointer;
}

.accessory-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: calc(100% - 200px);
}

.accessory-name {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  margin: 0;
  min-height: 2.6rem;
}

.accessory-name:hover {
  color: #2563eb;
}

.accessory-description {
  font-size: 0.875rem;
  color: #6b7280;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  margin: 0;
  min-height: 4.2rem;
}

.accessory-meta {
  margin: 0.25rem 0;
}

.accessory-brand {
  font-size: 0.75rem;
  color: #059669;
  background: rgba(5, 150, 105, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

.accessory-price {
  margin: 0.5rem 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.price-small {
  font-size: 0.875rem;
  margin: 0.125rem 0;
}

.price-crossed {
  text-decoration: line-through;
  color: #9ca3af;
  font-size: 0.875rem;
}

.price-special {
  font-weight: bold;
  color: #059669;
  font-size: 1rem;
}

.price-public {
  font-weight: bold;
  color: #2563eb;
  font-size: 1rem;
}

.add-accessory-btn {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s ease;
  width: 100%;
  margin-top: 0.5rem;
}

.add-accessory-btn:hover {
  background: #1d4ed8;
}

/* Carousel Navigation */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(37, 99, 235, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-nav:hover {
  background: rgba(37, 99, 235, 1);
  transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
  left: 10px;
}

.carousel-nav.next {
  right: 10px;
}

.carousel-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Carousel Indicators */
.carousel-indicators {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
  gap: 0.5rem;
}

.carousel-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-indicator:hover {
  background: rgba(37, 99, 235, 0.7);
}

.carousel-indicator.active {
  background: rgba(37, 99, 235, 1);
  transform: scale(1.2);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .product-detail-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .product-image-section {
    position: static;
    order: 1;
  }

  .product-info-section {
    order: 2;
  }

  .accessory-card {
    flex: 0 0 calc((100% / 3) - 1rem);
    min-width: calc((100% / 3) - 1rem);
    max-width: calc((100% / 3) - 1rem);
  }

  .accessories-carousel-container {
    padding: 0 50px;
  }
}

@media (max-width: 768px) {
  .product-title {
    font-size: 2rem;
  }

  .main-image {
    height: 350px;
  }

  .product-meta {
    justify-content: center;
  }

  .price-comparison {
    gap: 1rem;
  }

  .price-value {
    font-size: 2rem;
  }

  .action-buttons {
    gap: 0.8rem;
  }

  .accessory-card {
    flex: 0 0 calc((100% / 2) - 1rem);
    min-width: calc((100% / 2) - 1rem);
    max-width: calc((100% / 2) - 1rem);
  }

  .accessories-carousel-container {
    margin: 0 1rem;
    padding: 0 40px;
  }

  .carousel-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .accessory-image {
    height: 150px;
  }

  .accessory-info {
    height: calc(100% - 150px);
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .breadcrumb {
    font-size: 0.8rem;
    padding: 0 0.5rem;
    flex-wrap: wrap;
  }

  .product-detail-main {
    margin: 1rem auto;
    padding: 0 0.5rem;
  }

  .product-title {
    font-size: 1.8rem;
    text-align: center;
  }

  .main-image {
    height: 280px;
  }

  .product-description {
    padding: 1rem;
    margin: 1rem 0;
  }

  .product-description p {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .pricing-section {
    padding: 1.5rem;
  }

  .price-value {
    font-size: 1.8rem;
  }

  .action-buttons .add-to-cart-btn,
  .action-buttons .login-for-discount-btn,
  .action-buttons .contact-btn {
    padding: 1rem;
    font-size: 1rem;
  }

  .accessory-card {
    flex: 0 0 calc(100% - 1rem);
    min-width: calc(100% - 1rem);
    max-width: calc(100% - 1rem);
  }

  .accessories-carousel-container {
    padding: 0 30px;
    margin: 0 0.5rem;
  }

  .carousel-nav {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .carousel-nav.prev {
    left: 5px;
  }

  .carousel-nav.next {
    right: 5px;
  }

  .accessory-image {
    height: 180px;
  }

  .accessories-section {
    padding: 2rem 0;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .section-subtitle {
    font-size: 1rem;
  }
}

/* Animation Improvements */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading States */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Loading Placeholder */
.loading-placeholder {
  display: none;
  text-align: center;
  padding: 2rem;
  color: #6b7280;
}

/* No Products Message */
.no-products-message {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
  font-style: italic;
}

/* Focus States for Accessibility */
.add-to-cart-btn:focus,
.login-for-discount-btn:focus,
.contact-btn:focus,
.add-accessory-btn:focus {
  outline: 3px solid rgba(0, 123, 255, 0.5);
  outline-offset: 2px;
}

.accessory-name:focus,
.accessory-image img:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Estilos adicionales para el mensaje de no productos */
.no-products-message {
  text-align: center;
  padding: 3rem 2rem;
  color: #6b7280;
}

.no-products-message h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #374151;
}

.btn-back-to-products {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-top: 1rem;
}

.btn-back-to-products:hover {
  background: #1d4ed8;
}

/* Mejorar la responsividad de las imágenes */
.accessory-image img {
  transition: transform 0.3s ease;
}

.accessory-image:hover img {
  transform: scale(1.05);
}

/* Mejorar el indicador de carga */
.accessory-image img[loading="lazy"] {
  background: #f3f4f6;
}

/* Debug styles (remover en producción) */
#carouselDebug {
  background: #f3f4f6;
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px dashed #d1d5db;
}
