/* ===========================================
   GALLERY PAGE STYLES
   =========================================== */

/* Gallery Hero */
.gallery-hero {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('../gallery/automocion/auto_03.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
    margin-top: 70px;
}

.gallery-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.7) 0%, rgba(26, 26, 26, 0.8) 100%);
    z-index: 1;
}

.gallery-hero .container {
    position: relative;
    z-index: 2;
}

.gallery-hero-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 900;
    letter-spacing: 8px;
    background: linear-gradient(135deg, #ffffff 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 20px;
}

.gallery-hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-gray);
    text-align: center;
    letter-spacing: 2px;
}

/* Gallery Section */
.gallery-section {
    background: var(--bg-dark);
    padding: 80px 0 120px;
}

/* Gallery Filters */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.gallery-filter-btn {
    padding: 12px 35px;
    background: transparent;
    color: var(--text-gray);
    border: 2px solid rgba(212, 175, 55, 0.3);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Montserrat', sans-serif;
}

.gallery-filter-btn:hover,
.gallery-filter-btn.active {
    background: var(--primary-color);
    color: var(--bg-dark);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.4);
}

/* Gallery Grid - Masonry Layout */
.gallery-grid {
    column-count: 3;
    column-gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.gallery-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
}

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

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(10, 10, 10, 0.8) 100%
    );
    opacity: 0;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}

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

.gallery-item-category {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.gallery-item-title {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Loading State */
.gallery-loading {
    text-align: center;
    padding: 100px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.gallery-loading p {
    color: var(--text-gray);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 20;
}

.lightbox-close:hover {
    background: var(--primary-color);
    transform: rotate(90deg);
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary-color);
    transition: var(--transition);
}

.lightbox-close:hover svg {
    stroke: var(--bg-dark);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(212, 175, 55, 0.2);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 20;
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev svg,
.lightbox-next svg {
    width: 28px;
    height: 28px;
    stroke: var(--primary-color);
    transition: var(--transition);
}

.lightbox-prev:hover svg,
.lightbox-next:hover svg {
    stroke: var(--bg-dark);
}

.lightbox-image-container {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image-container img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border: 3px solid var(--primary-color);
    box-shadow: 0 20px 60px rgba(212, 175, 55, 0.3);
}

.lightbox-caption {
    margin-top: 20px;
    padding: 15px 30px;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--primary-color);
    color: var(--text-color);
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .gallery-grid {
        column-count: 2;
    }

    .lightbox-prev {
        left: 20px;
    }

    .lightbox-next {
        right: 20px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        column-count: 1;
        column-gap: 0;
    }

    .gallery-item {
        margin-bottom: 15px;
    }

    .gallery-filters {
        gap: 10px;
    }

    .gallery-filter-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

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

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
    }
}

/* Hide/Show with filter animation */
.gallery-item.hidden {
    opacity: 0;
    transform: scale(0.8);
    height: 0;
    margin: 0;
    overflow: hidden;
    transition: all 0.3s ease-out;
}

.gallery-item.visible {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease-out;
}

/* Pagination */
.gallery-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 60px;
    padding: 30px 0;
}

.pagination-btn {
    padding: 12px 30px;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Montserrat', sans-serif;
}

.pagination-btn:hover {
    background: var(--primary-color);
    color: var(--bg-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.4);
}

.pagination-info {
    color: var(--text-gray);
    font-size: 1rem;
    letter-spacing: 1px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .gallery-pagination {
        gap: 15px;
        margin-top: 40px;
    }

    .pagination-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .pagination-info {
        font-size: 0.9rem;
    }
}
/* ===========================================
   VIDEO GALLERY ADDITIONS
   =========================================== */

/* Gallery Hero Overlay */
.gallery-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.7) 0%, rgba(26, 26, 26, 0.8) 100%);
    z-index: 1;
}

/* Sub-filters */
.gallery-subfilters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    min-height: 50px;
}

.gallery-subfilter-btn {
    padding: 10px 25px;
    background: transparent;
    color: var(--text-gray);
    border: 2px solid rgba(212, 175, 55, 0.2);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Montserrat', sans-serif;
}

.gallery-subfilter-btn:hover,
.gallery-subfilter-btn.active {
    background: rgba(212, 175, 55, 0.2);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Video Play Icon Overlay */
.gallery-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(212, 175, 55, 0.9);
    border-radius: 50%;
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

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

.gallery-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: calc(50% + 3px);
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 20px solid var(--bg-dark);
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    opacity: 0;
    transition: var(--transition);
    z-index: 10;
    pointer-events: none;
}

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

/* Lightbox Video Container */
.lightbox-video-container {
    width: 100%;
    max-width: 1200px;
    aspect-ratio: 16/9;
    background: #000;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.3);
}

/* Instagram Reels - Vertical Format */
.lightbox-video-container.platform-instagram {
    max-width: 500px;
    aspect-ratio: 9/16;
    max-height: 90vh;
}

.lightbox-video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .gallery-subfilters {
        gap: 10px;
    }

    .gallery-subfilter-btn {
        padding: 8px 20px;
        font-size: 0.8rem;
    }

    .lightbox-content {
        width: 95%;
        height: 95vh;
    }

    /* En móvil, Instagram se ajusta mejor a pantalla vertical */
    .lightbox-video-container.platform-instagram {
        max-width: 100%;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .gallery-item::after {
        width: 50px;
        height: 50px;
    }

    .gallery-item::before {
        border-left-width: 15px;
        border-top-width: 10px;
        border-bottom-width: 10px;
    }
}

/* Instagram Reel Button */
.instagram-reel-button {
    position: absolute;
    top: 90px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(188, 24, 136, 0.4);
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.instagram-reel-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 25px rgba(188, 24, 136, 0.6);
}

.instagram-reel-button svg {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.instagram-reel-button span {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .instagram-reel-button {
        top: 80px;
        right: 10px;
        padding: 10px 16px;
        font-size: 0.8rem;
        gap: 6px;
    }

    .instagram-reel-button svg {
        width: 18px;
        height: 18px;
    }

    .instagram-reel-button span {
        display: none;
    }

    /* Show icon only on mobile */
    .instagram-reel-button::after {
        content: '';
    }
}

/* Animation on appear */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.instagram-reel-button {
    animation: slideInFromTop 0.4s ease-out;
}
