﻿/* === LIGHTBOX LAYOUT FIX === */

/* Desktop Layout Adjustment: Wider Image Column (approx 64% vs 36%) */
.lightbox-body {
    grid-template-columns: 1.8fr 1fr !important;
}

/* Image section - relative positioning */
.lightbox-image-section {
    position: relative;
    background: #000;
    display: flex;
    flex-direction: column;
}

/* Gallery takes available space */
.lightbox-gallery {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

/* Main image - show complete */
.lightbox-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    max-height: calc(90vh - 150px);
}

/* Counter - stays at top */
.lightbox-counter {
    position: absolute;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    z-index: 10;
}

/* Navigation arrows - ONLY in image area */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(212, 175, 55, 0.95);
    border: none;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--primary-black);
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.lightbox-nav:hover {
    background: var(--primary-gold);
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 6px 30px rgba(212, 175, 55, 0.5);
}

.lightbox-nav svg {
    width: 32px;
    height: 32px;
    stroke-width: 3;
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

/* Thumbnails - STATIC at bottom of image section */
.lightbox-thumbnails {
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.8) 100%);
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    z-index: 5;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-gold) transparent;
    max-width: 100%;
}

.lightbox-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.lightbox-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: var(--primary-gold);
    border-radius: 2px;
}

.lightbox-thumb {
    flex-shrink: 0;
    width: 100px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.lightbox-thumb:hover img {
    transform: scale(1.1);
}

.lightbox-thumb.active {
    border-color: var(--primary-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

.lightbox-thumb-video::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* Kuula badge - HTML element with two lines */
.kuula-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary-gold);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    z-index: 10;
}

.kuula-badge span {
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

/* Info section - estructura con header/descripción/footer */
.lightbox-info-section {
    padding: 0 !important;
    overflow: hidden !important;
    height: 90vh !important;
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
    background: white;
}

/* Header fijo - categoría y título */
.lightbox-info-header {
    flex-shrink: 0;
    padding: 2rem 2rem 1rem 2rem;
    background: white;
    border-bottom: 1px solid #f0f0f0;
}

/* Descripción con scroll */
.lightbox-description-wrapper {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem 2rem;
    min-height: 0;
}

.lightbox-description {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.8;
    color: #555;
}

.lightbox-description p {
    margin: 0 0 1.2rem 0;
}

.lightbox-description p:last-child {
    margin-bottom: 0;
}

/* Scrollbar para descripción */
.lightbox-description-wrapper::-webkit-scrollbar {
    width: 8px;
}

.lightbox-description-wrapper::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.lightbox-description-wrapper::-webkit-scrollbar-thumb {
    background: #B8860B;
    border-radius: 4px;
}

.lightbox-description-wrapper::-webkit-scrollbar-thumb:hover {
    background: #996515;
}

/* Footer fijo - detalles y botón */
.lightbox-info-footer {
    flex-shrink: 0;
    padding: 1.5rem 2rem 2rem 2rem;
    background: white;
    border-top: 1px solid #f0f0f0;
}

.lightbox-info-footer .lightbox-details {
    margin-bottom: 1.5rem;
}

.lightbox-info-footer .btn-primary {
    width: 100%;
    justify-content: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .lightbox-nav {
        width: 60px;
        height: 60px;
    }

    .lightbox-nav svg {
        width: 28px;
        height: 28px;
    }

    .lightbox-thumb {
        width: 80px;
        height: 60px;
    }
}

@media (max-width: 768px) {

    /* 1. Layout: Maximize Space */
    .lightbox-body {
        grid-template-columns: 1fr;
        max-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    /* 2. Remove "Distractions" to save space */
    .lightbox-category {
        display: none !important;
        /* Hide Header Category */
    }

    .lightbox-thumbnails {
        display: none !important;
        /* Hide Thumbnails */
    }

    /* 3. Image Section: Full Width & Immersive */
    .lightbox-image-section {
        flex: 1 1 40%;
        /* Slightly less height than before to give more to text */
        max-height: 45vh;
        /* Cap it so text always has room */
        min-height: 250px;
        position: relative;
        background: #000;
    }

    .lightbox-gallery {
        min-height: 0;
        height: 100%;
        padding-bottom: 0 !important;
        /* Recover thumbnail space */
    }

    .lightbox-main-image {
        max-height: 100%;
        width: 100%;
        height: 100%;
        object-fit: cover !important;
        /* FULL WIDTH filling */
    }

    /* 4. Text Section: Prioritize Readability */
    .lightbox-info-section {
        flex: 1 1 60%;
        /* Give MORE space to text */
        max-height: 60vh;
        /* Allow it to grow */
        height: auto;
    }

    /* Header Compacted */
    .lightbox-info-header {
        padding: 1rem 1.25rem 0.5rem;
        flex-shrink: 0;
    }

    .lightbox-title {
        font-size: 1.5rem;
        /* Good size header */
        margin-bottom: 0;
        line-height: 1.2;
    }

    /* Scrollable Text Area expanded */
    .lightbox-description-wrapper {
        padding: 0.5rem 1.25rem;
        flex-grow: 1;
        /* Allow this to expand to fill available space */
    }

    .lightbox-description {
        font-size: 1rem;
        /* Readable text size */
        line-height: 1.6;
    }

    /* 5. Footer & Button: Ultra Compact */
    .lightbox-info-footer {
        padding: 0.5rem 1.25rem 1rem;
        flex-shrink: 0;
    }

    .lightbox-details {
        margin-bottom: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
        /* Horizontal flow for details */
    }

    .lightbox-detail-item {
        padding: 0;
        font-size: 0.75rem;
        /* Smaller text */
        width: auto;
        /* Allow them to sit next to each other */
        display: inline-flex;
        gap: 0.25rem;
    }

    .lightbox-detail-item strong {
        font-weight: 700;
    }

    .lightbox-info-footer .btn-primary {
        width: 100%;
        padding: 0.6rem 1rem;
        /* Very compact button */
        font-size: 0.85rem;
        min-height: auto;
        margin-top: 0.25rem;
    }

    /* Navigation Arrows adjustment for cover image */
    .lightbox-nav {
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.2);
        /* Subtle over cover image */
        backdrop-filter: blur(4px);
        color: white;
    }

    .lightbox-nav:hover {
        background: rgba(212, 175, 55, 0.9);
    }

    .lightbox-prev {
        left: 0.5rem;
    }

    .lightbox-next {
        right: 0.5rem;
    }

    .lightbox-counter {
        top: 1rem;
        font-size: 0.75rem;
        padding: 0.25rem 0.75rem;
        background: rgba(0, 0, 0, 0.5);
    }
}

/* === FILTER BUTTONS CENTERED === */
.hero-filters {
    justify-content: center !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* === HIDE CATEGORY AND LOCATION IN MODAL === */
#lightboxCategoryFull,
#lightboxLocation {
    display: none !important;
}

/* Hide the parent detail items for category and location */
.lightbox-detail-item:has(#lightboxCategoryFull),
.lightbox-detail-item:has(#lightboxLocation) {
    display: none !important;
}