.wp-block-gutenberg-test-gallery-slider {
    margin: 2rem 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Container */
.gallery-slider-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
}

/* Editor Preview */
.gallery-slider-preview {
    background: var(--color-white);
    border-radius: 8px;
    padding: clamp(1.25rem, 4vw, 1.5rem);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gallery-slider-controls {
    margin-bottom: 1rem;
    text-align: right;
}

.swiper-preview {
    position: relative;
    margin: 0 -10px;
    padding: 0 10px;
    overflow-x: auto;
}

.swiper-preview .swiper-wrapper {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc(33.333% - 20px);
    gap: 30px;
    padding: 10px 0;
}

/* Common styles */
.gallery-slider-item {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
    background-color: var(--color-primary-lighter, #f5f5f5);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    box-sizing: border-box;
}

.gallery-slider-item:hover {
    transform: translateY(-5px);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
    aspect-ratio: 16/9;
    cursor: pointer;
}

.gallery-slider-item:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 15px;
    margin: 0;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 1;
}

.gallery-slider-item:hover .gallery-caption {
    opacity: 1;
}

/* Remove button in editor */
.remove-image-button {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.6) !important;
    border-radius: 50%;
    color: white !important;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-slider-item:hover .remove-image-button {
    opacity: 1;
}

/* Frontend Swiper Styles */
.swiper.gallery-slider {
    width: 100%;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.swiper.gallery-slider .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.swiper.gallery-slider .swiper-slide {
    height: auto;
    flex-shrink: 0;
    width: 100%;
    position: relative;
    transition-property: transform;
}

.swiper.gallery-slider .swiper-slide .gallery-slider-item {
    height: 100%;
}

/* Navigation arrows */
.swiper.gallery-slider .swiper-button-prev,
.swiper.gallery-slider .swiper-button-next {
    background-color: var(--color-primary, #333);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.swiper.gallery-slider .swiper-button-prev {
    left: 10px;
}

.swiper.gallery-slider .swiper-button-next {
    right: 10px;
}

.swiper.gallery-slider .swiper-button-prev:hover,
.swiper.gallery-slider .swiper-button-next:hover {
    background-color: var(--color-primary-dark, #000);
    transform: scale(1.1);
}

.swiper.gallery-slider .swiper-button-prev:after,
.swiper.gallery-slider .swiper-button-next:after {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Pagination */
.swiper.gallery-slider .swiper-pagination {
    bottom: 10px;
}

.swiper.gallery-slider .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0.5;
}

.swiper.gallery-slider .swiper-pagination-bullet-active {
    background: var(--color-primary, #333);
    opacity: 1;
}

/* Expand button */
.gallery-expand-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--color-primary, #333);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.gallery-expand-button:hover {
    background: var(--color-primary-dark, #000);
    transform: scale(1.1);
}

.gallery-expand-button svg {
    fill: currentColor;
    width: 18px;
    height: 18px;
}

/* Modal styles */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.gallery-modal-content {
    max-width: 100%;
    max-height: 100%;
    overflow: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gallery-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.gallery-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Single Image View */
.modal-single-image {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
    position: relative;
}

.modal-single-image img {
    max-width: 100%;
    max-height: calc(100vh - 6rem);
    object-fit: contain;
    border-radius: 8px;
}

.modal-single-image .modal-caption {
    color: white;
    margin-top: 1rem;
    font-size: 1.1rem;
    text-align: center;
    max-width: 800px;
    padding: 0 1rem;
}

/* Modal Navigation Arrows */
.modal-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    transform: translateY(-50%);
    width: 100%;
    pointer-events: none;
}

.modal-nav-prev,
.modal-nav-next {
    background-color: var(--color-primary);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
    pointer-events: auto;
    opacity: 0.8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.modal-nav-prev:hover,
.modal-nav-next:hover {
    transform: scale(1.1);
    opacity: 1;
    background-color: var(--color-primary-dark, var(--color-primary));
}

.modal-nav-prev {
    margin-right: auto;
}

.modal-nav-next {
    margin-left: auto;
}

/* Mosaic Grid View */
.gallery-modal.is-mosaic .gallery-modal-content {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.gallery-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    animation: fadeInUp 0.3s ease-out;
}

.gallery-modal-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-white);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-modal-item:hover {
    transform: scale(1.05);
}

.gallery-modal-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .gallery-slider-item {
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
    }
    
    .swiper.gallery-slider {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
}

@media (max-width: 992px) {
    .wp-block-gutenberg-test-gallery-slider {
        margin: 1rem 0;
        max-width: 100%;
    }
    
    .gallery-image {
        aspect-ratio: 3/2;
    }
    
    .modal-nav-prev,
    .modal-nav-next {
        width: 40px;
        height: 40px;
    }
    
    .swiper.gallery-slider {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .wp-block-gutenberg-test-gallery-slider {
        margin: 0.75rem 0;
        max-width: 100%;
        padding: 0 10px;
    }

    .gallery-slider-container {
        border-radius: 6px;
        max-width: 100%;
    }
    
    .swiper.gallery-slider {
        border-radius: 6px;
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
        max-width: 100%;
        min-height: 200px;
        max-height: 300px;
    }
    
    .swiper.gallery-slider .swiper-wrapper {
        max-width: 100%;
    }
    
    .swiper.gallery-slider .swiper-slide {
        width: 100% !important;
        max-width: 100%;
    }
    
    .gallery-slider-item {
        border-radius: 4px;
        box-shadow: none;
        max-width: 100%;
    }
    
    .gallery-image {
        aspect-ratio: 4/3;
        height: 100%;
        max-height: 300px;
    }
    
    .gallery-caption {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .swiper-button-prev,
    .swiper-button-next {
        width: 34px;
        height: 34px;
    }
    
    .swiper-button-prev:after,
    .swiper-button-next:after {
        font-size: 1rem;
    }
    
    .gallery-expand-button {
        width: 32px;
        height: 32px;
    }
    
    .gallery-expand-button svg {
        width: 16px;
        height: 16px;
    }
    
    .gallery-modal-content {
        padding: 1rem;
        max-width: 100%;
    }
    
    .gallery-modal-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        max-width: 100%;
    }
    
    .modal-single-image img {
        max-height: calc(100vh - 4rem);
        max-width: 100%;
    }
    
    .modal-single-image .modal-caption {
        font-size: 0.9rem;
    }
    
    .modal-nav-prev,
    .modal-nav-next {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

@media (max-width: 640px) {
    .wp-block-gutenberg-test-gallery-slider {
        margin: 0.5rem 0;
        padding: 0 5px;
        width: 100%;
        max-width: 100%;
    }
    
    .gallery-slider-container {
        width: 100%;
        max-width: 100%;
    }
    
    .swiper.gallery-slider {
        border-radius: 4px;
        min-height: 150px;
        max-height: 250px;
        width: 100%;
        max-width: 100%;
    }
    
    .swiper.gallery-slider .swiper-wrapper {
        width: 100%;
        max-width: 100%;
    }
    
    .swiper.gallery-slider .swiper-slide {
        width: 100% !important;
        max-width: 100%;
    }
    
    .gallery-slider-item {
        border-radius: 4px;
        width: 100%;
        max-width: 100%;
    }
    
    .gallery-image {
        aspect-ratio: 1/1;
        max-height: 250px;
    }
    
    .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
    }
    
    .gallery-modal-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
        max-width: 100%;
    }
    
    /* Mantener las flechas de navegación visibles */
    .swiper.gallery-slider .swiper-button-prev,
    .swiper.gallery-slider .swiper-button-next {
        display: block;
        width: 30px;
        height: 30px;
    }
    
    .swiper.gallery-slider .swiper-button-prev:after,
    .swiper.gallery-slider .swiper-button-next:after {
        font-size: 0.9rem;
    }
    
    /* Make pagination more compact */
    .swiper.gallery-slider .swiper-pagination {
        bottom: 5px;
    }
    
    .swiper.gallery-slider .swiper-pagination-bullet {
        margin: 0 3px;
    }
}

@media (max-width: 480px) {
    .wp-block-gutenberg-test-gallery-slider {
        margin: 0.5rem 0;
        padding: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .gallery-slider-container {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .swiper.gallery-slider {
        min-height: 120px;
        max-height: 200px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
        width: 100%;
        max-width: 100%;
    }
    
    .swiper.gallery-slider .swiper-wrapper {
        width: 100%;
        max-width: 100%;
    }
    
    .swiper.gallery-slider .swiper-slide {
        width: 100% !important;
    }
    
    .gallery-slider-item {
        width: 100%;
        max-width: 100%;
    }
    
    .gallery-image {
        aspect-ratio: 1/1;
        max-height: 200px;
    }
    
    .gallery-caption {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .gallery-expand-button {
        width: 28px;
        height: 28px;
        top: 5px;
        right: 5px;
    }
    
    .gallery-expand-button svg {
        width: 14px;
        height: 14px;
    }
    
    /* Mantener las flechas de navegación visibles pero más pequeñas */
    .swiper.gallery-slider .swiper-button-prev,
    .swiper.gallery-slider .swiper-button-next {
        display: block;
        width: 24px;
        height: 24px;
    }
    
    .swiper.gallery-slider .swiper-button-prev:after,
    .swiper.gallery-slider .swiper-button-next:after {
        font-size: 0.8rem;
    }
    
    .gallery-modal-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
        max-width: 100%;
    }
    
    .modal-nav-prev,
    .modal-nav-next {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .modal-single-image .modal-caption {
        font-size: 0.8rem;
        margin-top: 0.5rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}