/* Külső konténer a nyilaknak */
.autoscroll-gallery-container {
    position: relative;
    width: 100%;
    margin: 20px 0;
}

.autoscroll-gallery-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    background: #f5f5f5;
    padding: 20px;
    box-sizing: border-box;
    --wrapper-width: 100%;
    scroll-behavior: smooth;
    --visible-count: var(--desktop-visible-count, 4);
}

.autoscroll-gallery-wrapper::-webkit-scrollbar {
    display: none;
}

.autoscroll-gallery-wrapper {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.autoscroll-gallery {
    display: flex;
    width: fit-content;
    position: relative;
}

.autoscroll-gallery::-webkit-scrollbar {
    display: none;
}

.autoscroll-gallery {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.autoscroll-gallery-track {
    display: flex;
    gap: var(--gap);
    flex-shrink: 0;
    will-change: transform;
}

/* Auto-scroll kikapcsolva - Kezelve JS-ben */
/* .autoscroll-gallery-container[data-auto-scroll="0"] .autoscroll-gallery-track {} */

.autoscroll-gallery:hover .autoscroll-gallery-track {
    animation-play-state: paused;
}

.autoscroll-gallery-item {
    flex: 0 0 auto;
    height: var(--gallery-height);
    width: calc((100% - (var(--gap) * (var(--visible-count) - 1))) / var(--visible-count));
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.autoscroll-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Lightbox engedélyezve esetén kurzor */
.autoscroll-gallery-wrapper.has-lightbox .autoscroll-gallery-item {
    cursor: pointer;
}

.autoscroll-gallery-wrapper.has-lightbox .autoscroll-gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.autoscroll-gallery-item img {
    height: 100% !important;
    width: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* @keyframes scroll-left eltávolítva - JS animációt használunk */

/* Lapozó nyilak */
.asg-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    padding: 0;
    margin: 0;
}

.autoscroll-gallery-container.has-arrows .asg-arrow {
    display: flex;
}

.asg-arrow:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 0, 0, 0.2);
}

.asg-arrow-left {
    left: -40px;
}

.asg-arrow-right {
    right: -60px;
}

.asg-arrow svg {
    pointer-events: none;
    display: block;
}

.asg-arrow-img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    pointer-events: none;
    display: block;
}

/* Lightbox */
.asg-lightbox {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.95) !important;
    z-index: 9999999 !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    margin: 0 !important;
}

.asg-lightbox.active {
    display: flex !important;
}

.asg-lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.asg-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s ease;
    z-index: 10000000;
}

.asg-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.asg-lightbox-prev,
.asg-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s ease;
    z-index: 10000000;
}

.asg-lightbox-prev:hover,
.asg-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.asg-lightbox-prev {
    left: 30px;
}

.asg-lightbox-next {
    right: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .autoscroll-gallery-wrapper {
        --gallery-height: 200px !important;
        --visible-count: 1;
        padding: 15px;
    }

    .asg-arrow {
        width: 40px;
        height: 40px;
    }

    .asg-arrow svg {
        width: 20px;
        height: 20px;
    }

    .asg-arrow-left {
        left: -25px;
    }

    .asg-arrow-right {
        right: -25px;
    }

    .asg-lightbox-prev,
    .asg-lightbox-next {
        width: 50px;
        height: 50px;
    }

    .asg-lightbox-prev {
        left: 10px;
    }

    .asg-lightbox-next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .autoscroll-gallery-wrapper {
        --gallery-height: 150px !important;
        padding: 10px;
    }

    .asg-arrow {
        width: 35px;
        height: 35px;
    }

    .asg-lightbox-img {
        max-width: 95%;
    }
}