/* ===================================================================
   MODAL PADRÃO RENTMTM  (SP20-026 / SP20-036 / SP20-042)
   -------------------------------------------------------------------
   Componente único de mensagem/confirmação. Substitui os alert() e
   confirm() nativos do navegador, que apareciam com o domínio cru
   ("rentmtm.shop diz — Clear entire cart?") e não seguiam o visual da
   plataforma.

   A linguagem visual reaproveita a do .custom-modal-content já usada na
   tela registerDetailsAndId (mesmo gradiente, raio e sombra), mas aqui
   fica num arquivo próprio para poder ser carregada em TODAS as telas.
   =================================================================== */

.mtm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.mtm-modal-overlay.is-open {
    display: flex;
    animation: mtmModalFadeIn 0.2s ease-in-out;
}

@keyframes mtmModalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.mtm-modal {
    background: linear-gradient(180deg, #ffffff, #f0f0f0, #d4d4d4);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    padding: 24px;
    width: 100%;
    max-width: 460px;
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: mtmModalPop 0.2s ease-in-out;
}

@keyframes mtmModalPop {
    from { transform: scale(0.96); }
    to   { transform: scale(1); }
}

.mtm-modal__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #0b2a5b;
    text-align: center;
}

.mtm-modal__message {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    text-align: center;
}

.mtm-modal__actions {
    margin-top: 8px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.mtm-modal__btn {
    flex: 1 1 130px;
    min-height: 44px; /* alvo de toque acessível */
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.mtm-modal__btn--confirm {
    background-color: #0d6efd;
    color: #fff;
}

.mtm-modal__btn--confirm:hover {
    background-color: #0b5ed7;
}

.mtm-modal__btn--cancel {
    background-color: #e0e0e0;
    color: #333;
}

.mtm-modal__btn--cancel:hover {
    background-color: #d0d0d0;
}

.mtm-modal__btn--danger {
    background-color: #dc3545;
    color: #fff;
}

.mtm-modal__btn--danger:hover {
    background-color: #bb2d3b;
}

/* Bloqueia o scroll do fundo enquanto a modal está aberta */
body.mtm-modal-open {
    overflow: hidden;
}

@media (max-width: 480px) {
    .mtm-modal {
        padding: 20px 16px;
    }

    .mtm-modal__actions {
        flex-direction: column-reverse; /* ação primária fica embaixo, ao alcance do polegar */
    }

    .mtm-modal__btn {
        flex: 1 1 auto;
        width: 100%;
    }
}

/* ===================================================================
   SELETOR DE DATA (mtm-datepicker.js)
   -------------------------------------------------------------------
   Reaproveita a moldura, o fundo escurecido e os botões desta mesma
   folha — o que muda é só o miolo (grade do mês). Assim a escolha de
   data se parece com as demais confirmações da plataforma, em vez de
   herdar o calendário nativo, que muda de forma a cada navegador.
   =================================================================== */

.mtm-datepicker {
    width: min(340px, 100%);
}

.mtm-datepicker__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 4px 0 10px;
}

.mtm-datepicker__month {
    font-weight: 700;
    font-size: 15px;
}

.mtm-datepicker__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #d7dce5;
    background: #fff;
    color: #003b8f;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.mtm-datepicker__nav:hover:not(:disabled) {
    background: #0B93F2;
    border-color: #0B93F2;
    color: #fff;
}

.mtm-datepicker__nav:disabled {
    opacity: .35;
    cursor: default;
}

/* Sete colunas fixas: a grade precisa alinhar com os rótulos dos dias,
   e `auto-fit` deslocaria tudo num mês que começa no sábado. */
.mtm-datepicker__weekdays,
.mtm-datepicker__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.mtm-datepicker__weekdays {
    margin-bottom: 4px;
}

.mtm-datepicker__weekdays span {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #7a869a;
}

.mtm-datepicker__day {
    /* 38px: alvo de toque confortável sem estourar 340px em sete colunas */
    height: 38px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #222;
    font-size: 14px;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.mtm-datepicker__day:hover:not(:disabled):not(.is-empty) {
    background: #e8f2fe;
}

/* As casas antes do dia 1 são espaçadores: não recebem clique nem foco. */
.mtm-datepicker__day.is-empty {
    pointer-events: none;
}

.mtm-datepicker__day:disabled {
    opacity: .3;
    cursor: default;
}

/* Hoje é uma referência, não uma seleção — por isso contorno, não preenchimento. */
.mtm-datepicker__day.is-today {
    box-shadow: inset 0 0 0 1px #0B93F2;
    font-weight: 700;
}

.mtm-datepicker__day.is-selected {
    background: #0B93F2;
    color: #fff;
    font-weight: 700;
}

/* Trava a rolagem do fundo enquanto a modal está aberta. */
body.mtm-datepicker-open {
    overflow: hidden;
}
