:root {
    --x-control-stroke-width: 2px;
    --x-autoplay-stroke-width: 10px;
    --x-slider-progress-gap: 2%;
    --x-slider-autoplay-gap: 2%;
}

/* progress */

.x-slider_progress {
    background-color: #f3f3f3;
}
  
.x-slider_progress-bar {
    background: #111;
    height: 4px;
    transition: width 400ms ease;
    width: 0;
}

.x-slider .splide__list > .x-slider-control {
    z-index: 1;
}

.x-slider_progress {
    position: relative;
    overflow: hidden;
    --xsliderprogress-thickness: 4px;
}

.x-slider_progress-bar {
    pointer-events: none;
}

.x-slider_counter {
    display: flex;
    flex-direction: row;
    opacity: 0;
}

.x-slider_counter-total {
    display: flex;
    flex-direction: row;
}

.x-slider_counter-index {
    display: flex;
    flex-direction: row;
}

.x-slider_counter-seperator {
    margin: 0 5px;
    display: flex;
    align-items: center;
}

.x-slider_counter-index-number {
    margin-left: 5px;
}

.x-slider_counter-total-number {
    margin-right: 5px;
}

[data-x-slider-control*="progressBar"] {
    position: relative;
    width: 100%;
}

.x-slider_progress-bar {
    cursor: pointer;
}

.x-slider_progress:focus-visible,
.x-slider-control_autoplay_progress[role=slider]:focus-visible {
    outline: thin dotted currentcolor;
    outline-offset: -2px;  
}

[data-x-slider-control*="rtl"] .x-slider_progress-bar,
.x-slider_progress-bar.rtl {
    margin-left: auto;
}


.x-slider-control[data-x-slider-control*="progressBarClickable"] .x-slider_progress {
    cursor: pointer;
}

.x-slider_progress-bar {
    height:  var(--xsliderprogress-thickness);
}

.x-splide__toggle {
    padding: 10px;
    opacity: 0;
}

.x-splide__toggle_ready {
    opacity: 1;
}

/* custom nav */

