#galeria-taxonomia-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.galeria-container {
    flex: 2;
    min-width: 150px;
}

.taxonomia-container {
    flex: 1;
    min-width: 150px;
}

.galeria-main-image {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 75%; /* Aspect ratio 4:3 */
    background-color: #f0f0f0;
    overflow: hidden;
}

.gallery-current-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Para que no se deforme la imagen */
}

.galeria-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
}

.galeria-nav button {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 1.5rem;
}

.galeria-counter {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.galeria-fullscreen {
    position: absolute;
    top: 10px;
    right: 10px;
}

.gallery-fullscreen-button {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
}

.galeria-descripcion {
    margin-top: -16px;
    padding: 5px 1px 1px 8px;
    background-color: var(--color-secundario);
    color: #fff;
    line-height: 1.1;
}

.taxonomia-title {
    cursor: pointer;
    user-select: none;
    margin-top: 0px;
    margin-bottom: 0px;
    background-color: #63783b;
    color: #fff;
    font-size: 1.3em;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.taxonomia-content {
    border: 1px solid #63783b;
    padding: 15px;
    border-radius: 0 0 5px 5px;
    background-color: #fafffa;
}

.taxonomia-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.taxonomia-item:last-child {
    border-bottom: none;
}

.taxonomia-label {
    font-weight: bold;
    color: #333;
}

.taxonomia-value {
    color: #666;
}
.sinonimo-container, .nombres-comunes-container {
    margin-top: 20px;
}
@media (max-width: 900px) {
    #galeria-taxonomia-container {
        flex-direction: column;
    }

    .galeria-container,
    .taxonomia-container {
        /* Anula el comportamiento de crecimiento/reducción de flexbox en la vista de columna */
        flex: none; 
        /* Asegura que ambos contenedores ocupen el ancho completo para que se apilen correctamente */
        width: 100%; 
    }

    .taxonomia-content {
        display: none;
    }

    .taxonomia-title.active + .taxonomia-content {
        display: block;
    }

    .taxonomia-title .taxonomia-arrow {
        display: inline-block;
        border: solid white;
        border-width: 0 3px 3px 0;
        padding: 4px;
        transform: rotate(-45deg); /* Flecha a la derecha (contraído) */
        transition: transform 0.2s ease-in-out;
    }

    .taxonomia-title.active .taxonomia-arrow {
        transform: rotate(45deg); /* Flecha hacia abajo (expandido) */
    }
}

/* --- Estilos para el Modal de Pantalla Completa --- */
.gallery-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-animation-name: fadeIn;
    -webkit-animation-duration: 0.4s;
    animation-name: fadeIn;
    animation-duration: 0.4s
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1001;
}

.modal-close:hover,
.modal-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.fullscreen-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.fullscreen-content .image-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.gallery-modal .gallery-modal-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
}

.modal-caption {
    margin-top: 15px;
    text-align: center;
    color: #ccc;
    font-size: 1.1rem;
    line-height: 1.4;
    max-width: 90vw;
    width: fit-content;
}
.modal-counter {
    font-size: 0.9rem;
    color: #f1f1f1;
    margin-bottom: 8px;
}


.modal-prev,
.modal-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.3s;
    user-select: none;
    z-index: 1001; /* Asegura que los botones estén sobre la imagen y el contenido */
    border-radius: 0 3px 3px 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-prev {
    left: 10px;
    border-radius: 3px 0 0 3px;
}

.modal-next {
    right: 10px;
}

.modal-prev:hover,
.modal-next:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

@-webkit-keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@media (max-width: 700px) {
    .gallery-modal .gallery-modal-image {
       max-width: 100vw;
       max-height: 80vh;
    }
    .modal-prev, .modal-next {
        font-size: 18px;
        padding: 12px;
    }
    .modal-caption {
        font-size: 0.9rem;
    }
}
