html {
    scroll-behavior: smooth;
}

body {
    position: relative;
}

/* Popup fluttuante pulito ed elegante (Solo CSS) */
.custom-popup-overlay {
    position: fixed !important;
    top: 24px !important;
    right: 24px !important;
    left: auto !important;
    bottom: auto !important;
    background: rgba(15, 23, 42, 0.95) !important;
    border: 2px solid #E1306C !important;
    color: #ffffff !important;
    padding: 16px 22px !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
    z-index: 999999 !important;
    max-width: 320px !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    opacity: 0;
    transform: translateY(-20px);
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    overflow: hidden !important;
    backdrop-filter: blur(8px);
    box-sizing: border-box !important;
}

.custom-popup-overlay.show {
    opacity: 1 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
}

.popup-progress {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 3px !important;
    background: #E1306C !important;
    transform-origin: right !important;
    transform: scaleX(1);
}

.custom-popup-overlay.show .popup-progress {
    animation: shrinkBar 2s linear forwards !important;
}

@keyframes shrinkBar {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

.coffee-support-button {
    position: absolute;
    z-index: 900;
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    background: #8b5e3c;
    box-shadow: 0 5px 16px rgba(50, 33, 20, 0.28);
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

.coffee-support-button:hover,
.coffee-support-button:focus-visible {
    border-color: #6f452a;
    background: #6f452a;
    transform: scale(1.06);
}

.payment-overlay {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(3px);
}

.payment-overlay[hidden] {
    display: none;
}

.payment-brand-button {
    display: flex;
    width: min(100%, 360px);
    height: 78px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px solid #8b5e3c;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 18px 50px rgba(50, 33, 20, 0.24);
    cursor: pointer;
}

.payment-brand-button img {
    display: block;
    width: 62px;
    max-height: 34px;
    object-fit: contain;
}

.payment-brand-button:hover,
.payment-brand-button:focus-visible {
    background: #fff8f2;
    transform: scale(1.03);
}

.payment-close {
    position: absolute;
    top: 12px;
    right: 16px;
    border: 0;
    color: #1d3557;
    background: transparent;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.coffee-support-top {
    top: 18px;
    right: 18px;
}

.coffee-support-bottom {
    bottom: 18px;
    left: 18px;
}

@media (max-width: 420px) {
    .coffee-support-button {
        width: 48px;
        height: 48px;
        font-size: 1.45rem;
    }

    .coffee-support-top {
        top: 12px;
        right: 12px;
    }

    .coffee-support-bottom {
        bottom: 12px;
        left: 12px;
    }

}