.wp-modern-carousel-gallery {
    position: relative;
    width: 100%;
}

.wp-modern-carousel-gallery-inner {
    display: grid;
    width: 100%;
    background-color: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
}

.wp-modern-carousel-gallery-item {
    grid-area: 1 / 1;
    width: 100%;
    min-width: 0;  /* Add this */
    min-height: 0; /* Add this */
    display: flex;
    align-items: stretch;
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.4s ease-in-out;
}

.wp-modern-carousel-gallery-item.active {
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
}

.wp-modern-carousel-gallery-item img {
    width: 100%;
    height: 100%;
    max-height: 85vh;
    object-fit: contain; /* Changed from cover to contain */
    display: block;
}

/* Navigation Arrows */
.wp-modern-carousel-gallery-prev,
.wp-modern-carousel-gallery-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: background-color 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.3);
    border: none;
    outline: none;
    z-index: 10;
}

.wp-modern-carousel-gallery-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.wp-modern-carousel-gallery-prev:hover,
.wp-modern-carousel-gallery-next:hover {
    background-color: rgba(0,0,0,0.5);
}

/* gallery navegation arrows */
.wp-modern-carousel-gallery-prev::before {
    content: "\276E";
}
.wp-modern-carousel-gallery-next::before {
    content: "\276F";
}

/* Dots */
.wp-modern-carousel-gallery-dots {
    text-align: center;
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    z-index: 10;
}

.wp-modern-carousel-gallery-dot {
    cursor: pointer;
    width: 10px;
    height: 10px;
    margin: 0 4px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    display: inline-block;
    transition:
        background-color 0.3s ease,
        transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    appearance: none;
    -webkit-appearance: none;
}

.wp-modern-carousel-gallery-dot.active,
.wp-modern-carousel-gallery-dot:hover {
    background-color: #fff;
}

.wp-modern-carousel-gallery-dot.active {
    transform: scale(1.15);
}

.wp-modern-carousel-gallery-dot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* Loading Spinner */
.wp-modern-carousel-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #fff;
    border-radius: 50%;
    animation: wp-modern-carousel-spin 1s linear infinite;
    z-index: 5;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.wp-modern-carousel-loader.is-loading {
    opacity: 1;
    visibility: visible;
}

@keyframes wp-modern-carousel-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
