/* ===== layout/page.css ===== */
/*-------------------------------------------------------------------- main --*/

.t-page {
    position: relative;
}

.t-page.-loadingSite::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 9999;
    opacity: 1;
    pointer-events: none;
}

.t-page.-siteLoad::before {
    opacity: 0;
    visibility: hidden;
    transition: 0.2s ease-out;
}

.js-clone {
    display: none !important;
}



/* ===== actions/button.css ===== */
.a-button.-disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.a-button:has(.a-icon:only-child) {
    padding: 8px;
    border-radius: 12px;
}

.a-button.-isLoading {
    opacity: 0.8;
    cursor: progress;
    pointer-events: none;
    color: transparent;

}

.a-button.-isLoading::before {
    content: "";
    background-color: var(--buttonTextColor); /* 🎨 color dinámico */

    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><circle transform-origin="center" fill="none" stroke="white" stroke-width="30" stroke-linecap="round" stroke-dasharray="200 1000" stroke-dashoffset="0" cx="100" cy="100" r="70"><animateTransform attributeName="transform" type="rotate" dur="2s" values="360;0" repeatCount="indefinite"/></circle><circle transform-origin="center" fill="none" opacity=".2" stroke="white" stroke-width="30" stroke-linecap="round" cx="100" cy="100" r="70"/></svg>')
        no-repeat center / contain;

    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><circle transform-origin="center" fill="none" stroke="white" stroke-width="30" stroke-linecap="round" stroke-dasharray="200 1000" stroke-dashoffset="0" cx="100" cy="100" r="70"><animateTransform attributeName="transform" type="rotate" dur="2s" values="360;0" repeatCount="indefinite"/></circle><circle transform-origin="center" fill="none" opacity=".2" stroke="white" stroke-width="30" stroke-linecap="round" cx="100" cy="100" r="70"/></svg>')
        no-repeat center / contain;

    display: block;
    width: 16px;
    height: 16px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}
.a-button.-isLoading.-outline::before {
    background-color: var(--buttonBaseColor); /* 🎨 color dinámico */
}

@scope (.a-button.-isLoading) {
    .text,
    svg {
        opacity: 0;
    }
}


/* ===== animations/loading.css ===== */

/* #region --------------------------------------------- LOADING ANIMACION -- */

/* #region> ---------------------------------------------------- Keyframes -- */
@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}
@keyframes scale {
    0%,
    100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}
@keyframes opacity {
    0%,
    100% {
        opacity: 0;
    }
    25%,
    75% {
        opacity: 1;
    }
}
@keyframes shake {
    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }
    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }
    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }
    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}
.-agitar {
    animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
/* #endregion Keyframes */

.m-loadingCover.-error {
    --color: #d75450;
}
.m-loadingCover.-success {
    --color: #17a2b8;
}

.m-loadingCover {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
    background-color: #fffffff0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s;
    z-index: -1;
}
.m-loadingCover__layout,
.m-loadingCover__info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16rem;
}
.m-loadingCover.-active{
    opacity: 1;
    z-index: 990;
}

/* #region> ---------------------------------------------------------- SVG -- */
.m-loadingCover .animationSVG{
    display: none;
}

.m-loadingCover.-error .animationSVG,
.m-loadingCover.-success .animationSVG{
    display: flex;
}

.m-loadingCover.-error .a-loadingCover__loader,
.m-loadingCover.-success .a-loadingCover__loader {
    display: none;
}

.m-loadingCover .m-loadingCover__info {
    display: none;
    opacity: 0;
    transition: all ease 0.2s;
}
.m-loadingCover .m-loadingCover__info.-active {
    display: flex;
    opacity: 1;
}

 
@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px var(--color);
    }
}

.animationSVG {
    padding: 2px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #fff;
    stroke-miterlimit: 10;
    margin: 0;
    box-shadow: inset 0px 0px 0px var(--color);
    animation: fill 0.2s ease-in-out 0.2s forwards, opacity 0.5s ease-in-out,
        scale 0.15s ease-in-out 0.5s both;
}
.animationSVG__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    fill: none;
    stroke: var(--color);
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.-error .animationSVG_check.-success,
.-success .animationSVG_check.-error {
    display: none;
}
.animationSVG_check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.2s forwards;
}
/* #endregion SVG */

/* #region> ------------------------------------------------------ Mensaje -- */
.m-loadingCover__msg {
    color: #2d4059;
}

.m-loadingCover__button{
    padding: 8rem 16px;
    border: 1px solid var(--color);
    border-radius: 5px;
    color: var(--color);
    background-color: white;
    cursor: pointer;
    animation: all 0.5s ease-in-out;
}
.m-loadingCover__button:hover{
    background-color: var(--color);
    border: 1px solid var(--color);
    color: white;
}


.a-loadingCover__loader {
    margin: 4px;
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top: 4px solid #17a2b8;
    width: 48px;
    height: 48px;
    opacity: 0;
    animation: spin 2s linear infinite;
}
.m-loadingCover.-active .a-loadingCover__loader{
    opacity: 1;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}


/* #endregion mensaje */
/* #endregion LOADING ANIMACION */


