/* === range theme and appearance === */
input[type="range"] {
    font-size: 1.1rem;
    width: 12.5em;
}

input[type="range"].custom-range {
    color: #51a331;
    width: 100%;
    --thumb-height: 1.125em;
    --track-height: 0.225em;
    --track-color: rgba(0, 0, 0, 0.2);
    --brightness-hover: 118%;
    --brightness-down: 118%;
    --clip-edges: 0.125em;
}

input[type="range"].custom-range.win10-thumb {
    color: #2b2d42;

    --thumb-height: 1.375em;
    --thumb-width: 0.5em;
    --clip-edges: 0.0125em;
}

body.dark input[type="range"].custom-range {
    --track-color: #676774;
}

@media (prefers-color-scheme: dark) {

    input[type="range"].custom-range {
        color: #51a331;
        --track-color: rgba(255, 255, 255, 0.5);
    }

    input[type="range"].custom-range.win10-thumb {
        color: #3a86ff;
    }
}

/* === range commons === */
input[type="range"].custom-range {
    position: relative;
    background: #fff0;
    overflow: hidden;
}

input[type="range"].custom-range:active {
    cursor: grabbing;
}

input[type="range"].custom-range:disabled {
    filter: grayscale(1);
    opacity: 0.3;
    cursor: not-allowed;
}

/* === WebKit specific styles === */
input[type="range"].custom-range,
input[type="range"].custom-range::-webkit-slider-runnable-track,
input[type="range"].custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    transition: all ease 100ms;
    height: var(--thumb-height);
}

input[type="range"].custom-range::-webkit-slider-runnable-track,
input[type="range"].custom-range::-webkit-slider-thumb {
    position: relative;
}

input[type="range"].custom-range::-webkit-slider-thumb {
    --thumb-radius: calc((var(--thumb-height) * 0.5) - 1px);
    --clip-top: calc((var(--thumb-height) - var(--track-height)) * 0.5 - 0.5px);
    --clip-bottom: calc(var(--thumb-height) - var(--clip-top));
    --clip-further: calc(100% + 1px);
    --box-fill: calc(-100vmax - var(--thumb-width, var(--thumb-height))) 0 0
        100vmax currentColor;

    width: var(--thumb-width, var(--thumb-height));
    background: linear-gradient(currentColor 0 0) scroll no-repeat left center /
        50% calc(var(--track-height) + 1px);
    background-color: currentColor;
    box-shadow: var(--box-fill);
    border-radius: var(--thumb-width, var(--thumb-height));

    filter: brightness(100%);
    clip-path: polygon(
        100% -1px,
        var(--clip-edges) -1px,
        0 var(--clip-top),
        -100vmax var(--clip-top),
        -100vmax var(--clip-bottom),
        0 var(--clip-bottom),
        var(--clip-edges) 100%,
        var(--clip-further) var(--clip-further)
    );
}

input[type="range"].custom-range:hover::-webkit-slider-thumb {
    filter: brightness(var(--brightness-hover));
    cursor: grab;
}

input[type="range"].custom-range:active::-webkit-slider-thumb {
    filter: brightness(var(--brightness-down));
    cursor: grabbing;
}

input[type="range"].custom-range::-webkit-slider-runnable-track {
    background: linear-gradient(var(--track-color) 0 0) scroll no-repeat center /
        100% calc(var(--track-height) + 1px);
}

input[type="range"].custom-range:disabled::-webkit-slider-thumb {
    cursor: not-allowed;
}

/* === Firefox specific styles === */
input[type="range"],
input[type="range"]::-moz-range-track,
input[type="range"]::-moz-range-thumb {
    appearance: none;
    transition: all ease 100ms;
    height: var(--thumb-height);
}

input[type="range"].custom-range::-moz-range-track,
input[type="range"].custom-range::-moz-range-thumb,
input[type="range"].custom-range::-moz-range-progress {
    background: #fff0;
}

input[type="range"].custom-range::-moz-range-thumb {
    background: currentColor;
    border: 0;
    width: var(--thumb-width, var(--thumb-height));
    border-radius: var(--thumb-width, var(--thumb-height));
    cursor: grab;
}

input[type="range"].custom-range:active::-moz-range-thumb {
    cursor: grabbing;
}

input[type="range"].custom-range::-moz-range-track {
    width: 100%;
    background: rgba(0,0,0,.2);
}

body.dark input[type="range"].custom-range::-moz-range-track {
    width: 100%;
    background: #676774;
}

input[type="range"].custom-range::-moz-range-progress {
    appearance: none;
    background: currentColor;
    transition-delay: 30ms;
}

input[type="range"].custom-range::-moz-range-track,
input[type="range"].custom-range::-moz-range-progress {
    height: calc(var(--track-height) + 1px);
    border-radius: var(--track-height);
}

input[type="range"].custom-range::-moz-range-thumb,
input[type="range"].custom-range::-moz-range-progress {
    filter: brightness(100%);
}

input[type="range"].custom-range:hover::-moz-range-thumb,
input[type="range"].custom-range:hover::-moz-range-progress {
    filter: brightness(var(--brightness-hover));
}

input[type="range"].custom-range:active::-moz-range-thumb,
input[type="range"].custom-range:active::-moz-range-progress {
    filter: brightness(var(--brightness-down));
}

input[type="range"].custom-range:disabled::-moz-range-thumb {
    cursor: not-allowed;
}


/* PERSONALIZADO */
.range-wrapper .range-values {
    font-size: 14px;
}

input[type="range"].custom-range {
     z-index: 3;
}
.range-lines {
    background: #eee;
    position: absolute;
    top: 17px;
    left: 0;
    width: 100%;
    height: 5px;
    z-index: 2;
}
.range-lines div {
    background: #51a331;
    height: 5px;
    width: 2px;
    position: absolute;
}
.range-lines div:nth-child(1) {left: calc(25% - 2px);}
.range-lines div:nth-child(2) {left: calc(50% - 5px);}
.range-lines div:nth-child(3) {left: calc(75% - 15px);}
.range-lines div:nth-child(4) {left: 100%;}
