/* =============================================
   GALLERY SECTION — Galería Pública
   ============================================= */

/* --- Section --- */
.gallery-section {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    min-height: 60vh;
}

/* --- Badge --- */
.section-badge--gallery {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important;
    color: #fff !important;
    display: inline-block;
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.section-badge--gallery i {
    margin-right: 6px;
}

/* --- Toolbar --- */
.gallery-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Filters */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gallery-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    background: transparent;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.gallery-filter-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.04);
}

.gallery-filter-btn.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border-color: transparent;
}

.filter-count {
    background: rgba(0, 0, 0, 0.08);
    padding: 1px 8px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
}

.gallery-filter-btn.active .filter-count {
    background: rgba(255, 255, 255, 0.25);
}

/* Search */
.gallery-search {
    position: relative;
    min-width: 250px;
}

.gallery-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.85rem;
}

.gallery-search input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 0.85rem;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.25s ease;
    outline: none;
}

.gallery-search input:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* --- Counter --- */
.gallery-counter {
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 500;
    padding-left: 4px;
}

.gallery-counter span {
    font-weight: 700;
    color: #2563eb;
}

/* --- Grid --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* --- Item --- */
.gallery-item {
    animation: galleryFadeIn 0.5s ease both;
}

.gallery-item.hidden {
    display: none;
}

@keyframes galleryFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Card --- */
.gallery-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

/* Image */
.gallery-card__image {
    position: relative;
    height: 240px;
    overflow: hidden;
    background: #f1f5f9;
}

.gallery-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-card__image img {
    transform: scale(1.08);
}

/* Overlay */
.gallery-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-card:hover .gallery-card__overlay {
    opacity: 1;
}

.overlay-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.gallery-card:hover .overlay-btn {
    transform: translateY(0);
}

.overlay-btn--view {
    background: #fff;
    color: #1e293b;
}

.overlay-btn--view:hover {
    background: #2563eb;
    color: #fff;
}

.overlay-btn--share {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    backdrop-filter: blur(4px);
}

.overlay-btn--share:hover {
    background: #16a34a;
    color: #fff;
}

/* Info */
.gallery-card__info {
    padding: 16px;
    margin-top: auto;
}

.gallery-card__title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-card__cat {
    font-size: 0.72rem;
    color: #2563eb;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.gallery-card__cat i {
    margin-right: 4px;
    font-size: 0.68rem;
}

/* --- Empty --- */
.gallery-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
    grid-column: 1 / -1;
}

.gallery-empty i {
    font-size: 3.5rem;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.gallery-empty h3 {
    font-size: 1.1rem;
    color: #64748b;
    font-weight: 700;
    margin: 0 0 8px;
}

.gallery-empty p {
    font-size: 0.88rem;
    color: #94a3b8;
    margin: 0;
}

/* =============================================
   LIGHTBOX
   ============================================= */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.gallery-lightbox.active {
    visibility: visible;
    opacity: 1;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
}

.lightbox-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
}

/* Close */
.lightbox-close {
    position: fixed;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

/* Nav arrows */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-nav--prev { left: 20px; }
.lightbox-nav--next { right: 20px; }

/* Image */
.lightbox-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 70vh;
}

.lightbox-image-wrap img {
    max-width: 85vw;
    max-height: 68vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Info */
.lightbox-info {
    text-align: center;
    margin-top: 20px;
    color: #fff;
    max-width: 600px;
}

.lightbox-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 6px;
}

.lightbox-cat {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.lightbox-info p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 12px;
    line-height: 1.5;
}

.lightbox-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.lightbox-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(4px);
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.lightbox-counter {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 991px) {
    .gallery-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .gallery-search {
        min-width: unset;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    .gallery-card__image {
        height: 200px;
    }
}

@media (max-width: 575px) {
    .gallery-section {
        padding: 2rem 0;
    }

    .gallery-filters {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .gallery-filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 7px 14px;
        font-size: 0.78rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .gallery-card__image {
        height: 150px;
    }

    .gallery-card__info {
        padding: 10px 12px;
    }

    .gallery-card__title {
        font-size: 0.78rem;
    }

    .overlay-btn {
        width: 40px;
        height: 40px;
        font-size: 0.95rem;
    }

    /* Lightbox mobile */
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .lightbox-nav--prev { left: 8px; }
    .lightbox-nav--next { right: 8px; }

    .lightbox-image-wrap img {
        max-width: 96vw;
        border-radius: 8px;
    }

    .lightbox-info {
        padding: 0 16px;
    }
}
