/*
 * Additions to public/frontend/css/main.css. The layout itself comes from the
 * legacy stylesheets; these are the rules the removed jQuery plugins provided.
 */

/* Loader shown while the vehicle sub-filters reload (was toggled by jQuery). */
.ajax-loader-vehiculos {
    display: none;
}

.ajax-loader-vehiculos.is-loading {
    display: block;
}

/* Slider: jquery.onebyone kept this proportion with JS. */
#banner.oneByOne1 {
    position: relative;
    width: 100%;
    aspect-ratio: 868 / 314;
    /* The arrows sit half outside the frame; the slides clip themselves. */
    overflow: visible;
}

#banner .oneByOne_item {
    width: 100%;
    height: 100%;
}

/* Company gallery (/azienda): was jquery.nanogallery with the "clean" theme. */
.empresa-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.empresa-gallery a {
    display: block;
    border: 1px solid #e8e8e8;
}

.empresa-gallery a img {
    display: block;
    width: 135px;
    height: 88px;
    object-fit: cover;
    transition: opacity 0.2s;
}

.empresa-gallery a:hover img {
    opacity: 0.5;
}

.empresa-gallery dialog {
    /* The legacy reset (* { margin: 0 }) would pin it to the top left. */
    margin: auto;
    max-width: 90vw;
    max-height: 90vh;
    padding: 0;
    border: 0;
    background: transparent;
}

.empresa-gallery dialog::backdrop {
    background: rgba(0, 0, 0, 0.85);
}

.empresa-gallery dialog img {
    display: block;
    max-width: 90vw;
    max-height: 85vh;
}

.empresa-gallery dialog button {
    position: absolute;
    top: 50%;
    padding: 10px 14px;
    border: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.empresa-gallery dialog .prev { left: 0; }
.empresa-gallery dialog .next { right: 0; }
.empresa-gallery dialog .close { top: 0; right: 0; }
