/* ===================================
   PREMIUM LIGHTBOX STYLES
   =================================== */

.premium-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.lightbox-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0 80px;
}

.lightbox-nav {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    -webkit-tap-highlight-color: transparent;
}

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

.lightbox-prev {
    margin-right: 2rem;
}

.lightbox-next {
    margin-left: 2rem;
}

.lightbox-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 80%;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.lightbox-counter {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===================================
   MOBILE OPTIMIZATIONS
   =================================== */

@media (max-width: 768px) {
    .lightbox-content-wrapper {
        flex-direction: column;
        padding: 80px 20px 100px;
    }

    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin: 0 !important;
    }

    .lightbox-prev {
        position: fixed;
        bottom: 2rem;
        left: 2rem;
    }

    .lightbox-next {
        position: fixed;
        bottom: 2rem;
        right: 2rem;
    }

    .lightbox-image-container {
        max-width: 100%;
    }

    .lightbox-image {
        max-height: 70vh;
    }
}

/* ===================================
   PREVIEW IMAGE STYLES
   =================================== */

.carousel-preview {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.carousel-preview-image {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.carousel-preview-image:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(217, 50, 76, 0.2);
}

.carousel-preview-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

.carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.carousel-preview-image:hover .carousel-overlay {
    opacity: 1;
}

.carousel-overlay-button {
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.carousel-overlay-button i {
    color: var(--primary);
    font-size: 1.5rem;
}

.carousel-counter {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}


/* ===================================
   INLINE SCROLLABLE CAROUSEL
   =================================== */

.inline-carousel {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding: 1rem 0.5rem 2rem 0.5rem;
    /* Bottom padding for shadow/scroll feel */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.inline-carousel::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.inline-carousel-item {
    flex: 0 0 auto;
    width: 300px;
    height: 220px;
    scroll-snap-align: start;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.inline-carousel-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.inline-carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.inline-carousel-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.inline-carousel-item:hover .inline-carousel-overlay {
    opacity: 1;
    transform: scale(1);
}

@media (max-width: 768px) {
    .inline-carousel {
        padding: 10px 20px 20px 20px;
        gap: 15px;
    }

    .inline-carousel-item {
        width: 80vw;
        /* Wider on mobile for better view */
        height: 240px;
        scroll-snap-align: center;
        /* Center focus on mobile */
    }

    /* Always show the expand icon on mobile to hint clickability */
    .inline-carousel-overlay {
        opacity: 1;
        transform: scale(1);
        background: rgba(255, 255, 255, 0.8);
    }

    /* Hide Desktop Arrows on Mobile */
    .carousel-arrow {
        display: none !important;
    }
}

/* ===================================
   DESKTOP SCROLL ARROWS
   =================================== */
.carousel-nav-wrapper {
    width: 100%;
    position: relative;
    display: flex;
    /* Ensure flex behavior matches JS injection */
    align-items: center;
    gap: 10px;
}

/* Ensure carousel takes available space between arrows */
.carousel-nav-wrapper .inline-carousel {
    flex: 1;
    min-width: 0;
    /* Critical for flex child with overflow */
}

.carousel-arrow {
    background: white;
    border: 2px solid var(--primary);
    /* Stronger border */
    color: var(--primary);
    width: 44px;
    /* Slightly larger */
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    /* Stronger shadow */
    transition: all 0.2s ease;
    z-index: 100;
    /* Ensure on top */
    flex-shrink: 0;
    font-size: 1.2rem;
}

.carousel-arrow:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.carousel-arrow-left {
    margin-right: 10px;
}

.carousel-arrow-right {
    margin-left: 10px;
}