/* Loading Screen Styles */
#global-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

#global-loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 30px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.loading-bar-container {
    width: 300px;
    height: 6px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #81C784);
    border-radius: 10px;
    animation: loading 1.5s ease-in-out infinite;
    width: 0%;
}

@keyframes loading {
    0% {
        width: 0%;
        margin-left: 0%;
    }
    50% {
        width: 70%;
        margin-left: 15%;
    }
    100% {
        width: 0%;
        margin-left: 100%;
    }
}

.loading-text {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
    font-family: Arial, sans-serif;
}

/* Responsive */
@media (max-width: 768px) {
    .loading-logo {
        max-width: 150px;
    }

    .loading-bar-container {
        width: 250px;
    }
}


/* =============================================================================
   TOGGLE IMPOSTAZIONI DISTRIBUTORE
   ============================================================================= */

.distributor-settings-toggle {
    cursor: pointer;
    user-select: none;
    padding: 15px 20px;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.distributor-settings-toggle:hover {
    background: #e0e0e1;
}

.distributor-settings-toggle h2 {
    margin: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.distributor-settings-toggle .toggle-icon {
    transition: transform 0.3s ease;
    font-size: 20px;
}

.distributor-settings-toggle.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.distributor-settings-content {
    border: 1px solid #c3c4c7;
    border-top: none;
    border-radius: 0 0 4px 4px;
    padding: 20px;
    background: #fff;
    transition: all 0.3s ease;
}

.distributor-settings-content.collapsed {
    display: none;
}

/* =============================================================================
   POPUP DESCRIZIONI PRODOTTI (con HTML)
   ============================================================================= */

.c-product-description-popup {
    position: absolute;
    z-index: 100000;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: 400px;
    min-height: 200px;
    overflow-y: auto;
    padding: 15px 20px;
    border: 1px solid #ddd;
}

.c-product-description-popup .popup-header {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    color: #1d2327;
}

.c-product-description-popup .popup-content {
    font-size: 13px;
    line-height: 1.6;
    color: #50575e;
}

.c-product-description-popup .popup-content p {
    margin: 0 0 10px 0;
}

.c-product-description-popup .popup-content br {
    display: block;
    margin: 5px 0;
}

.c-product-description-popup .popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    padding: 5px;
    line-height: 1;
}

.c-product-description-popup .popup-close:hover {
    color: #d63638;
}

/* Nome prodotto cliccabile per popup */
.product-name-clickable {
    cursor: pointer;
    color: #2271b1;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.product-name-clickable:hover {
    color: #135e96;
    text-decoration-style: solid;
}

/* =============================================================================
   NOTE PAGAMENTO MODIFICABILI
   ============================================================================= */

.payment-notes-input {
    width: 100%;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}