#customer-gallery-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 50px;
    padding: 40px;
    max-width: 1600px;
    margin: 0 auto;
}

.cg-polaroid-item {
    background: #f0f0f0;
    padding: 15px 15px 70px 15px;
    box-shadow: 1px 1px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    width: 250px;
    border-radius: 3px;
}

.cg-polaroid-item:hover {
    transform: scale(1.05);
    box-shadow: 10px 10px 25px rgba(0,0,0,0.3);
    z-index: 10;
}

.cg-polaroid-image-wrapper {
    position: relative;
    background-color: #eee;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    overflow: hidden;
}

.cg-polaroid-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cg-image-overlay-title {
    position: absolute;
    bottom: 8px;
    right: 0;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 8px;
    border-radius: 3px 0 0 3px;
    font-size: 10px;
    line-height: 1.2;
    text-align: right;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cg-placeholder-image {
    color: #888;
}

.cg-polaroid-caption {
    text-align: center;
    position: absolute;
    bottom: 10px;
    left: 15px;
    right: 15px;
    font-size: 14px;
    line-height: 1.2;
    color: #333;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Viewer Styles */
#cg-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

#cg-viewer.cg-visible {
    display: flex;
    opacity: 1;
}

.cg-viewer-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    height: 90vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
}

.cg-viewer-header {
    color: #fff;
    padding: 10px 50px;
    text-align: center;
    flex-shrink: 0;
}

.cg-viewer-header a {
    color: #fff;
    font-size: 18px;
    margin: 0;
    padding: 0;
    font-weight: normal;
    text-decoration: none;
    display: block;
    transition: color 0.2s ease;
}

.cg-viewer-header a:hover {
    color: lightgrey;
}

.cg-viewer-main {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    background-color: #111;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

#cg-viewer-image-container {
    width: 100%;
    height: 100%;
}

#cg-viewer #cg-viewer-image-container img,
#cg-viewer #cg-viewer-image-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    transform: scale(0.95);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#cg-viewer #cg-viewer-image-container .cg-image-is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    z-index: 1;
}

#cg-viewer #cg-viewer-image-container .active {
    opacity: 1 !important;
    transform: scale(1);
    z-index: 2;
    visibility: visible !important;
}

.cg-viewer-thumbnails {
    padding: 15px 0;
    text-align: center;
    height: 90px;
    overflow-x: auto;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
}

.cg-thumb-wrapper {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    width: 60px;
    height: 60px;
    margin: 0 5px;
    cursor: pointer;
}

.cg-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 20px;
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.cg-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: border-color 0.2s, transform 0.2s;
    opacity: 0.6;
    display: inline-block;
    vertical-align: middle;
    box-sizing: border-box;
    background-color: #000;
}

.cg-thumb-wrapper:hover .cg-thumb {
    transform: scale(1.1);
    opacity: 1;
}
.cg-thumb-wrapper.active .cg-thumb {
    border-color: #fff;
    opacity: 1;
}

/* --- Unified Button Styles --- */
.cg-nav-arrow,
#cg-close {
    background: rgba(0,0,0,0.4);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    box-sizing: border-box;
}

.cg-nav-arrow:hover,
#cg-close:hover {
    background: rgba(0,0,0,0.7);
    box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

/* --- Individual Positioning & Sizing --- */
.cg-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    font-size: 20px;
}

.cg-nav-arrow:hover {
    transform: translateY(-50%) scale(1.1);
}

#cg-close:hover {
    transform: scale(1.1);
}

#cg-prev { left: 20px; }
#cg-next { right: 20px; }

#cg-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    font-size: 24px;
    line-height: 1;
    padding: 0;
}

