@use '../../styles/variables';

$carousel-prefix-cls: 'thy-carousel';

#{$carousel-prefix-cls} {
    margin-left: auto;
    margin-right: auto;
    position: relative;
    padding: 0;
    z-index: 1;
    .thy-carousel-initialized {
        margin-left: auto;
        margin-right: auto;
        position: relative;
        overflow: hidden;
        list-style: none;
        padding: 0;
        z-index: 1;
        .thy-carousel-wrapper {
            position: relative;
            width: 100%;
            height: 100%;
            z-index: 1;
            display: flex;
            transition-property: transform;
            transition-duration: 0s;
            box-sizing: content-box;
            transform: translate3d(0px, 0, 0);
            cursor: grab;
            .thy-carousel-item {
                flex-shrink: 0;
                width: 100%;
                position: relative;
                transition-property: transform;
                user-select: none;
                img {
                    user-select: none;
                    -webkit-user-drag: none;
                    display: block;
                    width: 100%;
                    height: auto;
                }
            }
        }
    }
    .thy-carousel-point-events {
        touch-action: pan-y;
    }
    .thy-carousel-indicators {
        position: absolute;
        left: 0;
        bottom: 10px;
        z-index: 200;
        width: 100%;
        list-style: none;
        text-align: center;
        transform: translate3d(0, 0, 0);
        user-select: none;
        .thy-carousel-indicator {
            display: inline-block;
            padding: 0 4px;
            cursor: variables.$hand-cursor;
            &:hover {
                thy-dot {
                    border-color: variables.$white;
                }
            }
            thy-dot {
                transition: 0.3s opacity;
                border-color: variables.$carousel-dot-bg-color;

                &:hover,
                &.active {
                    border-color: variables.$white;
                }
            }
        }
    }
    .thy-carousel-control {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 200;
        cursor: variables.$hand-cursor;
        color: variables.$white;
        user-select: none;
        overflow: hidden;
        width: 32px;
        height: 32px;
        transition: 0.3s background;
        background: variables.$carousel-control-bg-color;
        border-radius: 50%;
        thy-icon {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            color: currentColor;
            font-size: 22px;
        }
        &:hover {
            background: variables.$carousel-control-hover-bg-color;
        }
        &-pre {
            left: 12px;
        }
        &-next {
            right: 12px;
        }
    }
}
