/* =========================================================
 * MPS NOTIFICATIONS
 * Mobile first
 * ========================================================= */


/* =========================================================
 * BADGE MENU LEGACY
 * ========================================================= */

.mps-menu-badge {
    margin-left: auto;

    min-width: 20px;
    height: 20px;
    padding: 0 6px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;

    background: #ff0000 !important;
    color: #ffffff !important;

    font-size: 11px;
    font-weight: 700;

    flex: 0 0 auto;
}


/* =========================================================
 * BADGE CARD DASHBOARD
 * ========================================================= */

/*
 * Il riferimento assoluto del badge è la card.
 */
.mps-mobile-dashboard .mps-mobile-card {
    position: relative;
}


/*
 * Stile del badge indipendente dalla dashboard:
 * potrà essere riutilizzato anche sulla futura dashboard desktop.
 */
.mps-card-badge {
    position: absolute !important;

    top: 2px !important;
    right: 2px !important;

    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;

    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    height: 26px !important;

    padding-bottom: 2px !important;
    padding-right: 6px !important;

    background-image:
        var(--mps-notifications-badge-image) !important;

    background-position: center !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;

    color: #ffffff !important;

    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1 !important;

    white-space: nowrap !important;

    pointer-events: none;
}


/* =========================================================
 * PANNELLO GLOBALE
 * ========================================================= */

.mps-notifications-panel {
    position: fixed;
    inset: 0;

    z-index: 999999;
}

.mps-notifications-panel[hidden] {
    display: none !important;
}


/* Sfondo oscurato */
.mps-notifications-panel-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.38);
}


/* =========================================================
 * BOTTOM SHEET
 * ========================================================= */

.mps-notifications-panel-sheet {
    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    width: 100%;
    max-height: 82dvh;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: #ffffff;

    border-radius: 20px 20px 0 0;

    box-shadow:
        0 -6px 24px rgba(0, 0, 0, 0.12);
}


/* =========================================================
 * HEADER
 * ========================================================= */

.mps-notifications-panel-header {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 54px;

    padding: 12px 16px;

    border-bottom: 1px solid #eeeeee;

    background: #ffffff;
}

.mps-notifications-panel-header h2 {
    margin: 0;

    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}


/* Pulsante chiusura */
.mps-notifications-panel-close {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: transparent;

    color: inherit;

    font-size: 26px;
    line-height: 1;

    cursor: pointer;
}


/* =========================================================
 * AREA SCROLL
 * ========================================================= */

/*
 * IMPORTANTE:
 * lo scroll è qui perché il nostro IntersectionObserver
 * usa .mps-notifications-panel-content come root.
 */
.mps-notifications-panel-content {
    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;
    overscroll-behavior: contain;

    -webkit-overflow-scrolling: touch;
}


/* =========================================================
 * RIGA NOTIFICA
 * ========================================================= */

.mps-notification-item {
    position: relative;

    display: block;

    padding: 10px 16px;

    border-bottom: 1px solid #eeeeee;

    background: #ffffff;

    color: inherit;
    text-decoration: none;

    transition:
        background-color 0.15s ease;
}


/*
 * Non letta:
 * leggero fondo rosso corallo chiarissimo,
 * senza appesantire la lista.
 */
.mps-notification-item.is-unread {
    background: #fff7f6;

    font-weight: 700;
}


/* Piccolo indicatore laterale */
.mps-notification-item.is-unread::before {
    content: "";

    position: absolute;

    left: 0;
    top: 10px;
    bottom: 10px;

    width: 3px;

    border-radius: 0 3px 3px 0;

    background: #ef5b5b;
}


/* Testo principale */
.mps-notification-item-text {
    font-size: 14px;
    line-height: 1.35;
}


/* Data relativa */
.mps-notification-item-date {
    margin-top: 3px;

    font-size: 11px;
    font-weight: 400;
    line-height: 1.2;

    opacity: 0.60;
}


/* =========================================================
 * STATO VUOTO
 * ========================================================= */

.mps-notifications-empty {
    padding: 28px 16px;

    text-align: center;

    font-size: 14px;

    opacity: 0.65;
}


/* =========================================================
 * CARICAMENTO PROGRESSIVO
 * ========================================================= */

.mps-notifications-loader {
    padding: 10px 16px 14px;

    text-align: center;

    font-size: 12px;

    opacity: 0.55;
}

.mps-notifications-loader[hidden] {
    display: none !important;
}


/*
 * Punto osservato dall'IntersectionObserver.
 */
.mps-notifications-sentinel {
    width: 100%;
    height: 1px;
}


/* =========================================================
 * BODY BLOCCATO CON PANNELLO APERTO
 * ========================================================= */

body.mps-notifications-panel-open {
    overflow: hidden;
}

/* =========================================================
 * BADGE CAMPANELLA HEADER
 * ========================================================= */

.mps-mobile-header-notifications {
    position: relative;
}

.mps-mobile-header-notifications-badge {
    position: absolute !important;

    top: -5px !important;
    right: -8px !important;

    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;

    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    height: 26px !important;

    padding-bottom: 2px !important;
    padding-right: 6px !important;

    background-image:
        var(--mps-notifications-badge-image) !important;
    background-position: center !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;

    color: #ffffff !important;

    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1 !important;

    white-space: nowrap !important;

    pointer-events: none;
}