
.cx-products-grid {
    --primary: #102D3B;
    --primary-dark: #091F2A;
    --gold: #B89555;
    --text: #263B45;
    --muted: #829097;
    --border: #E6ECEE;

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 25px;
    width: 100%;
    padding-top: 80px;
    padding-bottom: 50px;
}

/* PRODUCT CARD */

.cx-grid-card {
    position: relative;
    overflow: hidden;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(16, 45, 59, .045);
    transition: transform .3s ease, box-shadow .3s ease;
}

.cx-grid-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 38px rgba(16, 45, 59, .11);
    border-color: #D4DFE2;
}

/* IMAGE AREA */

/* Full-size product image */
.cx-grid-image {
    position: relative;
    width: 100%;
    height: 300px;
    padding: 0;
    overflow: hidden;
    background: #F6F8F9;
}

.cx-grid-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: relative;
    z-index: 1;
}

.cx-grid-image::before {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    border: 1px solid rgba(16, 45, 59, .07);
    border-radius: 50%;
    box-shadow:
        0 0 0 25px rgba(16, 45, 59, .025),
        0 0 0 50px rgba(16, 45, 59, .015);
    transition: transform .5s ease;
}

.cx-grid-card:hover .cx-grid-image::before {
    transform: scale(1.08);
}


.cx-grid-card:hover .cx-grid-image img {
    transform: scale(1.06);
}

/* IMAGE CATEGORY */

.cx-grid-category {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
    padding: 7px 10px;
    border-radius: 3px;
    background: var(--primary);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.2px;
}

.cx-grid-image-number {
    position: absolute;
    right: 15px;
    bottom: 13px;
    z-index: 2;
    color: rgba(16, 45, 59, .25);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
}

/* DETAILS */

.cx-grid-details {
    padding: 20px 20px 22px;
}

/* PRODUCT NAME AND MODEL */

.cx-grid-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
}

.cx-grid-title-row h3 {
    margin: 0;
    color: var(--primary);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.4;
}

.cx-grid-model {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    background: #EDF3F4;
    color: #536C76;
    font-size: 9px;
    font-weight: 750;
    white-space: nowrap;
    letter-spacing: .3px;
}

/* SPECIFICATIONS */

.cx-grid-spec {
    padding: 14px 0;
    border-top: 1px solid #EDF1F2;
}

