/*******************************************************************************************
*   ___  _          ______                     _ _                _                        *
*  / _ \| |         | ___ \                   | (_)              | |              © 2025   *
* / /_\ | | _____  _| |_/ /_ __ __ _ _ __   __| |_ _ __   __ _   | |_ ___  __ _ _ __ ___   *
* |  _  | |/ _ \ \/ / ___ \ '__/ _` | '_ \ / _` | | '_ \ / _` |  | __/ _ \/ _` | '_ ` _ \  *
* | | | | |  __/>  <| |_/ / | | (_| | | | | (_| | | | | | (_| |  | ||  __/ (_| | | | | | | *
* \_| |_/_|\___/_/\_\____/|_|  \__,_|_| |_|\__,_|_|_| |_|\__, |  \___\___|\__,_|_| |_| |_| *
*                                                         __/ |                            *
*                                                        |___/                             *
* ---------------------------------------------------------------------------------------- *
* This is commercial software, only users who have purchased a valid license and accept    *
* to the terms of the License Agreement can install and use this program.                  *
* ---------------------------------------------------------------------------------------- *
* website: https://cs-cart.alexbranding.com                                                *
*   email: info@alexbranding.com                                                           *
*******************************************************************************************/
@pr-current-percent-color: yellow;
@pr-raunded: true;
@bg-not-preloaded-content: rgb(33,150,243);
@bg-preloaded-content: rgb(43,235,11);
@bg-missing-preloaded-content: rgb(235,11,12);
@pr-z-index: 1010;

.cm-ab-p-calculate-pov:hover {
    opacity: 1 !important;
}

.ab__p_tooltip {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 16px;
    font-size: 14px;  
    background-color: darken(@bg-preloaded-content, 15%);
    box-shadow: 0 0 0 3px @content_bg;
    z-index: @pr-z-index + 1;
    border-radius: 10px;
    
    transition: all .3s ease-in;

    &:before {
        content: "%";
        font-size: 12px;
        font-weight: bolder;
        letter-spacing: -1px;
        color: contrast(darken(@bg-preloaded-content, 15%), @font, white);
    }
}

.ab__p_show_percent {
    display: block;
    position: relative;
    overflow: hidden;
    z-index: @pr-z-index;

    .ab__p_tooltip {
        background-color: darken(@bg-not-preloaded-content, 10%);
    }
    &:hover .ab__p_tooltip {

    }

    &.ab__p_lcp_missing { /* Mark an image to be preloaded but not preloaded */
        &:after {
            background-color: fade(@bg-missing-preloaded-content, 50%);
        }
        .ab__p_tooltip {
            background-color: darken(@bg-missing-preloaded-content, 10%);
        }
    }

    &.ab__p_preloaded { /* Mark preloaded images */
        &:after {
            background-color: fade(@bg-preloaded-content, 50%);
        }
        .ab__p_tooltip {
            background-color: darken(@bg-preloaded-content, 10%);
        }
    }
    
    &.ab__p_preloaded:after, &:after {
        background-image: linear-gradient(hsla(0,0%,100%,.1) 1px, transparent 0), linear-gradient(90deg, hsla(0,0%,100%,.1) 1px, transparent 0);
        background-size: 5px 5px, 5px 5px;
        overflow: hidden;
    }
    &:after,
    &:before { /* Base style for information layout */
        position: absolute;
        top: 50%;
        width: 100%;
        height: 100%;
        letter-spacing: -1px;
        transform: translate(-50%, -50%);
        display: flex;
        align-items: center;
        justify-content: center;
        text-shadow: 0 -1px fade(@font, 50%), -1px 0 fade(@font, 50%), 0 1px fade(@font, 50%), 1px 0 fade(@font, 50%);
    }

    &:after { /* Current percent */
        content: attr(data-ca-percent);
        left: 50%;
        background-color: fade(@bg-not-preloaded-content, 50%);
        color: @pr-current-percent-color;
        font-size: 2.5em;
        
    }

    &:before { /* Settings */
        content: attr(data-ca-settings-percent);
        left: 50%;
        margin-left: -40px;
        color: white;
        font-size: 1.5em;
        width: auto;
        height: auto;
        z-index: @pr-z-index + 1;
    }
}

.owl-item.ab__p_show_percent {
    display: inline-block;
}

[class*="list"] {
    .ab__p_show_percent {
        display: inline-flex;

        img {
            box-shadow: 0 0 0 100px @content_bg;
        }        
    }
}
