.galeria {
    padding: 90px 0;
}

.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 48px;
}

.galeria-item {
    position: relative;
    height: 280px;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: var(--light-gray);
    transition: transform 0.45s ease, box-shadow 0.45s ease;
    border: none;
    width: 100%;
    cursor: zoom-in;
    padding: 0;
    user-select: none;
}

.galeria-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.35));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.galeria-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    pointer-events: none;
    user-select: none;
}

.galeria-item:hover,
.galeria-item:focus-within {
    transform: translateY(-6px);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.18);
}

.galeria-item:focus-visible {
    outline: 3px solid rgba(255, 102, 0, 0.6);
    outline-offset: 4px;
}

.galeria-item:hover img,
.galeria-item:focus-within img {
    transform: scale(1.08);
}

.galeria-item:hover::after,
.galeria-item:focus-within::after {
    opacity: 0.4;
}

body.lightbox-open {
    overflow: hidden;
}

.gallery-lightbox {
    border: none;
    padding: 0;
    background: transparent;
    max-width: none;
    width: 100%;
    position: fixed;
    inset: 0;
}

.gallery-lightbox::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.gallery-lightbox:not([open]) {
    display: none;
}

.gallery-lightbox[open] {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2000;
    min-height: 100vh;
}

.gallery-lightbox.active {
    display: flex;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: transparent;
    border: none;
    cursor: zoom-out;
}

.lightbox-dialog {
    position: relative;
    background: #fff;
    border-radius: 28px;
    padding: 32px 90px;
    width: min(960px, 100%);
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.35);
    z-index: 1;
    user-select: none;
    margin: auto;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.lightbox-media {
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

.lightbox-img {
    width: auto;
    max-width: 100%;
    max-height: 70vh;
    height: auto;
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    background: transparent;
    user-select: none;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

.lightbox-close i,
.lightbox-nav i {
    pointer-events: none;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
    color: var(--secondary-color);
    cursor: pointer;
}

.lightbox-nav.prev {
    left: 24px;
}

.lightbox-nav.next {
    right: 24px;
}
