/* Main Slider Container */
.slider-wrapper {
    position: relative;
    width: 100%;
    background: #0d2a28;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 12px -4px rgb(0 0 0 / 16%);
    display: flex;
    flex-direction: column;
    /* margin-bottom: 20px; */
}

/* Main Image Container - Fixed Aspect Ratio */
.slider-main {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    aspect-ratio: 16 / 9;
    height: auto;
    max-height: 56.25vw;
    overflow: hidden;
    cursor: pointer;
    align-content: center;
}

.slider-main img {
    grid-area: 1 / 1 / 2 / 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform 0.5s ease, opacity 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.slider-main img.active {
    opacity: 1;
    visibility: visible;
}

.slider-main:hover img.active {
    transform: scale(1.02);
}


/* Zoom Icon Overlay */
.zoom-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.slider-main:hover .zoom-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.zoom-overlay svg {
    width: 28px;
    height: 28px;
    stroke: #1a2e2a;
}

/* Navigation Arrows */
.slider-arrow {
    position: absolute;
    top: 43%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 20;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.slider-arrow:hover,
.slider-arrow:focus {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.slider-arrow.prev {
    right: 15px;
}

.slider-arrow.next {
    left: 15px;
}

.slider-arrow svg {
    width: 24px;
    height: 24px;
    stroke: #1a1a2e;
}

/* Slider Footer */
.slider-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(13, 27, 42, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Slide Counter */
.slide-counter {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
}

.slide-counter span {
    color: #1aa899;
}

/* Thumbnail Container */
.thumbnails {
    display: flex;
    gap: 8px;
    direction: ltr;
}

.thumbnail {
    width: 45px;
    height: 35px;
    border-radius: 7px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.thumbnail:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.thumbnail.active {
    border-color: #1aa899;
    opacity: 1;
    box-shadow: 0 0 15px rgba(74, 222, 200, 0.114);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* More Images Button */
.more-images {
    width: 60px;
    height: 45px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.more-images:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #1aa899;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Lightbox Close Button */
.lightbox-close {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
}

/* Lightbox Navigation */
.lightbox-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
}

.lightbox-arrow:hover,.lightbox-arrow:focus {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-arrow.prev {
    right: 20px;
}

.lightbox-arrow.next {
    left: 20px;
}

.lightbox-arrow svg {
    width: 28px;
    height: 28px;
    stroke: #fff;
}

/* Lightbox Counter */
.lightbox-counter {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 1001;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .slider-main {
        aspect-ratio: 4 / 3 !important;
        min-height: 250px;
    }

    .slider-wrapper {
        /* margin-bottom: 20px !important; */
        border-radius: 12px;
    }

    .slider-arrow {
        padding: 5px 8px;
        width: 35px;
        height: 35px;
        top: 50%;
    }

    .slider-arrow svg {
        width: 25px;
        height: 25px;
    }


    .slider-footer {
        display: none;
        /* flex-direction: column; */
        gap: 15px;
        padding: 12px 15px;
    }

    .thumbnails {
        display: none;
        /* پنهان کردن بندانگشتی‌ها در موبایل برای خلوت شدن صفحه */
    }

    .thumbnail {
        width: 50px;
        height: 38px;
    }

    .more-images {
        width: 50px;
        height: 38px;
        font-size: 12px;
    }

    .slide-counter {
        order: 1;
    }

    .zoom-overlay {
        width: 50px;
        height: 50px;
    }

    .zoom-overlay svg {
        width: 24px;
        height: 24px;
    }

    .lightbox-arrow {
        width: 44px;
        height: 44px;
    }

    .lightbox-arrow svg {
        width: 22px;
        height: 22px;
    }

    .lightbox-close {
        top: 10px;
        left: 10px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .slider-arrow.prev {
        right: 10px;
    }

    .slider-arrow.next {
        left: 10px;
    }

    .thumbnail {
        width: 40px;
        height: 30px;
    }

    .more-images {
        width: 40px;
        height: 30px;
        font-size: 11px;
    }
}

/* Touch-friendly swipe indicator */
.swipe-hint {
    display: none;
}

@media (hover: none) and (pointer: coarse) {
    .swipe-hint {
        display: block;
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.6);
        color: #fff;
        padding: 5px 15px;
        border-radius: 15px;
        font-size: 12px;
        animation: fadeInOut 3s ease-in-out infinite;
    }

    @keyframes fadeInOut {

        0%,
        100% {
            opacity: 0;
        }

        50% {
            opacity: 1;
        }
    }
}