.cg-wrapper {
    width: 100%;
    margin: 20px 0;
}

/* Filter Buttons */
.cg-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.cg-filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.cg-filter-btn.active,
.cg-filter-btn:hover {
    background: #222;
    color: #fff;
    border-color: #222;
}

/* Base Grid */
.cg-grid {
    display: grid;
    grid-template-columns: repeat(var(--cg-desktop-cols, 3), 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .cg-grid {
        grid-template-columns: repeat(var(--cg-mobile-cols, 1), 1fr);
        gap: 16px;
    }
}

.cg-item {
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cg-item.cg-hidden {
    display: none;
}

.cg-img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #f4f4f4;
}

.cg-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.cg-overlay-icon {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cg-overlay-icon span {
    color: #fff;
    font-size: 32px;
    font-weight: 300;
}

.cg-content {
    padding: 16px;
}

.cg-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 6px;
}

.cg-badge {
    display: inline-block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #eee;
    color: #555;
    padding: 3px 8px;
    border-radius: 3px;
}

.cg-caption {
    margin: 0 0 6px;
    font-size: 18px;
    line-height: 1.3;
}

.cg-desc {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

/* Layouts */
.cg-layout-card .cg-item {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

.cg-layout-minimal .cg-item {
    background: transparent;
}

.cg-layout-minimal .cg-content {
    padding: 12px 0 0;
}

.cg-layout-overlay .cg-item {
    border-radius: 8px;
}

.cg-layout-overlay .cg-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: #fff;
}

.cg-layout-overlay .cg-desc {
    color: #e0e0e0;
}

.cg-layout-masonry {
    display: block;
    column-count: var(--cg-desktop-cols, 3);
    column-gap: 24px;
}

@media (max-width: 768px) {
    .cg-layout-masonry {
        column-count: var(--cg-mobile-cols, 1);
    }
}

.cg-layout-masonry .cg-item {
    break-inside: avoid;
    margin-bottom: 24px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

.cg-layout-masonry .cg-img-wrap {
    aspect-ratio: auto;
}

/* Hover Effects */
.cg-hover-zoom .cg-item:hover .cg-img-wrap img {
    transform: scale(1.08);
}

.cg-hover-lift .cg-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.cg-hover-grayscale .cg-img-wrap img {
    filter: grayscale(100%);
}

.cg-hover-grayscale .cg-item:hover .cg-img-wrap img {
    filter: grayscale(0%);
}

.cg-hover-fade .cg-item:hover .cg-overlay-icon {
    opacity: 1;
}

/* Lightbox */
.cg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cg-lightbox.open {
    display: flex;
}

.cg-lb-inner {
    background: #fff;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.cg-lb-inner img {
    width: 100%;
    max-height: 55vh;
    object-fit: contain;
    background: #111;
}

.cg-lb-details {
    padding: 20px 24px;
}

.cg-lb-details h3 {
    margin: 6px 0 10px;
    font-size: 22px;
}

.cg-lb-details p {
    margin: 0;
    color: #444;
    line-height: 1.6;
}

.cg-lb-close,
.cg-lb-prev,
.cg-lb-next {
    position: absolute;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    padding: 10px;
    line-height: 1;
}

.cg-lb-close { top: 15px; right: 25px; }
.cg-lb-prev  { left: 15px; top: 50%; transform: translateY(-50%); }
.cg-lb-next  { right: 15px; top: 50%; transform: translateY(-50%); }
