/* =============================================
   Hover Image Slider for Ad Cards
   ============================================= */
.item-card__image {
    position: relative;
    overflow: hidden;
}

.item-card__image .item-card__images-track {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: none;
    will-change: transform;
    pointer-events: none;
    z-index: 1;
}

.item-card__image .item-card__images-track img {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.item-card__image > img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.15s ease;
}

.item-card__image.slider-active > img {
    opacity: 0;
}

/* Image count indicator — bottom center above dots, shown only on hover */
.item-card__image-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 5;
    backdrop-filter: blur(4px);
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.item-card__image-counter .material-icons {
    font-size: 14px;
    color: #fff;
}

.item-card__image.slider-active .item-card__image-counter {
    opacity: 1;
}

/* Navigation dots — at the very bottom */
.item-card__image-dots {
    position: absolute;
    bottom: 6px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 4px;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.item-card__image.slider-active .item-card__image-dots {
    opacity: 1;
}

.item-card__image-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: background 0.2s ease, transform 0.2s ease;
}

.item-card__image-dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* =============================================
   Mobile Swipe Slider (≤768px)
   ============================================= */
@media (max-width: 768px) {
    .item-card__image.slider-active-mobile > img {
        opacity: 0 !important;
    }

    .item-card__image.slider-active-mobile .item-card__image-counter {
        opacity: 1;
    }

    .item-card__image.slider-active-mobile .item-card__image-dots {
        opacity: 1;
    }

    .item-card__image .item-card__images-track {
        transition: none;
        will-change: transform;
    }

    .item-card__image.slider-active-mobile .item-card__images-track {
        z-index: 3;
    }

    /* Убираем hover-логику для мобильных */
    .item-card__image:not(.slider-active-mobile) .item-card__images-track {
        display: none;
    }

    .item-card__image.slider-active-mobile .item-card__images-track {
        display: flex;
    }
}
