/**
 * Button Loader Styles
 * 
 * Loader/spinner globale per bottoni durante click e navigazione
 * 
 * @package Porto Child
 */

/* === Loader Globale (overlay fullscreen) === */
.hk-button-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.hk-button-loader.hk-loader-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* === Contenitore loader (logo + spinner + testo) === */
.hk-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* === Logo sopra lo spinner === */
.hk-loader-logo {
    max-width: 150px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 10px;
}

/* === Spinner === */
.hk-loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #E74338;
    border-radius: 50%;
    animation: hk-spin 0.8s linear infinite;
}

/* === Testo sotto lo spinner === */
.hk-loader-text {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

@keyframes hk-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === Stato loading sui bottoni === */
.hk-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
    cursor: wait !important;
}

.hk-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hk-spin 0.6s linear infinite;
}

/* === Loader inline per bottoni piccoli (opzionale) === */
.card-button.hk-loading,
.single_add_to_cart_button.hk-loading,
.add_to_cart_button.hk-loading {
    position: relative;
    color: transparent !important;
}

.card-button.hk-loading::after,
.single_add_to_cart_button.hk-loading::after,
.add_to_cart_button.hk-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hk-spin 0.6s linear infinite;
}

/* === Responsive === */
@media (max-width: 767px) {
    .hk-loader-logo {
        max-width: 120px;
        max-height: 60px;
        margin-bottom: 8px;
    }
    
    .hk-loader-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    .hk-loader-text {
        font-size: 14px;
    }
    
    .hk-loader-content {
        gap: 16px;
    }
}
