/* ================================================
       GALERÍA 
    ================================================ */

.premium-gallery-section {
    padding: 80px 0;
    background-color: #ffffff;
    position: relative;
}

/* Encabezado de la galería */
.gallery-header {
    text-align: center;
    margin-bottom: 60px;
}

.gallery-sup-title {
    letter-spacing: 6px;
    margin-bottom: 20px;
    font-weight: 400;
}

.gallery-main-title {
    font-size: 42px;
    margin-bottom: 20px;
}

.gallery-divider {
    width: 60px;
    margin: 0 auto 25px auto;
}

.gallery-description {
    font-size: 17px;
    line-height: 1.7;
    max-width: 650px;
    margin: 0 auto;
    font-weight: 300;
}

/* Grid de galería estilo Pinterest/Masonry */
.premium-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Items de la galería */
/* Query de tamaños para la galería:
         Tamaño base: .gallery-item
         Variantes opcionales:
         - .gallery-item--large: ocupa más ancho
         - .gallery-item--tall: ocupa más alto
         - .gallery-item--wide: ocupa más ancho
         Si no se agrega ninguna variante, se usa el tamaño default del grid.
     */
.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 4px;
    background-color: #f5f0e8;
}

.gallery-item--large {
    grid-column: span 2;
    grid-row: span 1;
}

.gallery-item--tall {
    grid-row: span 2;
}

.gallery-item--wide {
    grid-column: span 2;
}

.gallery-item__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
}

.gallery-item:hover .gallery-item__image {
    transform: scale(1.05);
}

/* Overlay con información */
.gallery-item__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    padding: 30px 20px 20px 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.gallery-item:hover .gallery-item__overlay {
    opacity: 1;
}

.gallery-item__title {
    color: #ffffff;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
    margin: 0;
}

.gallery-item__icon {
    color: #b88b4a;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.2);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-item__icon {
    background: #b88b4a;
    color: #ffffff;
}

/* Lightbox personalizado */
.premium-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

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

.lightbox-image {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
    border-radius: 4px;
    position: relative;
    z-index: 1;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.lightbox-navigation {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
}

.lightbox-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    pointer-events: auto;
    z-index: 5;
    transition: all 0.25s ease;
    backdrop-filter: blur(6px);
}

.lightbox-nav-button:hover {
    background: rgba(184, 139, 74, 0.95);
    border-color: rgba(184, 139, 74, 0.95);
    color: #ffffff;
}

.lightbox-nav-button--prev {
    left: 28px;
}

.lightbox-nav-button--next {
    right: 28px;
}

.lightbox-meta {
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    z-index: 1;
}

.lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    text-align: center;
    color: #ffffff;
    font-size: 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #ffffff;
    font-size: 32px;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: #b88b4a;
}

@media (max-width: 768px) {
    .lightbox-nav-button {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .lightbox-nav-button--prev {
        left: 14px;
    }

    .lightbox-nav-button--next {
        right: 14px;
    }

    .lightbox-meta {
        top: 18px;
        font-size: 10px;
        letter-spacing: 2px;
    }
}

/* Botón de ver más */
.gallery-cta {
    text-align: center;
    margin-top: 60px;
}

.btn-gallery {
    display: inline-block;
    background: transparent;
    border: 2px solid #b88b4a;
    padding: 14px 42px;
    font-weight: 500;
    letter-spacing: 3px;
    font-size: 13px;
    color: #b88b4a;
    text-decoration: none;
    transition: all 0.4s ease;
    text-transform: uppercase;
}

.btn-gallery:hover {
    background: #b88b4a;
    color: #ffffff;
}

/* Responsive */
@media (max-width: 1200px) {
    .premium-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
        margin: 0 auto 54px auto;
    }
}

@media (max-width: 768px) {
    .premium-gallery-section {
        padding: 50px 0;
    }

    .gallery-main-title {
        font-size: 32px;
    }

    .premium-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 15px;
    }

    .gallery-item--large,
    .gallery-item--wide {
        grid-column: span 1;
    }

    .gallery-item__overlay {
        opacity: 1;
        padding: 15px 12px 12px 12px;
    }

    .gallery-item__title {
        font-size: 11px;
        letter-spacing: 1px;
    }
}

@media (max-width: 480px) {
    .premium-grid {
        grid-template-columns: 1fr;
    }
}