/* Ocultar el image counter en el slider-modal */
.slider-modal .image-counter {
    display: none !important;
}

@import url(variables.css);

/* Modal styles */
.modal,
.slider-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow: auto;
    margin-top: 88px;
}

.slider-modal {
    z-index: 1001;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--m-5);
}


.slider-container {
    position: relative;
    width: auto;
    height: auto;
    max-width: calc(100vw - 48px);
    max-height: 99vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.slider-image {
    max-width: calc(100vw - 48px);
    max-height: 99vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
}

.slider-nav img {
    width: 16px;
    height: 16px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.slider-nav.active {
    cursor: pointer;
}

.slider-nav.active:hover {
    border-color: rgba(0, 0, 0, 0.6);
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-50%) scale(1.05);
}

.slider-nav.active:hover img {
    opacity: 0.9;
}

.slider-nav.inactive {
    opacity: 0.2;
    cursor: default;
    pointer-events: none;
    border-color: rgba(0, 0, 0, 0.15);
}

.slider-prev {
    left: 20px;
}

.slider-next {
    right: 20px;
}

@media (min-width: 1600px) {
    .slider-prev {
        left: 20px;
    }

    .slider-next {
        right: 20px;
    }
}

.slider-close {
    position: absolute;
    top: 35px;
    right: 35px;
    background: rgba(255, 255, 255, 0.9);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 32px;
    font-weight: bold;
    color: var(--color-text);
    transition: all 0.3s ease;
}

.slider-close:hover {
    background-color: rgba(255, 255, 255, 0.7);
    transform: scale(1.1);
    transition: all 0.3s ease;
}

.image-counter {
    position: absolute;
    bottom: 30px;
    right: 42%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    color: var(--primary-950);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.image-counter.single {
    opacity: 0.7;
}

.modal-content {
    position: relative;
    background-color: var(--neutral-white);
    margin: 5% auto;
    width: 90%;
    max-width: 1200px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-body {
    padding: 20px;
    display: flex;
    gap: 15px;
    flex-direction: column;
    align-items: stretch;
}

.modal-image-container {
    position: relative;
    flex: 1;
    max-width: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    line-height: 0;
}

.modal-image {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
    display: block;
    margin: 0;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    cursor: pointer;
    z-index: 3;
}

.modal-nav.show {
    display: flex;
}

.modal-nav img {
    width: 18px;
    height: 18px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.modal-nav:hover {
    border-color: rgba(0, 0, 0, 0.6);
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-50%) scale(1.05);
}

.modal-nav:hover img {
    opacity: 0.9;
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 6px;
    border-radius: 16px;
    font-size: 12px;
    color: var(--primary-950);
    z-index: 3;
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 500;
    height: 28px;
    box-sizing: border-box;
}

.modal-counter.show {
    display: flex;
}

.modal-counter.single {
    opacity: 0.7;
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    color: var(--color-text);
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.7);
    transform: scale(1.1);
    transition: all 0.3s ease;
}

/* Ocultar todas las imágenes excepto la primera en las tarjetas */
.card-img img:not(:first-child) {
    display: none;
}

.modal-image-container.zoomed .modal-image {
    cursor: move;
    transform: scale(1.5);
}

.modal-zoom-btn {
    position: absolute !important;
    top: 15px !important;
    right: 65px !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s ease !important;
    z-index: 1000 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.modal-zoom-btn:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    transition: all 0.3s ease;
}

.modal-zoom-btn svg {
    width: 22px;
    height: 22px;
    fill: var(--color-text);
    transition: fill 0.2s ease;
}

.modal-info {
    flex: 1;
    max-width: 100%;
    background-color: var(--primary-950);
    padding: 20px;
    color: var(--neutral-white);
    margin: 0;
}

.modal-title {
    font-size: 2rem;
    color: var(--color-text);
    margin-bottom: 20px;
}

.modal-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
}