.cx-grid-spec-label {
    display: block;
    margin-bottom: 8px;
    color: var(--gold);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.cx-grid-spec p {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.6;
}

/* FINISH LABELS */

.cx-grid-finishes {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.cx-grid-finishes span {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border: 1px solid #E4EAEC;
    border-radius: 4px;
    background: #FAFCFC;
    color: #50616A;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.3;
    transition: .25s ease;
}

.cx-grid-finishes span:hover {
    border-color: var(--gold);
    background: #FFFCF6;
    color: var(--primary);
}

/* RESPONSIVE GRID */

@media (max-width: 1100px) {
    .cx-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .cx-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .cx-grid-image {
        height: 210px;
        padding: 15px;
    }

    .cx-grid-image::before {
        width: 160px;
        height: 160px;
    }

    .cx-grid-details {
        padding: 15px;
    }

    .cx-grid-title-row {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 14px;
    }

    .cx-grid-title-row h3 {
        font-size: 15px;
    }

    .cx-grid-spec {
        padding: 11px 0;
    }
}

@media (max-width: 480px) {
    .cx-products-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .cx-grid-image {
        height: 260px;
    }

    .cx-grid-image::before {
        width: 210px;
        height: 210px;
    }

    .cx-grid-details {
        padding: 18px;
    }

    .cx-grid-title-row {
        flex-direction: row;
        align-items: flex-start;
    }

    .cx-grid-title-row h3 {
        font-size: 17px;
    }
}

/* Image zoom hint */
.cx-grid-image {
    position: relative;
    cursor: zoom-in;
}

.cx-zoom-hint {
    position: absolute;
    right: 15px;
    bottom: 15px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 13px;
    color: #fff;
    background: rgba(16, 45, 59, 0.88);
    border-radius: 30px;
    font-size: 12px;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.25s ease;
    pointer-events: none;
    z-index: 2;
}

.cx-grid-image:hover .cx-zoom-hint {
    opacity: 1;
    transform: translateY(0);
}

/* Zoom popup */
.cx-image-zoom {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(0, 0, 0, 0.92);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cx-image-zoom.active {
    opacity: 1;
    visibility: visible;
}

.cx-image-zoom img {
    display: block;
    max-width: 90%;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 5px;
    transform: scale(0.92);
    transition: transform 0.3s ease;
}

.cx-image-zoom.active img {
    transform: scale(1);
}

.cx-zoom-close {
    position: absolute;
    top: 20px;
    right: 25px;
    width: 45px;
    height: 45px;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 25px;
    cursor: pointer;
    transition: 0.25s ease;
}

.cx-zoom-close:hover {
    background: #B89555;
    border-color: #B89555;
    color: #fff;
}

@media (max-width: 576px) {
    .cx-image-zoom {
        padding: 15px;
    }

    .cx-image-zoom img {
        max-width: 100%;
        max-height: 80vh;
    }

    .cx-zoom-close {
        top: 12px;
        right: 12px;
    }

    .cx-zoom-hint {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================
   VARIABLE PRODUCT GRID
========================================== */

.cx-products-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 25px;
    width: 100%;
    padding-top: 40px;
    padding-bottom: 50px;
}

/* Normal card: 3 products per row */
.cx-grid-card {
    grid-column: span 2;
    min-width: 0;
}

/* Wide card: 2 products per row */
.cx-grid-card-wide {
    grid-column: span 3;
}

/* Normal image height */
.cx-grid-card .cx-grid-image {
    height: 300px;
    width: 100%;
    overflow: hidden;
}

/* Taller images for wide cards */
.cx-grid-card-wide .cx-grid-image {
    height: 420px;
}

/* Preserve original image proportions */
.cx-grid-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
}

/* ==========================================
   TABLET
========================================== */

@media (max-width: 991px) {

    .cx-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .cx-grid-card,
    .cx-grid-card-wide {
        grid-column: span 1;
    }

    .cx-grid-card .cx-grid-image,
    .cx-grid-card-wide .cx-grid-image {
        height: 280px;
    }

}

/* ==========================================
   MOBILE
========================================== */

@media (max-width: 576px) {

    .cx-products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .cx-grid-card,
    .cx-grid-card-wide {
        grid-column: span 1;
    }

    .cx-grid-card .cx-grid-image,
    .cx-grid-card-wide .cx-grid-image {
        height: 300px;
    }

}

/* FINAL OVERRIDES: VARIABLE PRODUCT GRID + TIGHT IMAGES
   Normal cards: 3 per row on desktop
   Wide cards: 2 per row on desktop
*/

.cx-products-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 25px;
    width: 100%;
    padding-top: 80px;
    padding-bottom: 60px;
}

/* Standard card occupies 2 tracks: 3 cards per row */
.cx-products-grid > .cx-grid-card {
    grid-column: span 2;
    min-width: 0;
}

/* Wide card occupies 3 tracks: 2 cards per row */
.cx-products-grid > .cx-grid-card-wide {
    grid-column: span 3;
}

/* Remove internal image spacing */
.cx-grid-card .cx-grid-image {
    position: relative;
    width: 100%;
    height: 260px;
    padding: 0 !important;
    margin: 0;
    overflow: hidden;
    background: #F6F8F9;
    cursor: zoom-in;
}

/* Remove decorative circle */
.cx-grid-image::before {
    display: none !important;
    content: none !important;
}

.cx-grid-image img {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0 !important;
    margin: 0 !important;
    object-fit: cover;
    object-position: center;
    z-index: 1;
    transition: transform .4s ease;
}

/* Taller image area for vertically large products */
.cx-grid-card-wide .cx-grid-image {
    height: 420px;
}

.cx-grid-card:hover .cx-grid-image img {
    transform: scale(1.03);
}

/* Tablet: 2 columns */
@media (max-width: 991px) {
    .cx-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .cx-products-grid > .cx-grid-card,
    .cx-products-grid > .cx-grid-card-wide {
        grid-column: span 1;
    }

    .cx-grid-card .cx-grid-image,
    .cx-grid-card-wide .cx-grid-image {
        height: 280px;
    }
}

/* Mobile: 1 column */
@media (max-width: 576px) {
    .cx-products-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .cx-products-grid > .cx-grid-card,
    .cx-products-grid > .cx-grid-card-wide {
        grid-column: span 1;
    }

    .cx-grid-card .cx-grid-image,
    .cx-grid-card-wide .cx-grid-image {
        height: 300px;
    }
}
