/* Modern Grid Layout */
#customer-gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
    padding: 40px 20px;
    max-width: 1280px;
    margin: 0 auto;
    align-items: start;
}

/* Ensure proper structure for grid items */
#customer-gallery-container > .cg-polaroid-item-link {
    display: block;
    width: 100%;
}

#customer-gallery-container > .cg-polaroid-item-link > .cg-polaroid-item {
    width: 100%;
    margin: 0;
}

/* Link Wrapper for SEO */
.cg-polaroid-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Professional Card Design - Modern Layout */
.cg-polaroid-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.cg-polaroid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.cg-polaroid-item:hover .cg-polaroid-image-wrapper img {
    transform: scale(1.05);
}

/* Image Wrapper with Square Aspect Ratio */
.cg-polaroid-image-wrapper {
    position: relative;
    aspect-ratio: 4 / 3;
    background-color: #f3f4f6;
    overflow: hidden;
}

.cg-polaroid-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Title Section */
.cg-polaroid-title {
    padding: 20px 24px;
    background: linear-gradient(to right, #ffffff 0%, #f9fafb 100%);
}

.cg-polaroid-title h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 2px 0;
    line-height: 1.4;
}

.cg-polaroid-title p {
    font-size: 15px;
    color: #4b5563;
    margin: 0;
    font-weight: 500;
}

/* Customer Name */
.cg-polaroid-customer-name {
    font-size: 14px;
    color: #3b82f6;
    margin: 8px 0 4px 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Location */
.cg-polaroid-location {
    font-size: 14px;
    margin: 4px 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Area */
.cg-polaroid-area {
    font-size: 14px;
    margin: 4px 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Product */
.cg-polaroid-product-name {
    font-size: 14px;
    margin: 4px 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Short Description */
.cg-polaroid-description {
    font-size: 14px;
    color: #6b7280;
    margin: 4px 0 0 0;
    line-height: 1.5;
    font-weight: 400;
}

/* Product Link Badge */
.cg-polaroid-product-link {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 20px;
    background-color: #3b82f6;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
}

.cg-polaroid-product-link:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

/* Caption/Title Area */
.cg-polaroid-caption {
    padding: 20px 24px;
    text-align: center;
    font-size: 15px;
    line-height: 1.5;
    color: #374151;
    font-weight: 500;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
}

/* Single Item Page Styles */
#customer-gallery-single {
    max-width: 1280px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.cg-single-hero {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    margin-bottom: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.cg-single-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cg-single-hero:hover .cg-single-hero-image {
    transform: scale(1.02);
}

.cg-single-content {
    background: #ffffff;
    padding: 48px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.cg-single-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 20px;
}

.cg-single-title {
    font-size: 36px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

.cg-view-product-btn {
    background-color: #3b82f6;
    color: #ffffff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cg-view-product-btn:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.cg-single-meta {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.cg-single-description {
    margin-bottom: 40px;
    line-height: 1.75;
    color: #4b5563;
    font-size: 16px;
}

.cg-single-features {
    margin-bottom: 40px;
}

.cg-single-features h3 {
    font-size: 22px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 20px;
    color: #111827;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 12px;
}

.cg-single-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.cg-single-features li {
    position: relative;
    padding-left: 28px;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.6;
}

.cg-single-features li::before {
    content: "•";
    color: #3b82f6;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 18px;
}

.cg-single-testimonial {
    background-color: #f8fafc;
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 40px;
    border-left: 4px solid #3b82f6;
}

.cg-single-testimonial blockquote {
    margin: 0;
    font-size: 18px;
    font-style: italic;
    line-height: 1.7;
    color: #374151;
}

.cg-single-testimonial cite {
    display: block;
    text-align: right;
    margin-top: 16px;
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    font-style: normal;
}

.cg-single-media-gallery {
    margin-bottom: 40px;
}

.cg-single-media-gallery h3 {
    font-size: 22px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 24px;
    color: #111827;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 12px;
}

.cg-media-slider {
    overflow: hidden;
    position: relative;
    margin-bottom: 24px;
}

.cg-media-slide {
    display: none;
}

.cg-media-slide.active {
    display: block;
}

.cg-media-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.cg-media-slide video {
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: #000;
}

.cg-media-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.cg-prev-btn, .cg-next-btn {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #374151;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
}

.cg-prev-btn:hover, .cg-next-btn:hover {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.cg-media-counter {
    font-weight: 600;
    color: #6b7280;
}

.cg-single-cta {
    text-align: center;
}

.cg-cta-btn {
    background-color: #3b82f6;
    color: #ffffff;
    text-decoration: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    display: inline-block;
    transition: all 0.2s ease;
}

.cg-cta-btn:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    #customer-gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 24px;
        padding: 20px 16px;
    }
    
    #customer-gallery-single {
        padding: 0 16px;
    }
    
    .cg-single-content {
        padding: 32px 24px;
    }
    
    .cg-single-title {
        font-size: 28px;
    }
    
    .cg-single-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cg-view-product-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cg-polaroid-title h3 {
        font-size: 16px;
    }
    
    .cg-polaroid-title p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    #customer-gallery-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 12px;
    }
    
    .cg-polaroid-item {
        max-width: 100%;
    }
    
    .cg-polaroid-title {
        padding: 16px 20px;
    }
    
    .cg-polaroid-title h3 {
        font-size: 15px;
    }
    
    .cg-polaroid-title p {
        font-size: 13px;
    }
    
    .cg-single-title {
        font-size: 24px;
    }
    
    .cg-single-description {
        font-size: 15px;
    }
    
    .cg-single-features ul {
        grid-template-columns: 1fr;
    }
    
    .cg-polaroid-product-link {
        font-size: 13px;
        padding: 8px 16px;
    }
}

/* Accessibility Improvements */
.cg-polaroid-item:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.cg-polaroid-item-link:focus,
.cg-view-product-btn:focus,
.cg-cta-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.cg-polaroid-product-name {
    padding-bottom: 10px;
}

.cg-polaroid-title-text
{
    margin-bottom:0;
}