/* Legacy — galería base (landings / páginas sin marco Atelier) */
.galeria-container {
    padding: 10px;
}

.imagen-principal-container {
    position: relative;
    height: max-content;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f0f0f0;
}

#imagen-principal {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    background-color: #f0f0f0;
}

.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 40px;
    height: 60px;
    font-size: 20px;
    cursor: pointer;
    z-index: 2;
}

#prev-btn {
    left: 0;
    border-radius: 0 5px 5px 0;
}

#next-btn {
    right: 0;
    border-radius: 5px 0 0 5px;
}

.miniaturas-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.miniatura {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid #ddd;
}

.miniatura.active {
    border-color: #3498db;
}

.modal-zoom {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    text-align: center;
}

.modal-contenido {
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.cerrar-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .miniatura {
        width: 70px;
        height: 70px;
    }
}

/* Detalle producto — marco Atelier (sobrescribe legacy cuando aplica) */
.detalle-producto-galeria .galeria-container {
    padding: 0;
}

.detalle-producto-galeria-wrap {
    position: relative;
    padding: 14px;
    margin-bottom: 1.25rem;
    overflow: visible;
    background: var(--at-cream, #ebe6de);
    border-radius: var(--at-radius, 4px);
    height: auto;
}

.detalle-producto-galeria-wrap::after {
    content: '';
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(184, 149, 108, 0.35);
    border-left: none;
    border-bottom: none;
    pointer-events: none;
    z-index: 3;
}

.detalle-producto-galeria-wrap .at-hero-frame {
    z-index: 4;
}

.detalle-producto-galeria-wrap #imagen-principal {
    position: relative;
    z-index: 1;
    border-radius: var(--at-radius, 4px);
    background: var(--at-white, #fff);
}

.detalle-producto-galeria-wrap .nav-button,
.detalle-producto-galeria-wrap .general-producto-favorito,
.detalle-producto-galeria-wrap .general-producto-labels {
    z-index: 5;
}

.detalle-producto-galeria .miniatura.active {
    border-color: var(--at-gold, #b8956c);
}