button.x-slider-control_nav {
    background-color: #f3f3f3;
    color: currentColor;
    padding-top: 15px;
    padding-right: 20px;
    padding-bottom: 15px;
    padding-left: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

button.x-slider-control_nav[disabled], 
button.x-slider-control_nav:disabled {
    color: currentColor;
    opacity: .35;
}

/* builder */

component.x-slider-control .x-slider_progress-bar {
    width: calc(100% / 3);
}

component.x-slider-control .x-slider_counter,
component.x-slider-control .x-splide__toggle {
    opacity: 1;
}

component.x-slider-control.brx-draggable.is-empty {
    min-height: 0;
    min-width: 0;
}

/* temp */

.x-slider-control[data-x-slider-control*="autoplayProgress"],
.x-slider-control.autoplayProgress {
    overflow: unset;
}

[data-x-autoplay-progress*="autoplayProgressBar"] {
    width: 100%;
}

.x-slider-control_autoplay_container {
    position: relative;
    display: flex;
    width: 100px;
}

.x-slider-control_autoplay_circle {
    fill: transparent;
    transform-origin: center;
    transform: rotate(-90deg);
    pointer-events: none;
}

svg:not(:root).x-slider-control_autoplay_circle,
svg:not(:root).x-slider-control_autoplay_circle_bg {
    overflow: unset!important;
}

.x-slider-control_autoplay_circle circle {
    stroke-width: calc( var(--x-autoplay-stroke-width) + 1px);
    stroke: #111;
    stroke-linecap: round;
    stroke-dashoffset: calc( 1581.8 - (3163.6 * var(--x-slider-autoplay) ) )!important;
}

component.x-slider-control .x-slider-control_autoplay_circle circle {
    stroke-dashoffset: 874.617!important;
}

svg.x-slider-control_autoplay_circle_bg circle {
    stroke-width: calc( var(--x-autoplay-stroke-width) + 1px);
    stroke: #e6e7e8;
}

svg.x-slider-control_autoplay_circle_bg {
    fill: transparent;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
}

.x-slider-control .x-slider-control_autoplay_inner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    border-radius: 1000px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.x-slider-control_autoplay_progress {
    background-color: #f3f3f3;
    width: 100%;
    height: 100%;
}

.x-slider-control[data-x-slider-control*="autoplayProgressSegmented"] .x-slider-control_autoplay_progress,
.x-slider-control_autoplay_progress[data-segmented] {
    --x-slider-segments: 1;
    -webkit-mask-image: repeating-linear-gradient(
        to right,
        #000 0 calc((100% - (var(--x-slider-segments) - 1) * var(--x-slider-autoplay-gap)) / var(--x-slider-segments)),
        transparent 0 calc((100% - (var(--x-slider-segments) - 1) * var(--x-slider-autoplay-gap)) / var(--x-slider-segments) + var(--x-slider-autoplay-gap))
    );
    mask-image: repeating-linear-gradient(
        to right,
        #000 0 calc((100% - (var(--x-slider-segments) - 1) * var(--x-slider-autoplay-gap)) / var(--x-slider-segments)),
        transparent 0 calc((100% - (var(--x-slider-segments) - 1) * var(--x-slider-autoplay-gap)) / var(--x-slider-segments) + var(--x-slider-autoplay-gap))
    );
}

.x-slider-control_autoplay_progress[data-segmented] {
    --x-slider-segments: 3;
}

.x-slider-control[data-x-slider-control*="autoplayProgressSegmented"] .x-slider-control_autoplay_progress,
.x-slider-control_autoplay_progress[data-segmented] {
    cursor: pointer;
}

.x-slider-control_autoplay_progress-bar {
    background: #111;
    height: 4px;
    transform: scaleX(var(--x-slider-autoplay));
    transform-origin: left;
    will-change: transform; 
    transition: transform 40ms linear;
}


.x-slider-control_nav-arrow-default {
    fill: currentColor;
    font-size: 9px;
    vertical-align: baseline; 
    line-height: 1;
}

.x-slider_progress {
    position: relative;
    overflow: hidden;
    background: #f3f3f3;
    --x-slider-segments: 1;
} 

.x-slider-control[data-x-slider-control*="progressSegmented"] .x-slider_progress,
.x-slider_progress[data-segmented] {
    
    -webkit-mask-image: repeating-linear-gradient(
        to right,
        #000 0 calc((100% - (var(--x-slider-segments) - 1) * var(--x-slider-progress-gap)) / var(--x-slider-segments)),
        transparent 0 calc((100% - (var(--x-slider-segments) - 1) * var(--x-slider-progress-gap)) / var(--x-slider-segments) + var(--x-slider-progress-gap))
    );
    mask-image: repeating-linear-gradient(
        to right,
        #000 0 calc((100% - (var(--x-slider-segments) - 1) * var(--x-slider-progress-gap)) / var(--x-slider-segments)),
        transparent 0 calc((100% - (var(--x-slider-segments) - 1) * var(--x-slider-progress-gap)) / var(--x-slider-segments) + var(--x-slider-progress-gap))
    );
}
 
/* map aria-valuemax to segment count */
.x-slider_progress[aria-valuemax="1"] { --x-slider-segments: 1; }
.x-slider_progress[aria-valuemax="2"] { --x-slider-segments: 2; }
.x-slider_progress[aria-valuemax="3"] { --x-slider-segments: 3; }
.x-slider_progress[aria-valuemax="4"] { --x-slider-segments: 4; }
.x-slider_progress[aria-valuemax="5"] { --x-slider-segments: 5; }
.x-slider_progress[aria-valuemax="6"] { --x-slider-segments: 6; }
.x-slider_progress[aria-valuemax="7"] { --x-slider-segments: 7; }
.x-slider_progress[aria-valuemax="8"] { --x-slider-segments: 8; }
.x-slider_progress[aria-valuemax="9"] { --x-slider-segments: 9; }
.x-slider_progress[aria-valuemax="10"] { --x-slider-segments: 10; }
.x-slider_progress[aria-valuemax="11"] { --x-slider-segments: 11; }
.x-slider_progress[aria-valuemax="12"] { --x-slider-segments: 12; }
.x-slider_progress[aria-valuemax="13"] { --x-slider-segments: 13; }
.x-slider_progress[aria-valuemax="14"] { --x-slider-segments: 14; }
.x-slider_progress[aria-valuemax="15"] { --x-slider-segments: 15; }
