/* =========================
   Página de detalle de obra
   ========================= */

.obra-detalle {
  padding: 3rem 1rem 4rem 1rem;
  background-color: var(--crema);
}

.obra-detalle-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* Panel de información (izquierda) */
.obra-info-panel {
  background: var(--blanco);
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(196, 164, 132, 0.3);
  box-shadow: 0 10px 28px rgba(90, 62, 43, 0.1);
}

.obra-titulo-grande {
  font-family: var(--fuente-titulos);
  font-size: 2rem;
  font-weight: 700;
  color: var(--cafe-oscuro);
  margin-bottom: 0.3rem;
}

.obra-tecnica-grande,
.obra-precio-grande {
  font-size: 1rem;
  color: var(--cafe-medio);
  margin-bottom: 0.4rem;
}

.obra-descripcion h2 {
  font-family: var(--fuente-titulos);
  font-size: 1.4rem;
  color: var(--cafe-oscuro);
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
}

.obra-descripcion p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--cafe-oscuro);
}

.obra-acciones {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

/* Visor de imágenes (derecha) */
.obra-visores {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.obra-imagen-principal {
  width: 100%;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(196, 164, 132, 0.35);
  background: var(--blanco);
  box-shadow: 0 10px 28px rgba(90, 62, 43, 0.1);
}

.obra-imagen-principal img {
  width: 100%;
  height: auto;
  display: block;
}

.obra-miniaturas {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.3rem;
}

.obra-miniaturas img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.obra-miniaturas img:hover {
  transform: scale(1.03);
}

.obra-miniaturas img.activa {
  border-color: var(--cafe-medio);
}

/* Desktop */
@media (min-width: 900px) {
  .obra-detalle-inner {
    grid-template-columns: 1fr 1.4fr;
    gap: 3.5rem;
  }

  .obra-acciones {
    flex-direction: row;
  }
}
/* =================================
   Visor 3D experimental de obra1
   ================================= */

.visor-3d-contenedor {
  background:
    radial-gradient(circle at 50% 25%, #fffdf8 0%, #f1e5d7 100%);
  border: 1px solid rgba(139, 94, 60, 0.3);
  border-radius: 1rem;
  box-shadow:
    0 14px 32px rgba(90, 62, 43, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  overflow: hidden;
}

#visor-3d {
  width: 100%;
  height: 470px;
  cursor: grab;
}

#visor-3d:active {
  cursor: grabbing;
}

#visor-3d canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.visor-3d-ayuda {
  margin: 0;
  padding: 0.8rem 1rem 1rem;
  text-align: center;
  color: var(--cafe-medio);
  font-size: 0.85rem;
  background-color: rgba(255, 255, 255, 0.55);
  border-top: 1px dashed rgba(139, 94, 60, 0.18);
}

.visor-3d-error {
  padding: 2rem;
  color: var(--cafe-oscuro);
  text-align: center;
}

/* Un visor algo más bajo para celular */
@media (max-width: 767px) {
  #visor-3d {
    height: 330px;
  }
}
/* =================================
   Visor 3D experimental de obra1
   ================================= */

.visor-3d-contenedor {
  background:
    radial-gradient(circle at 50% 25%, #fffdf8 0%, #f1e5d7 100%);
  border: 1px solid rgba(139, 94, 60, 0.3);
  border-radius: 1rem;
  box-shadow:
    0 14px 32px rgba(90, 62, 43, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  overflow: hidden;
}

#visor-3d {
  width: 100%;
  height: 470px;
  cursor: grab;
}

#visor-3d:active {
  cursor: grabbing;
}

#visor-3d canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.visor-3d-ayuda {
  margin: 0;
  padding: 0.8rem 1rem 1rem;
  text-align: center;
  color: var(--cafe-medio);
  font-size: 0.85rem;
  background-color: rgba(255, 255, 255, 0.55);
  border-top: 1px dashed rgba(139, 94, 60, 0.18);
}

/* Imagen normal de respaldo */
.obra-respaldo {
  background-color: var(--blanco);
  padding: 0.7rem;
  border: 1px solid rgba(196, 164, 132, 0.3);
  border-radius: 0.8rem;
  box-shadow: 0 8px 20px rgba(90, 62, 43, 0.08);
}

.obra-respaldo p {
  margin: 0 0 0.5rem;
  color: var(--cafe-medio);
  font-size: 0.85rem;
  text-align: center;
}

.obra-respaldo img {
  display: block;
  width: 100%;
  max-height: 300px;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 0.4rem;
}

.visor-3d-error {
  margin: 0;
  padding: 2rem;
  color: var(--cafe-oscuro);
  text-align: center;
}

@media (max-width: 767px) {
  #visor-3d {
    height: 330px;
  }
}
/* =================================
   Miniaturas interactivas de obra1
   ================================= */

.obra-miniaturas {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.35rem 0.2rem 0.7rem;
}

.miniatura {
  flex: 0 0 78px;
  width: 78px;
  height: 78px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 0.55rem;
  background-color: var(--blanco);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(90, 62, 43, 0.1);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.miniatura:hover {
  transform: translateY(-3px);
  border-color: var(--cafe-claro);
}

.miniatura.activa {
  border-color: var(--cafe-medio);
  box-shadow: 0 5px 14px rgba(90, 62, 43, 0.2);
}

.miniatura img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Imagen grande normal */
#imagen-respaldo {
  display: block;
  width: 100%;
  max-height: 420px;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 0.4rem;
}

@media (max-width: 767px) {
  .miniatura {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
  }
}
/* =================================
   Orden en móvil: visores primero
   ================================= */

@media (max-width: 899px) {
  .obra-detalle-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  /* Cambiar orden: visores primero, info después */
  .obra-visores {
    order: -1;
  }
  
  .obra-info-panel {
    order: 0;
  }
}

/* Escritorio: mantener orden original */
@media (min-width: 900px) {
  .obra-detalle-inner {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2.5rem;
    align-items: start;
  }
  
  .obra-info-panel {
    order: 0;
  }
  
  .obra-visores {
    order: 0;
  }
}