.media-showcase-wrapper {
    display: grid;
    /* Grid Columns defined by Elementor Control */
    gap: 20px;
    /* Default Fallback */
    width: 100%;
    margin-bottom: 40px;
}

/* Carousel */
.media-showcase-carousel {
    width: 100%;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    /* Default Fallback */
    background-color: transparent;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--rule);
}

.media-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    width: 100%;
    height: 100%;
}

.media-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-image-wrapper,
.media-video-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    width: auto;
    height: auto;
}

.media-video-wrapper video,
.media-video-wrapper iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Grid */
.media-showcase-grid {
    display: grid;
    /* Grid Template Columns handled by Elementor Control */
    gap: 10px;
    /* Default Fallback */
    align-content: start;
    overflow-y: auto;
    max-height: 100%;
    padding-right: 5px;
}

.media-showcase-grid::-webkit-scrollbar {
    width: 6px;
}

.media-showcase-grid::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.media-grid-item {
    cursor: pointer;
    border-radius: 4px;
    /* Default Fallback */
    overflow: hidden;
    transition: opacity 0.3s ease, border-color 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

.media-grid-item:hover {
    border-color: #000;
}

.media-grid-item.active {
    border-color: #000;
}

.grid-thumb-aspect {
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    position: relative;
    background-color: #f0f0f0;
}

.grid-thumb-aspect img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.play-icon-overlay svg {
    width: 20px;
    height: 20px;
}

.play-icon-overlay svg > *{
    fill: #fff;
}

/* Mobile Stacking Logic */
@media (max-width: 767px) {
    .media-showcase-wrapper.media-mobile-stack {
        grid-template-columns: 100% !important;
        /* Force stack */
    }
}