/* Category Grid Lightbox - Modern Minimal Styles */

/* Grid Container */
.cgl-wrapper {
    position: relative;
}

.cgl-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Grid Item */
.cgl-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cgl-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Item Image */
.cgl-item-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

/* Overlay */
.cgl-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.cgl-item:hover .cgl-item-overlay {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Item Content */
.cgl-item-content {
    text-align: center;
    padding: 20px;
    color: #ffffff;
    z-index: 1;
}

.cgl-item-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #ffffff;
    transition: transform 0.3s ease;
}

.cgl-item-subtitle {
    font-size: 1rem;
    font-weight: 400;
    margin: 0;
    color: #ffffff;
    opacity: 0.9;
    transition: transform 0.3s ease;
}

.cgl-item:hover .cgl-item-title {
    transform: translateY(-3px);
}

.cgl-item:hover .cgl-item-subtitle {
    transform: translateY(-3px);
}

/* Popup/Lightbox */
.cgl-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    opacity: 0;
    padding: 20px;
    transition: opacity 0.3s ease;
}

.cgl-popup.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.cgl-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.cgl-popup-content {
    position: relative;
    width: min(100%, 1200px);
    max-height: 90vh;
    margin: auto;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cgl-popup.active .cgl-popup-content {
    transform: scale(1);
}

.cgl-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cgl-popup-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.cgl-popup-inner {
    display: flex;
    align-items: stretch;
    height: 100%;
    max-height: 90vh;
    min-height: 380px;
}

/* Popup Left - Slider */
.cgl-popup-left {
    flex: 1 1 0;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.cgl-slider {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.cgl-slider-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    transition: transform 0.5s ease;
}

.cgl-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.cgl-slider-prev,
.cgl-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.cgl-slider-prev {
    left: 20px;
}

.cgl-slider-next {
    right: 20px;
}

.cgl-slider-prev:hover,
.cgl-slider-next:hover {
    background: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

.cgl-slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    background: #f5f5f5;
}

.cgl-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.cgl-dot.active {
    background: #333;
    transform: scale(1.2);
}

.cgl-dot:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Popup Right - Content */
.cgl-popup-right {
    flex: 0 0 380px;
    padding: 40px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-width: 280px;
}

.cgl-popup-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #333;
    line-height: 1.2;
}

.cgl-popup-subtitle {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0 0 30px 0;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cgl-popup-description {
    font-size: 1rem;
    line-height: 1.8;
    color: #555;
    flex: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .cgl-popup-inner {
        flex-direction: column;
    }

    .cgl-popup-right {
        flex: none;
        width: 100%;
        padding: 30px;
    }
    
    .cgl-popup-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .cgl-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cgl-popup-inner {
        flex-direction: column;
    }
    
    .cgl-popup-left {
        min-height: 300px;
    }
    
    .cgl-popup-right {
        flex: none;
        width: 100%;
        padding: 25px;
        max-height: none;
    }
    
    .cgl-popup-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .cgl-slider-prev,
    .cgl-slider-next {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .cgl-grid {
        grid-template-columns: 1fr;
    }
    
    .cgl-item-title {
        font-size: 1.2rem;
    }
    
    .cgl-item-subtitle {
        font-size: 0.9rem;
    }
    
    .cgl-popup-title {
        font-size: 1.3rem;
    }
    
    .cgl-popup-subtitle {
        font-size: 1rem;
    }
    
    .cgl-popup-right {
        padding: 20px;
    }
}

/* Scrollbar Styling */
.cgl-popup-right::-webkit-scrollbar {
    width: 6px;
}

.cgl-popup-right::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cgl-popup-right::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.cgl-popup-right::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Animation for single image (no slider) */
.cgl-slider.single-image .cgl-slider-prev,
.cgl-slider.single-image .cgl-slider-next,
.cgl-slider.single-image + .cgl-slider-dots {
    display: none;
}
