/* Estilos existentes de la galería */
.custom-gallery-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.custom-gallery-item {
    text-align: center;
    margin: 5px;
    flex: 1 0 12.5%; /* 8 columnas para pantallas grandes (1/8 * 100%) */
    box-sizing: border-box;
    max-width: calc(12.5% - 10px); /* Ajusta el tamaño máximo del elemento */
}

.custom-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

/* Nuevos estilos para la leyenda debajo de cada imagen */
.custom-gallery-caption {
    margin-top: 5px;
    font-size: 14px;
    color: #333;
    background-color: #f8f8f8;
    padding: 5px;
    border-radius: 3px;
    font-family: poppins;
    font-weight: bold;
}

/* Asegurarse de que los elementos tengan un estilo coherente */
.custom-gallery-item img {
    border: 1px solid #ccc;
}

.custom-gallery-container {
    padding: 10px;
}

/* Estilo adicional opcional */
.custom-gallery-item:hover img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

@media (max-width: 1024px) {
    .custom-gallery-item {
        flex: 1 0 25%; /* 4 columnas para pantallas medianas y pequeñas */
        max-width: calc(25% - 10px);
    }
}

@media (max-width: 768px) {
    .custom-gallery-item {
        flex: 1 0 20%; /* 4 columnas para pantallas pequeñas */
        max-width: calc(20% - 10px);
    }
}

@media (max-width: 480px) {
    .custom-gallery-item {
        flex: 1 0 20%; /* 2 columnas para dispositivos móviles */
        max-width: calc(20% - 10px);
    }
}

#custom-gallery-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap; /* Permite que los elementos se envuelvan en varias filas */
    gap: 10px; /* Espacio entre las imágenes */
}

#custom-gallery-list li {
    position: relative;
    flex: 0 1 100px; /* Ajusta el tamaño de los elementos */
    max-width: 100px;
    cursor: move; /* Indica que los elementos son arrastrables */
}

#custom-gallery-list img {
    width: 100%;
    height: auto;
    display: block;
}

.remove-image-button {
    position: absolute;
    top: 5px;
    right: 5px;
    background: red;
    color: white;
    border: none;
    cursor: pointer;
    padding: 2px 5px;
}