/* contenedor general de la vista detalle */
.detalle {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  padding: 2rem 5%;
}

/* === Layout tipo Mercado Libre === */
.ml-gallery {
  display: grid;
  /* thumbs | main | zoom */
  grid-template-columns: 120px minmax(420px, 580px) 460px;
  gap: 16px;
  align-items: start;
}

/* Miniaturas */
.ml-thumbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ml-thumbs img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.ml-thumbs img:hover { transform: scale(1.05); border-color: #c77224; }
.ml-thumbs img.active { border-color: #c77224; box-shadow: 0 0 0 2px rgba(199,114,36,.2); }

/* Imagen principal */
.viewer {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #eee;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
#mainImg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.lens {
  position: absolute;
  width: 110px;
  height: 110px;
  border: 2px solid rgba(180,120,60,0.35);
  background-color: rgba(255,255,255,0.25);
  border-radius: 10px;
  visibility: hidden;
  pointer-events: none;
  cursor: crosshair;
}

/* Panel de zoom a la derecha, más pegado */
.zoom-result {
  width: 360px;
  height: 360px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 220% 220%;
}

/* info del producto */
.info-producto {
  max-width: 360px;
  color: #4a2b0f;
}
.info-producto h1 {
  font-size: 2rem;
  margin-bottom: .5rem;
}
.info-producto .descripcion {
  margin-bottom: 1rem;
  line-height: 1.5;
}
.info-producto .precio {
  font-size: 1.6rem;
  font-weight: 700;
  color: #c77224;
  margin-bottom: 1.5rem;
}
.botones {
  display: flex;
  gap: 1rem;
}

/* Responsive */
@media (max-width: 1050px) {
  .detalle {
    flex-direction: column;
  }
  .ml-gallery {
    grid-template-columns: 72px 1fr;
  }
  .zoom-result { display: none; }
}
