/* Estilos para miniaturas extraídos de catalogo.css */
.galeria-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 8px;   /* Menos separación entre tarjetas */
    margin-top: 2em;
}

/* -------- POLAROID PREMIUM -------- */
.item-producto.polaroid {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 18px 0 rgba(70,70,90,0.12), 0 7px 34px #ff660010;
    width: 264px;   /* ancho del polaroid */
    height: 344px;  /* alto del polaroid */
    margin: 0;
    padding-top: 20px; /* marco blanco: inferior más grande */
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    border: 1.5px solid #f3f3f3;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    overflow: visible;
    text-decoration: none;
}

.item-producto.polaroid:hover {
    box-shadow: 0 14px 36px rgba(0,0,0,0.15);
    transform: scale(1.03) rotate(-1.5deg);
}

.item-producto.polaroid img {
    width: 230px;
    height: 250px;
    object-fit: cover;
    border-radius: 6px;
    background: #f6f6f7;
    margin: 0 0 8px 0;
    box-shadow: 0 2px 7px #e8e8e8;
    border: 2px solid #fff;
    display: block;
}

.item-producto.polaroid:active img {
    filter: brightness(0.92) contrast(1.09);
    transform: scale(0.97);
}

/* Texto discreto debajo de la foto */
.item-producto .nombre-producto {
    font-size: 0.95em;
    font-weight: 600;
    color: #222;
    letter-spacing: 0.01em;
    text-align: center;
    background: none;
    margin: 0;
    margin-top: 0px;
    padding: 0;
    min-height: 18px;
    max-width: 99%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.12;
    border: none;
    box-shadow: none;
    border-radius: 0;
    position: relative;
}

/* Responsive móvil */
@media (max-width: 600px) {
    .item-producto.polaroid {
        width: 74vw;
        height: 86vw;
        padding: 3vw 2vw 8vw 2vw;
        border-radius: 4vw;
    }
    .item-producto.polaroid img {
        width: 70vw;
        height: 78vw;
        border-radius: 1vw;
    }
    .item-producto .nombre-producto {
        font-size: 0.93em;
        min-height: 13px;
    }
    .galeria-items {
        gap: 7px 4px;
    }
}

/* Mejoras para efecto de carga de imágenes */
.item-producto.polaroid img {
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.item-producto.polaroid img.lazy-loading {
    opacity: 0.2;
}

/* Efecto ripple para miniaturas */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,120,0,0.18);
    transform: scale(0);
    animation: rippleEffect 0.48s linear;
    pointer-events: none;
    z-index: 2;
}

@keyframes rippleEffect {
    to { transform: scale(2.4); opacity: 0; }
}

/* Galería de 2 columnas en móvil */
@media (max-width: 600px) {
    .galeria-items {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.55em;
        padding: 0;
        margin: 0;
        width: 100vw;
        box-sizing: border-box;
    }
    
    .item-producto.polaroid {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 2px 16px rgba(187,187,187,0.33);
        margin: 0;
        padding: 0.58em 0.25em 0.94em;
        overflow: hidden;
        width: 100%;
        aspect-ratio: 1/1.09;
        min-height: unset;
        height: 240px;
        text-decoration: none;
    }
    
    .item-producto.polaroid img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        border-radius: 10px;
        min-height: 0;
        flex: 1 1 auto;
        background: #eee;
        margin: 0;
    }
    
    .nombre-producto {
        font-size: 1em;
        font-weight: 500;
        text-align: center;
        color: #222;
        padding: 0.48em 0.25em 0.64em;
        margin: 0;
        min-height: unset;
        background: none;
        line-height: 1.1;
        overflow-wrap: break-word;
        white-space: normal;
    }
}