/*
=========================================================
MUSICALWORLD — MODAL DE COMPOSIÇÕES — BOTTOM SHEET

Arquivo:
css/index/aviso-composicoes.css

Responsabilidades:
- Exibir o aviso deslizando de baixo para cima.
- Adaptar o modal para celular, tablet e desktop.
- Respeitar a área segura dos dispositivos móveis.
- Estilizar o fundo, o conteúdo e os botões.
- Respeitar a preferência por movimento reduzido.

Identificador:
#mw-aviso-composicoes
=========================================================
*/

/* -------------------------------------------------------
   1. FUNDO DO MODAL
------------------------------------------------------- */

#mw-aviso-composicoes {
    position: fixed;

    inset: auto 0 0;

    box-sizing: border-box;

    width: 100%;
    max-width: 560px;

    max-height: min(85dvh, 640px);

    margin: 0 auto 0;

    padding:
        28px
        24px
        max(24px, env(safe-area-inset-bottom));

    overflow-x: hidden;
    overflow-y: auto;

    color: #172033;
    background: #ffffff;

    border: 1px solid rgba(23, 32, 51, 0.08);
    border-bottom: 0;

    border-radius: 24px 24px 0 0;

    box-shadow:
        0 -8px 40px rgba(23, 32, 51, 0.12);

    font-family: "Manrope", sans-serif;

    text-align: left;

    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    opacity: 0;
    transform: translateY(100%);

    transition:
        transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 260ms ease;

    /*
     * Permite animar a entrada quando o dialog
     * passa do estado fechado para o aberto.
     */
    transition-behavior: allow-discrete;
}

/* -------------------------------------------------------
   2. MODAL ABERTO
------------------------------------------------------- */

#mw-aviso-composicoes[open] {
    opacity: 1;
    transform: translateY(0);
}

/* Estado inicial usado na abertura animada. */

@starting-style {
    #mw-aviso-composicoes[open] {
        opacity: 0;
        transform: translateY(100%);
    }
}

/* -------------------------------------------------------
   3. FUNDO ESCURECIDO
------------------------------------------------------- */

#mw-aviso-composicoes::backdrop {
    background: rgba(15, 23, 42, 0.42);

    opacity: 0;

    transition:
        opacity 260ms ease,
        display 260ms allow-discrete,
        overlay 260ms allow-discrete;
}

#mw-aviso-composicoes[open]::backdrop {
    opacity: 1;
}

@starting-style {
    #mw-aviso-composicoes[open]::backdrop {
        opacity: 0;
    }
}

/* -------------------------------------------------------
   4. CONTEÚDO INTERNO
------------------------------------------------------- */

#mw-aviso-composicoes,
#mw-aviso-composicoes * {
    box-sizing: border-box;
}

#mw-aviso-composicoes h1,
#mw-aviso-composicoes h2,
#mw-aviso-composicoes h3 {
    margin: 0 0 12px;

    color: #172033;

    font-family: "Sora", "Manrope", sans-serif;

    font-size: 21px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.4px;
}

#mw-aviso-composicoes p {
    margin: 0 0 20px;

    color: #647084;

    font-size: 15px;
    font-weight: 400;
    line-height: 1.65;

    overflow-wrap: anywhere;
}

/* -------------------------------------------------------
   5. BOTÕES
------------------------------------------------------- */

#mw-aviso-composicoes button {
    min-height: 48px;

    padding: 12px 20px;

    border: 0;
    border-radius: 14px;

    background: #6d4aff;
    color: #ffffff;

    font-family: "Manrope", sans-serif;
    font-size: 15px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background-color 160ms ease,
        transform 160ms ease;

    -webkit-tap-highlight-color: transparent;
}

#mw-aviso-composicoes button:hover {
    background: #5b3ce0;
}

#mw-aviso-composicoes button:active {
    transform: scale(0.98);
}

#mw-aviso-composicoes button:focus-visible {
    outline: 3px solid rgba(109, 74, 255, 0.35);
    outline-offset: 3px;
}

/* -------------------------------------------------------
   CELULARES — MODAL COLADO NAS BORDAS DA TELA
------------------------------------------------------- */

@media (max-width: 600px) {
    #mw-aviso-composicoes {
        position: fixed;

        left: 0;
        right: 0;
        bottom: 0;

        width: 100%;
        max-width: none;

        margin: 0;

        max-height: 88dvh;

        padding-top: 30px;
        padding-right: 22px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
        padding-left: 22px;

        border-left: 0;
        border-right: 0;
        border-bottom: 0;

        border-radius: 24px 24px 0 0;

        transform: translateY(100%);
    }

    #mw-aviso-composicoes[open] {
        transform: translateY(0);
    }

    #mw-aviso-composicoes h1,
    #mw-aviso-composicoes h2,
    #mw-aviso-composicoes h3 {
        font-size: 20px;
    }

    #mw-aviso-composicoes p {
        font-size: 14px;
        line-height: 1.7;
    }

    #mw-aviso-composicoes button {
        width: 100%;
        min-height: 50px;
    }
}
/* -------------------------------------------------------
   7. TABLETS
------------------------------------------------------- */

@media (min-width: 601px) and (max-width: 1024px) {
    #mw-aviso-composicoes {
        width: calc(100% - 48px);
        max-width: 520px;

        max-height: 80dvh;

        padding: 32px 28px;
        padding-bottom: max(28px, env(safe-area-inset-bottom));

        border-radius: 24px 24px 0 0;
    }
}

/* -------------------------------------------------------
   8. TELAS GRANDES
------------------------------------------------------- */

@media (min-width: 1025px) {
    #mw-aviso-composicoes {
        max-width: 480px;

        padding: 32px;

        border-radius: 24px 24px 0 0;
    }
}

/* -------------------------------------------------------
   9. MOVIMENTO REDUZIDO
------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    #mw-aviso-composicoes,
    #mw-aviso-composicoes::backdrop,
    #mw-aviso-composicoes button {
        transition: none;
        animation: none;
    }
}
/* CORREÇÃO DEFINITIVA — BOTTOM SHEET NO MOBILE */
@media screen and (max-width: 600px) {
    dialog#mw-aviso-composicoes[open] {
        position: fixed !important;
        inset: auto 0 0 !important;

        width: 100% !important;
        max-width: none !important;

        margin: 0 !important;

        border-left: 0 !important;
        border-right: 0 !important;
        border-bottom: 0 !important;

        border-radius: 24px 24px 0 0 !important;
    }
}