/* Vista de detalle del producto. Puede conservarse en un archivo separado. */
.product-image {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.product-title-button {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.product-title-button:hover,
.product-title-button:focus-visible {
  text-decoration: underline;
}

.product-card__actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}

.product-view-button {
  padding-inline: 1rem;
}

.product-modal {
  width: min(1120px, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 28px;
  overflow: hidden;
  background: #fff;
  color: #17132b;
  box-shadow: 0 30px 90px rgba(23, 19, 43, .28);
}

.product-modal::backdrop {
  background: rgba(12, 10, 24, .72);
  backdrop-filter: blur(8px);
}

.product-modal__shell {
  position: relative;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.product-modal__close {
  position: absolute;
  z-index: 5;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,.9);
  box-shadow: 0 8px 24px rgba(23,19,43,.14);
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
  min-height: 650px;
}

.product-gallery {
  padding: 2rem;
  background: #f5f3fa;
}

.product-gallery__main {
  display: grid;
  place-items: center;
  min-height: 490px;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
}

.product-gallery__main img {
  width: 100%;
  height: 490px;
  object-fit: contain;
}

.product-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}

.product-gallery__thumb {
  aspect-ratio: 1;
  padding: .25rem;
  border: 2px solid transparent;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}

.product-gallery__thumb.is-active {
  border-color: #6c4cff;
}

.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
}

.product-detail__content {
  padding: 4.25rem 2.5rem 2.5rem;
}

.product-detail__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.product-detail__status {
  display: inline-flex;
  padding: .45rem .75rem;
  border-radius: 999px;
  background: #eeebff;
  color: #5a3ae6;
  font-size: .8rem;
  font-weight: 800;
}

.product-detail__content h2 {
  margin: .65rem 0 .35rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.02;
}

.product-detail__brand {
  margin: 0;
  color: #756f87;
}

.product-detail__price {
  display: block;
  margin: 1.25rem 0;
  font-size: 2rem;
}

.product-detail__description {
  color: #5f596f;
  line-height: 1.75;
}

.product-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin: 1.5rem 0;
}

.product-specs div {
  padding: .9rem 1rem;
  border: 1px solid #e9e5f2;
  border-radius: 14px;
}

.product-specs dt {
  color: #817a91;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.product-specs dd {
  margin: .25rem 0 0;
  font-weight: 800;
}

.product-detail__lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.product-detail__lists h3 {
  margin-bottom: .65rem;
  font-size: 1rem;
}

.product-detail__lists ul {
  margin: 0;
  padding-left: 1.15rem;
  color: #686174;
  line-height: 1.65;
}

.product-detail__actions {
  display: flex;
  gap: .75rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.product-modal-open {
  overflow: hidden;
}

@media (max-width: 850px) {
  .product-detail {
    grid-template-columns: 1fr;
  }

  .product-gallery__main,
  .product-gallery__main img {
    min-height: 350px;
    height: 350px;
  }

  .product-detail__content {
    padding: 2rem 1.25rem;
  }
}

@media (max-width: 520px) {
  .product-modal {
    width: 100%;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .product-gallery {
    padding: 1rem;
  }

  .product-gallery__main,
  .product-gallery__main img {
    min-height: 290px;
    height: 290px;
  }

  .product-gallery__thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-specs,
  .product-detail__lists {
    grid-template-columns: 1fr;
  }
}
