@import '../../../styles/grid';
@import '../../../styles/mixins';
@import '../../../styles/fills';

$slide-hover-transition-duration: 0.2s;
$slide-padding-y: 6px;
$slide-gutter-height: $grid-gutter-height-large - ($slide-padding-y * 2);

.slick-track {
    display: flex !important;
}

.slick-initialized .slick-slide, .slick-slide {
    display: flex;
    height: inherit !important;
    flex-direction: column;
}

.slick-slide > div {
    flex: 1;
}

.slider {
    &_container {
        padding: 30px 0;
        position: relative;
    }
    &_header {
        display: flex;
        margin: 0 0 16px;
    }
    &_headerButtons {
        display: flex;
        align-items: flex-start;
        flex-shrink: 0;
        margin-left: auto;
    }
    &_title {
        @include title-1;
        line-height: 29px;
        margin: 0;
        flex-grow: 1;
    }
    &_navigationButton {
        padding-left: 6px;
        padding-right: 6px;
    }
    &_arrows {
        display: flex;
        align-items: center;
    }
    &_arrow {
        &Icon {
            width: 10px;

            path {
                fill: $deep-gray;
            }
        }
        &Text {
            @extend %sr-only;
        }
        &--next {
            margin-left: 8px;
        }
    }
    &_viewMore + &_arrows {
        margin-left: 10px;
    }
    &_viewMore {
        .button_item--link {
            font-size: $headingFontSize3;
        }
        &Icon {
            position: relative;
            top: 1px;
            height: 14px;
            margin-left: 16px;
        }
    }
    &_list {
        margin-right: $grid-gutter-width * -1;
        margin-left: $grid-gutter-width * -1;

        &--mobile {
            margin-right: $grid-gutter-width_small * -1;
            margin-left: $grid-gutter-width_small * -1;
        }
        
        &--static {
            display: grid;
            row-gap: 20px;
            grid-template-columns: repeat(var(--slider-column), minmax(0, 1fr));
            grid-auto-rows: 1fr;
        }
    }
    &_slide {
        display: flex;
        flex-direction: column;
        position: relative;
        padding: $slide-padding-y $grid-gutter-width;

        &--slider {
            height: 100%;
        }

        &--static {
            height: auto;
            margin-bottom: $slide-gutter-height;
        }
        &--mobile {
            padding-left: $grid-gutter-width_small;
            padding-right: $grid-gutter-width_small;
        }
    }
    &_content {
        display: flex;
        flex-direction: column;
        flex: 1;
        position: relative;

        &:after {
            content: "";
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            background-color: rgba(0, 1, 0, 0.07);
            opacity: 0;
            transition: opacity $slide-hover-transition-duration;
            pointer-events: none;
            border-radius: var(--slide-border-radius, 8px);
        }
        &:hover:after {
            opacity: 1;
        }

        // Classic and Horizontal layout dont have border, the hover background need to fill the parent padding
        &--classic, &--horizontal {
            &:after {
                top: $slide-padding-y  * -1;
                right: $grid-gutter-width * -1;
                bottom: $slide-padding-y  * -1;
                left:  $grid-gutter-width * -1;
            }
        }
        &--mobile#{&}--classic, &--mobile#{&}--horizontal {
            &:after {
                right: $grid-gutter-width_small * -1;
                left:  $grid-gutter-width_small * -1;
            }
        }
    }
    &_overlay {
        &Link {
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            z-index: 1;

            @include focus-outline;
        }
        &Label {
            @extend %sr-only;
        }
    }
    &_quickviewButton {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1;

        .button_item {
            opacity: 0;
            transition: opacity $slide-hover-transition-duration;

            &:focus {
                opacity: 1;
            }
        }
    }
    &_footer {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    // Show the quickview button when hover the Slide
    &_content:hover > &_quickviewButton .button_item {
        opacity: 1;
    }
}
