#mw-image-grid-container {
    margin-top: 2rem;
    clear: both;
}

.mw-image-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols-mobile), 1fr);
    gap: 10px;
    margin-top: 15px;
}

@media (min-width: 768px) {
    .mw-image-grid {
        grid-template-columns: repeat(var(--cols-tablet), 1fr);
    }
}

@media (min-width: 992px) {
    .mw-image-grid {
        grid-template-columns: repeat(var(--cols-desktop), 1fr);
    }
}

.mw-grid-item {
    position: relative;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.mw-grid-item img {
    display: block;
    width: 100%;
    height: auto;
}

.mw-grid-link {
    display: block;
    border: 2px solid transparent;
}

.mw-grid-link.active {
    border-color: var(--mw-border-color, #00ffff);
}

.mw-grid-link:hover {
    opacity: 0.8;
}

.mw-image-grid-position-left {
    float: left;
    width: 100px;
    margin-right: 20px;
}

/* --- Helper Classes -- */
.mw-hidden {
    display: none !important;
}

/* --- Custom Lightbox Modal Styles --- */
.mw-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(9, 21, 52, 0.95);
    /* Deep dark blue/black specific to screenshot */
    backdrop-filter: blur(5px);
}

.mw-modal-content {
    margin: 2% auto;
    padding: 0;
    width: 90%;
    max-width: 1400px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    color: white;
}

/* Header */
.mw-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 0px solid #555;
}

.mw-modal-header h4 {
    margin: 0;
    font-size: 1.5rem;
    color: white;
    font-weight: 300;
}

/* Close Button - Moved Details */
.mw-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    z-index: 20;
}

.mw-close:hover,
.mw-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Body Layout */
.mw-modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 30px;
    /* More padding around content */
    gap: 30px;
    position: relative;
    /* Context for close btn if needed */
}

/* Left - Main Image */
.mw-modal-left {
    flex: 3;
    /* Give more space to image as requested */
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    height: 100%;
}

/* ... */

/* Right - Info & Grid */
.mw-modal-right {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mw-modal-info {
    color: #fff;
    text-align: left;
}

#mw-modal-product-name {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1.2;
}

.mw-modal-desc {
    font-size: 0.9rem;
    color: #ddd;
    line-height: 1.4;
    margin-bottom: 10px;
}

/* Label Grid Item */
.mw-modal-label {
    margin-top: 5px;
    font-size: 0.9rem;
    font-style: italic;
    color: #ddd;
    text-align: left;
}

/* Label when Under Image */
.mw-label-under {
    text-align: center;
    margin-top: 10px;
    width: 100%;
    color: #fff;
    font-style: normal;
}

/* Image Group Wrapper */
.mw-img-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
    position: relative;
    overflow: hidden;
    /* Clip inner zoom */
}

.mw-img-group img {
    max-height: 85vh;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.mw-modal-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols-mobile), 1fr);
    gap: 15px;
}

@media (min-width: 768px) {
    .mw-modal-grid {
        grid-template-columns: repeat(var(--cols-tablet), 1fr);
    }
}

@media (min-width: 992px) {
    .mw-modal-grid {
        grid-template-columns: repeat(var(--cols-desktop), 1fr);
    }
}

/* Main Image Wrapper */
.mw-main-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    /* Changed from #000 to transparent based on feedback, or let it be set by modal bg */
}

/* Nav Arrows */
.mw-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.mw-nav-arrow:hover {
    /* ... */
    background: rgba(255, 255, 255, 0.5);
    color: var(--mw-arrow-color, #000);
}

.mw-prev {
    left: 10px;
}

.mw-next {
    right: 10px;
}


/* Transition Classes - Force override */
.mw-fade-out {
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.mw-zoom-out {
    transform: scale(0.8) !important;
    opacity: 0 !important;
    transition: all 0.3s ease !important;
}

.mw-slide-out-left {
    transform: translateX(-50px) !important;
    opacity: 0 !important;
    transition: all 0.3s ease !important;
}

/* ... */

.mw-slide-out-right {
    transform: translateX(50px);
    opacity: 0;
    transition: all 0.3s ease;
}

/* Helper to ensure image fits wrapper */
.mw-modal-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Vertically center in the left column */
    height: 100%;
}

.mw-modal-grid-item {
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
    background: white;
    padding: 5px;
    /* Screenshot shows a bit of white padding */
}

.mw-modal-grid-item.active {
    border-color: #ff00ff;
    /* Pink selection from screenshot */
    border-color: var(--mw-border-color-large, #ff00ff);
}

.mw-modal-thumb {
    width: 100%;
    height: auto;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .mw-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        margin: 0;
        border-radius: 0;
    }

    .mw-modal-body {
        flex-direction: column;
        padding: 0;
        /* Let children handle padding or maintain wrapper padding */
        gap: 0;
    }

    .mw-modal-left {
        width: 100%;
        height: auto;
        flex: 0 0 auto;
        padding: 10px;
        background: #000;
        /* Optional: Keep bg consistent if needed, or transparent */
    }

    .mw-img-group {
        height: auto;
    }

    .mw-img-group img {
        max-height: 50vh;
        /* Smaller to fit content below */
    }

    .mw-modal-right {
        width: 100%;
        height: auto;
        flex: 1;
        padding: 15px;
        overflow-y: auto;
        background: rgba(0, 0, 0, 0.5);
        /* Slight separation */
    }

    .mw-modal-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
    }

    /* Adjust close button for mobile */
    .mw-close {
        top: 10px;
        right: 10px;
        z-index: 100;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
    }
}
