/**
 * Customer Reviews Gallery - Frontend Styles
 */

.crg-reviews-section {
    margin: 40px 0;
    padding: 30px 0;
    border-top: 1px solid #eee;
}

.crg-section-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    color: #333;
    text-align: center;
}

.crg-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.crg-gallery-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1/1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    background: #f0f0f0;
}

.crg-gallery-image.crg-hidden {
    display: none !important;
}

.crg-gallery-image.crg-visible {
    display: block !important;
}

.crg-gallery-image:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.crg-gallery-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: center center !important;
    transition: transform 0.3s;
    min-width: 100%;
    min-height: 100%;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: bicubic;
}

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

.crg-gallery-image a {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.crg-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.crg-gallery-image:hover .crg-image-overlay {
    opacity: 1;
}

.crg-gallery-image.crg-show-more-overlay .crg-image-overlay {
    opacity: 0;
}

.crg-image-overlay .dashicons {
    color: #fff;
    font-size: 32px;
    width: 32px;
    height: 32px;
}

/* More overlay (+X) */
.crg-more-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.crg-more-count {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
}

.crg-show-more-overlay:hover .crg-more-overlay {
    background: rgba(0, 0, 0, 0.7);
}

/* Show more button */
.crg-show-more-btn-wrap {
    text-align: center;
    margin-top: 20px;
}

.crg-show-more-btn {
    background: #333;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.crg-show-more-btn:hover {
    background: #555;
    transform: translateY(-2px);
}

/* Lightbox */
.crg-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: none;
}

.crg-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.crg-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.crg-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
}

.crg-lightbox-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
}

.crg-lightbox-close {
    position: fixed !important;
    top: 25px !important;
    right: 25px !important;
    left: auto !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    color: #fff !important;
    font-size: 40px !important;
    font-weight: 300 !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: all 0.2s !important;
    z-index: 999999999 !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.5) !important;
    line-height: 1 !important;
    width: auto !important;
    height: auto !important;
    box-shadow: none !important;
    outline: none !important;
}

.crg-lightbox-close:hover {
    color: #ff6b6b !important;
    transform: scale(1.2) !important;
    background: transparent !important;
}

.crg-lightbox-prev,
.crg-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.crg-lightbox-prev:hover,
.crg-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.crg-lightbox-prev {
    right: -70px;
}

.crg-lightbox-next {
    left: -70px;
}

.crg-lightbox-prev .dashicons,
.crg-lightbox-next .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .crg-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .crg-section-title {
        font-size: 20px;
    }
    
    .crg-lightbox-prev,
    .crg-lightbox-next {
        width: 40px;
        height: 40px;
    }
    
    .crg-lightbox-prev {
        right: -50px;
    }
    
    .crg-lightbox-next {
        left: -50px;
    }
}

@media (max-width: 480px) {
    .crg-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .crg-lightbox-prev {
        right: 10px;
        top: auto;
        bottom: 20px;
        transform: none;
    }
    
    .crg-lightbox-next {
        left: 10px;
        top: auto;
        bottom: 20px;
        transform: none;
    }
}
