:root {
    --gl-star-color: #fdd835;
    --gl-star-color-inactive: #dcdce6;
    --gl-star-empty: url('../img/star-empty.svg');
    --gl-star-full: url('../img/star-full.svg');
    --gl-star-size: 24px;
    --gl-tooltip-border-radius: 4px;
    --gl-tooltip-font-size: 0.875rem;
    --gl-tooltip-font-weight: 400;
    --gl-tooltip-line-height: 1;
    --gl-tooltip-margin: 12px;
    --gl-tooltip-padding: .5em 1em;
    --gl-tooltip-size: 6px;
}

[data-star-rating] > select {
    -webkit-clip-path: circle(1px at 0 0) !important;
            clip-path: circle(1px at 0 0) !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    height: 1px !important;
    margin: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    top: 0 !important;
    visibility: visible !important;
    white-space: nowrap !important;
    width: 1px !important;
}

[data-star-rating] > select {
    -webkit-appearance:  none;
       -moz-appearance:  none;
            appearance:  none;
    pointer-events: none;
}

[data-star-rating] > select::before,
[data-star-rating] > select::after {
    display: none !important;
}

[data-star-rating].gl-star-rating--ltr > select {
    left: 0 !important;
}

[data-star-rating].gl-star-rating--rtl > select {
    right: 0 !important;
}

[data-star-rating] {
    align-items: center;
    display: flex;
    position: relative;
}

.gl-star-rating:not([data-star-rating]) .gl-star-rating--stars {
    display: none;
}

[data-star-rating] .gl-star-rating--stars {
    align-items: center;
    cursor: pointer;
    display: flex;
    position: relative;
}

[data-star-rating] > select:focus + .gl-star-rating--stars span:first-child::before {
    box-shadow: 0 0 0 3px -moz-mac-focusring;
    box-shadow: 0 0 0 3px -webkit-focus-ring-color;
    box-shadow: 0 0 0 3px Highlight;
    content: '';
    display: block;
    height: 100%;
    outline: 1px solid transparent;
    pointer-events: none;
    position: absolute;
    width: 100%;
}

[data-star-rating] select[disabled] + .gl-star-rating--stars {
    cursor: default;
}

[data-star-rating] .gl-star-rating--stars > span {
    display: flex;
    height: 24px;
    height: 24px;
    height: var(--gl-star-size);
    margin: 0;
    width: 24px;
    width: 24px;
    width: var(--gl-star-size);
}

[data-star-rating] .gl-star-rating--stars[aria-label]::before,
[data-star-rating] .gl-star-rating--stars[aria-label]::after {
    -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
    bottom: auto;
    box-sizing: border-box;
    left: 100%;
    pointer-events: none;
    position: absolute;
    top: 50%;
    opacity: .9;
    transform-origin: top;
    transform: translate3d(0,-50%,0);
    white-space: nowrap;
    z-index: 10;
}

[data-star-rating] .gl-star-rating--stars[aria-label]::before {
    background-size: 100% auto !important;
    background-position: 50% !important;
}

[data-star-rating] .gl-star-rating--stars[aria-label]::before {
    background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 31"%3E%3Cpath fill="%23111" d="M12.002 31C12.002 25 0 19.838 0 15.5 0 11.24 12 6 12 0l.002 31z"/%3E%3C/svg%3E') no-repeat;
    content: '';
    height: 18px;
    margin-bottom: 0;
    margin-left: 6px;
    margin-left: 6px;
    margin-left: var(--gl-tooltip-size);
    width: 6px;
    width: 6px;
    width: var(--gl-tooltip-size);
}

[data-star-rating] .gl-star-rating--stars[aria-label]::after {
    background: #111;
    border-radius: 4px;
    border-radius: 4px;
    border-radius: var(--gl-tooltip-border-radius);
    color: #fff;
    content: attr(aria-label);
    font-size: 0.875rem;
    font-size: 0.875rem;
    font-size: var(--gl-tooltip-font-size);
    font-weight: normal;
    margin-left: 12px;
    margin-left: 12px;
    margin-left: var(--gl-tooltip-margin);
    padding: .5em 1em;
    padding: .5em 1em;
    padding: var(--gl-tooltip-padding);
    text-transform: none;
}

[data-star-rating].gl-star-rating--rtl .gl-star-rating--stars[aria-label]::before,
[data-star-rating].gl-star-rating--rtl .gl-star-rating--stars[aria-label]::after {
    left: auto;
    right: 100%;
}

[data-star-rating].gl-star-rating--rtl .gl-star-rating--stars[aria-label]::before {
    transform: scaleX(-1) translate3d(0,-50%,0);
    margin-left: 0;
    margin-right: 6px;
    margin-right: 6px;
    margin-right: var(--gl-tooltip-size);
}

[data-star-rating].gl-star-rating--rtl .gl-star-rating--stars[aria-label]::after {
    margin-left: 0;
    margin-right: 12px;
    margin-right: 12px;
    margin-right: var(--gl-tooltip-margin);
}

[data-star-rating] svg {
    height: 100%;
    width: 100%;
}

[data-star-rating] .gl-star-half {
    fill: none;
    stroke: none;
}

[data-star-rating] .gl-star-full {
    fill: #dcdce6;
    fill: #dcdce6;
    fill: var(--gl-star-color-inactive);
    stroke: #dcdce6;
    stroke: #dcdce6;
    stroke: var(--gl-star-color-inactive);
    transition: fill 0.15s ease-in-out, stroke 0.15s ease-in-out;
}

[data-star-rating] .gl-active .gl-star-full {
    fill: #fdd835;
    fill: #fdd835;
    fill: var(--gl-star-color);
    stroke: #fdd835;
    stroke: #fdd835;
    stroke: var(--gl-star-color);
}

/* Compatibilty with v3 */

.gl-star-rating--stars[class*=" s"] > span {
    background-image: url('../img/star-empty.svg') !important;
    background-image: url('../img/star-empty.svg') !important;
    background-image: var(--gl-star-empty) !important;
}

.gl-star-rating--stars[class*=" s"] > span {
    background-position: center;
    background-repeat: no-repeat;
    background-size: 90%;
}

.gl-star-rating--stars[class*=" s"] > span.gl-active,
.gl-star-rating--stars[class*=" s"] > span.gl-active.gl-selected {
    background-image: url('../img/star-full.svg') !important;
    background-image: url('../img/star-full.svg') !important;
    background-image: var(--gl-star-full) !important;
}
