.referencia-galeria .gallery-item {
    position: relative;
    overflow: hidden;
    min-height: 280px;
    background: #e9ecef;
    border-radius: 16px;
    cursor: zoom-in;
    isolation: isolate;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.gallery-item-image {
    position: absolute;
    inset: 0;
    display: block;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    transition: transform 0.45s ease;
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    transition: background-color 0.3s ease;
}

.gallery-item-zoom {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    color: #fff;
    background: rgba(249, 99, 4, 0.92);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.75);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.gallery-item-zoom svg {
    width: 25px;
    height: 25px;
    fill: currentColor;
}

.gallery-item:hover .gallery-item-image,
.gallery-item:focus-visible .gallery-item-image {
    transform: scale(1.07);
}

.gallery-item:hover .gallery-item-overlay,
.gallery-item:focus-visible .gallery-item-overlay {
    background: rgba(0, 0, 0, 0.28);
}

.gallery-item:hover .gallery-item-zoom,
.gallery-item:focus-visible .gallery-item-zoom {
    opacity: 1;
    transform: scale(1);
}

.gallery-item:focus-visible {
    outline: 3px solid #f96304;
    outline-offset: 3px;
}

/* Referencialista */

.reference-card {
    overflow: hidden;
    color: #212529;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.reference-card:hover {
    color: #f96304;
    transform: translateY(-5px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
}

.reference-card-image {
    height: 260px;
    overflow: hidden;
    background: #e9ecef;
}

.reference-card-image img {
    display: block;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.reference-card:hover .reference-card-image img {
    transform: scale(1.06);
}

.reference-card-content {
    padding: 20px;
}

/* Felugró képnézegető */

.gallery-viewer {
    position: fixed;
    z-index: 1080;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.gallery-viewer.is-open {
    visibility: visible;
    opacity: 1;
}

.gallery-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 12, 0.94);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.gallery-viewer-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(1400px, 100%);
    height: min(900px, calc(100vh - 40px));
    overflow: hidden;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    transform: scale(0.96);
    transition: transform 0.25s ease;
}

.gallery-viewer.is-open .gallery-viewer-dialog {
    transform: scale(1);
}

.gallery-viewer-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 72px;
    padding: 14px 18px;
    color: #fff;
    background: rgba(17, 17, 17, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-viewer-title {
    max-width: min(700px, 65vw);
    font-size: 1rem;
    font-weight: 600;
}

.gallery-viewer-counter {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.85rem;
}

.gallery-viewer-content {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
}

.gallery-viewer-image {
    display: block;
    max-width: calc(100% - 120px);
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.98);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.gallery-viewer-image.is-loaded {
    opacity: 1;
    transform: scale(1);
}

.gallery-viewer-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -1rem 0 0 -1rem;
}

.gallery-viewer-loader.is-hidden {
    display: none;
}

.gallery-viewer-error {
    display: none;
}

.gallery-viewer-error.is-visible {
    display: block;
}

.gallery-viewer-close,
.gallery-viewer-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    padding: 0;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.55);
}

.gallery-viewer-close svg,
.gallery-viewer-navigation svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.gallery-viewer-navigation {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
}

.gallery-viewer-prev {
    left: 18px;
}

.gallery-viewer-next {
    right: 18px;
}

.gallery-viewer-navigation:hover,
.gallery-viewer-close:hover {
    color: #fff;
    background: #f96304;
    border-color: #f96304;
}

.gallery-viewer-navigation:disabled {
    display: none;
}

.gallery-viewer-swipe-hint {
    flex: 0 0 auto;
    padding: 10px 15px;
    color: rgba(255, 255, 255, 0.55);
    background: #111;
    font-size: 0.75rem;
    text-align: center;
}

body.gallery-viewer-open {
    overflow: hidden;
}

.min-width-0 {
    min-width: 0;
}

@media (max-width: 767.98px) {
    .gallery-viewer {
        padding: 0;
    }

    .gallery-viewer-dialog {
        width: 100%;
        height: 100%;
        border: 0;
        border-radius: 0;
    }

    .gallery-viewer-header {
        min-height: 64px;
        padding: 10px 12px;
    }

    .gallery-viewer-title {
        max-width: 70vw;
        font-size: 0.9rem;
    }

    .gallery-viewer-close,
    .gallery-viewer-navigation {
        width: 42px;
        height: 42px;
    }

    .gallery-viewer-prev {
        left: 8px;
    }

    .gallery-viewer-next {
        right: 8px;
    }

    .gallery-viewer-image {
        max-width: calc(100% - 20px);
        max-height: calc(100% - 10px);
    }

    .referencia-galeria .gallery-item {
        min-height: 230px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-viewer,
    .gallery-viewer-dialog,
    .gallery-viewer-image,
    .gallery-item-image,
    .gallery-item-overlay,
    .gallery-item-zoom {
        transition: none;
    }
}    