/* Vista detalle producto — galería estilo marketplace */

.product-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(20, 24, 36, 0.65);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}

.pd-dialog {
  position: relative;
  width: min(1100px, 100%);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: 24px;
  margin: auto;
}

.pd-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.pd-close:hover {
  background: #eee;
}

.pd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 32px;
  align-items: start;
}

.pd-gallery {
  display: flex;
  gap: 12px;
  min-height: 360px;
}

.pd-thumbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.pd-thumb {
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}

.pd-thumb.is-active {
  border-color: #3483fa;
}

.pd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pd-main-image {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  min-height: 360px;
  padding: 16px;
}

.pd-main-image img {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
}

.pd-info {
  padding-top: 8px;
}

.pd-meta {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: #666;
}

.pd-title {
  margin: 0 0 12px;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.35;
  color: #333;
}

.pd-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
}

.pd-badge--low {
  background: #fff5e6;
  color: #e65100;
}

.pd-badge--out {
  background: #fce4ec;
  color: #c62828;
}

.pd-badge--ok {
  background: #e8f5e9;
  color: #2e7d32;
}

.pd-price-old {
  margin: 0 0 4px;
  font-size: 0.95rem;
  color: #999;
}

.pd-price {
  margin: 0 0 20px;
  font-size: 2.2rem;
  font-weight: 300;
  color: #333;
  letter-spacing: -0.02em;
}

.pd-description {
  margin-bottom: 24px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.pd-description h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
}

.pd-description p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #555;
  white-space: pre-wrap;
}

.pd-qty-row {
  margin-bottom: 16px;
}

.pd-qty-row label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.pd-qty-controls {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}

.pd-qty-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: #f5f5f5;
  font-size: 1.2rem;
  cursor: pointer;
}

.pd-qty-input {
  width: 52px;
  height: 36px;
  border: none;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  text-align: center;
  font-size: 1rem;
}

.pd-stock-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: #888;
}

.pd-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pd-actions .btn {
  width: 100%;
  justify-content: center;
  padding: 14px 20px;
  font-size: 1rem;
  border-radius: 6px;
}

.pd-btn-buy {
  background: #3483fa;
  color: #fff;
  border: none;
}

.pd-btn-buy:hover {
  background: #2968c8;
}

.pd-unavailable {
  color: #c62828;
  margin-bottom: 12px;
}

.pd-video {
  margin-bottom: 20px;
}

.pd-video h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.pd-video video {
  width: 100%;
  max-height: 280px;
  border-radius: 8px;
  background: #000;
}

.producto-card.is-clickable {
  cursor: pointer;
}

.producto-card .producto-view-link {
  margin: 0 18px 14px;
  padding: 0;
  border: none;
  background: none;
  color: var(--theme-strong, #3483fa);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
}

@media (max-width: 768px) {
  .pd-layout {
    grid-template-columns: 1fr;
  }

  .pd-gallery {
    flex-direction: column-reverse;
  }

  .pd-thumbs {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .pd-main-image {
    min-height: 280px;
  }

  .pd-price {
    font-size: 1.75rem;
  }
}
