/* =========================================================
          AÇÕES DA CONFIRMAÇÃO DO PEDIDO
========================================================= */

.pedido-finalizado .modal-footer {
    display: block;

    width: 100%;

    padding: 20px 24px 24px;
}

.confirmacao-pedido-acoes {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;

    width: 100%;
}

.confirmacao-pedido-acoes .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    width: 100%;
    min-height: 48px;

    margin: 0;
    padding: 10px 16px;

    border-radius: 13px;

    font-size: 0.78rem;
    font-weight: 600;

    text-decoration: none;

    transition:
        color 0.22s ease,
        background 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        transform 0.22s ease;
}

.btn-voltar-produtos-confirmacao {
    color: #d75a85;
    background: #ffffff;

    border: 1px solid #e86d95;
}

.btn-voltar-produtos-confirmacao:hover {
    color: #c84f7a;
    background: #fff2f6;

    border-color: #d75a85;

    transform: translateY(-2px);
}

.btn-acompanhar-pedido {
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            #e76591,
            #d95180
        );

    border: 1px solid #d95180;

    box-shadow:
        0 10px 22px rgba(217, 81, 128, 0.22);
}

.btn-acompanhar-pedido:hover {
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            #df5f8a,
            #c94875
        );

    border-color: #c94875;

    box-shadow:
        0 13px 27px rgba(217, 81, 128, 0.28);

    transform: translateY(-2px);
}

/* =========================================================
          MODAL DE ACOMPANHAMENTO
========================================================= */

#modalAcompanharPedido .modal-dialog {
    max-width: 760px;
}

.modal-acompanhamento-pedido {
    overflow: hidden;

    background: #fffdfd;

    border: 1px solid #efdee4;
    border-radius: 23px;

    box-shadow:
        0 28px 75px rgba(76, 43, 52, 0.2);
}

/* =========================================================
          CABEÇALHO DO ACOMPANHAMENTO
========================================================= */

.acompanhamento-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    padding: 23px 26px;

    background:
        linear-gradient(
            135deg,
            #fffdfd 0%,
            #fff4f8 100%
        );

    border-bottom: 1px solid #efdee4;
}

.acompanhamento-modal-header > div {
    min-width: 0;
}

.acompanhamento-modal-badge {
    display: inline-flex;
    align-items: center;

    margin-bottom: 7px;
    padding: 6px 11px;

    color: #de6b97;
    background: #fdebf2;

    border-radius: 999px;

    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.acompanhamento-modal-header h2 {
    margin: 0;

    color: #5b3434;

    font-family: "Playfair Display", serif;
    font-size: 1.55rem;
    font-weight: 700;
}

.acompanhamento-modal-header p {
    margin: 5px 0 0;

    color: #8f7d82;

    font-size: 0.74rem;
    font-weight: 500;
}

/* =========================================================
          CORPO DO ACOMPANHAMENTO
========================================================= */

.acompanhamento-modal-body {
    display: flex;
    flex-direction: column;

    gap: 17px;

    max-height: 72vh;

    padding: 22px 24px;

    overflow-y: auto;
}

/* =========================================================
          STATUS PRINCIPAL
========================================================= */

.acompanhamento-status-card {
    display: flex;
    align-items: center;

    gap: 15px;

    padding: 18px;

    background:
        linear-gradient(
            135deg,
            #fff8fa,
            #ffffff
        );

    border: 1px solid #efdee4;
    border-radius: 18px;
}

.acompanhamento-status-icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 54px;

    width: 54px;
    height: 54px;

    color: #de6b97;
    background: #fdebf2;

    border-radius: 16px;

    font-size: 1.25rem;
}

.acompanhamento-status-conteudo {
    min-width: 0;
}

.acompanhamento-status-badge {
    display: block;

    margin-bottom: 4px;

    color: #de6b97;

    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
}

.acompanhamento-status-conteudo h3 {
    margin: 0 0 4px;

    color: #5b3434;

    font-family: "Playfair Display", serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.acompanhamento-status-conteudo p {
    margin: 0;

    color: #847277;

    font-size: 0.73rem;
    line-height: 1.55;
}

/* Cores conforme o status */

.acompanhamento-status-card.status-aceito
.acompanhamento-status-icone,
.acompanhamento-status-card.status-concluido
.acompanhamento-status-icone {
    color: #ffffff;
    background: #48a96b;
}

.acompanhamento-status-card.status-producao
.acompanhamento-status-icone {
    color: #ffffff;
    background: #e59a16;
}

.acompanhamento-status-card.status-pronto
.acompanhamento-status-icone {
    color: #ffffff;
    background: #58a746;
}

.acompanhamento-status-card.status-entrega
.acompanhamento-status-icone {
    color: #ffffff;
    background: #4d88d9;
}

.acompanhamento-status-card.status-encerrado {
    background: #fff7f8;

    border-color: #efcbd0;
}

.acompanhamento-status-card.status-encerrado
.acompanhamento-status-icone {
    color: #ffffff;
    background: #cb5963;
}

/* =========================================================
          INFORMAÇÕES DO PEDIDO
========================================================= */

.acompanhamento-informacoes {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 11px;
}

.acompanhamento-informacoes article {
    min-width: 0;

    padding: 14px 15px;

    background: #fff8fa;

    border: 1px solid #efdee4;
    border-radius: 14px;
}

.acompanhamento-informacoes span {
    display: flex;
    align-items: center;

    gap: 6px;

    margin-bottom: 5px;

    color: #9a858b;

    font-size: 0.63rem;
    font-weight: 600;
}

.acompanhamento-informacoes span i {
    color: #de6b97;
}

.acompanhamento-informacoes strong {
    display: block;

    overflow: hidden;

    color: #5b3434;

    font-size: 0.75rem;
    font-weight: 700;

    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =========================================================
          LINHA DO TEMPO
========================================================= */

.acompanhamento-linha-tempo {
    padding: 17px;

    background: #ffffff;

    border: 1px solid #eee1e5;
    border-radius: 18px;
}

.acompanhamento-secao-titulo {
    display: flex;
    align-items: center;

    gap: 11px;

    margin-bottom: 18px;
}

.acompanhamento-secao-titulo > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 40px;

    width: 40px;
    height: 40px;

    color: #de6b97;
    background: #fff0f5;

    border-radius: 12px;
}

.acompanhamento-secao-titulo h3 {
    margin: 0 0 2px;

    color: #5b3434;

    font-size: 0.86rem;
    font-weight: 700;
}

.acompanhamento-secao-titulo p {
    margin: 0;

    color: #99878c;

    font-size: 0.66rem;
}

.acompanhamento-etapas {
    display: flex;
    flex-direction: column;
}

.acompanhamento-etapa {
    position: relative;

    display: flex;
    align-items: flex-start;

    gap: 12px;

    min-height: 69px;

    padding-bottom: 14px;
}

.acompanhamento-etapa:last-child {
    min-height: auto;
    padding-bottom: 0;
}

.acompanhamento-etapa:not(:last-child)::after {
    position: absolute;
    top: 35px;
    left: 16px;

    width: 2px;
    height: calc(100% - 27px);

    content: "";

    background: #eadde1;
}

.acompanhamento-etapa-marcador {
    position: relative;
    z-index: 2;

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

    flex: 0 0 34px;

    width: 34px;
    height: 34px;

    color: #a89399;
    background: #f5eff1;

    border: 2px solid #ffffff;
    border-radius: 50%;

    box-shadow:
        0 0 0 1px #eadde1;

    font-size: 0.76rem;
}

.acompanhamento-etapa-conteudo {
    min-width: 0;

    padding-top: 2px;
}

.acompanhamento-etapa-conteudo strong {
    display: block;

    margin-bottom: 3px;

    color: #77666b;

    font-size: 0.74rem;
    font-weight: 700;
}

.acompanhamento-etapa-conteudo small {
    display: block;

    color: #9f8e93;

    font-size: 0.64rem;
    line-height: 1.45;
}

/* Etapa concluída */

.acompanhamento-etapa.etapa-concluida
.acompanhamento-etapa-marcador {
    color: #ffffff;
    background: #49a86a;

    box-shadow:
        0 0 0 1px #49a86a;
}

.acompanhamento-etapa.etapa-concluida
.acompanhamento-etapa-conteudo strong {
    color: #487057;
}

.acompanhamento-etapa.etapa-concluida:not(:last-child)::after {
    background: #a8d7b8;
}

/* Etapa atual */

.acompanhamento-etapa.etapa-atual
.acompanhamento-etapa-marcador {
    color: #ffffff;
    background: #de6b97;

    box-shadow:
        0 0 0 5px rgba(222, 107, 151, 0.12);
}

.acompanhamento-etapa.etapa-atual
.acompanhamento-etapa-conteudo strong {
    color: #5b3434;
}

.acompanhamento-etapa.etapa-atual
.acompanhamento-etapa-conteudo small {
    color: #846f76;
}

/* =========================================================
          PEDIDO ENCERRADO
========================================================= */

.acompanhamento-aviso-encerrado {
    display: flex;
    align-items: flex-start;

    gap: 11px;

    padding: 14px 15px;

    color: #994852;
    background: #fff1f3;

    border: 1px solid #efcbd0;
    border-radius: 14px;
}

.acompanhamento-aviso-encerrado[hidden] {
    display: none;
}

.acompanhamento-aviso-encerrado > i {
    flex: 0 0 auto;

    margin-top: 2px;

    color: #cb5963;
}

.acompanhamento-aviso-encerrado strong {
    display: block;

    margin-bottom: 3px;

    font-size: 0.73rem;
}

.acompanhamento-aviso-encerrado p {
    margin: 0;

    font-size: 0.66rem;
    line-height: 1.5;
}

.acompanhamento-aviso-atualizacao {
    display: flex;
    align-items: flex-start;

    gap: 7px;

    margin: 0;

    color: #928187;

    font-size: 0.65rem;
    line-height: 1.5;
}

.acompanhamento-aviso-atualizacao i {
    flex: 0 0 auto;

    margin-top: 2px;

    color: #de6b97;
}

/* =========================================================
          RODAPÉ DO ACOMPANHAMENTO
========================================================= */

.acompanhamento-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 10px;

    padding: 16px 24px;

    background: #fff8fa;

    border-top: 1px solid #efdee4;
}

.acompanhamento-modal-footer .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-height: 44px;

    padding: 8px 18px;

    border-radius: 12px;

    font-size: 0.73rem;
    font-weight: 600;
}

/* =========================================================
          RESPONSIVIDADE
========================================================= */

@media (max-width: 575.98px) {
    .confirmacao-pedido-acoes {
        grid-template-columns: 1fr;
    }

    .acompanhamento-modal-header {
        padding: 20px 18px;
    }

    .acompanhamento-modal-body {
        padding: 18px;
    }

    .acompanhamento-status-card {
        align-items: flex-start;

        padding: 15px;
    }

    .acompanhamento-status-icone {
        flex-basis: 47px;

        width: 47px;
        height: 47px;
    }

    .acompanhamento-informacoes {
        grid-template-columns: 1fr;
    }

    .acompanhamento-modal-footer {
        display: grid;

        grid-template-columns: 1fr;

        padding: 14px 18px;
    }

    .acompanhamento-modal-footer .btn {
        width: 100%;
    }
}

/* =========================================================
          ERRO NA CONSULTA DO ACOMPANHAMENTO
========================================================= */

.acompanhamento-erro-consulta {
    display: flex;
    align-items: flex-start;

    gap: 11px;

    padding: 14px 15px;

    color: #885d30;
    background: #fff8ed;

    border: 1px solid #efd9b6;
    border-radius: 14px;
}

.acompanhamento-erro-consulta[hidden] {
    display: none;
}

.acompanhamento-erro-consulta > i {
    flex: 0 0 auto;

    margin-top: 2px;

    color: #d88613;

    font-size: 0.95rem;
}

.acompanhamento-erro-consulta strong {
    display: block;

    margin-bottom: 3px;

    color: #744b21;

    font-size: 0.73rem;
    font-weight: 700;
}

.acompanhamento-erro-consulta p {
    margin: 0;

    color: #8b704f;

    font-size: 0.66rem;
    line-height: 1.5;
}

/* =========================================================
          BOTÃO ATUALIZAR ACOMPANHAMENTO
========================================================= */

.btn-atualizar-acompanhamento {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-height: 44px;

    padding: 8px 17px;

    color: #d75a85;
    background: #fff1f5;

    border: 1px solid #efcbd7;
    border-radius: 12px;

    font-size: 0.72rem;
    font-weight: 700;

    transition:
        color 0.22s ease,
        background 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        transform 0.22s ease;
}

.btn-atualizar-acompanhamento:hover {
    color: #ffffff;
    background: #de6b97;

    border-color: #de6b97;

    transform: translateY(-2px);

    box-shadow:
        0 8px 18px rgba(222, 107, 151, 0.2);
}

.btn-atualizar-acompanhamento:disabled {
    color: #9d8c92;
    background: #f2edef;

    border-color: #e4dadd;

    box-shadow: none;

    cursor: wait;

    transform: none;
}

.btn-atualizar-acompanhamento
.spinner-border {
    width: 14px;
    height: 14px;

    border-width: 2px;
}

/* =========================================================
          RESPONSIVIDADE DO RODAPÉ
========================================================= */

@media (max-width: 575.98px) {
    .acompanhamento-modal-footer {
        grid-template-columns: 1fr;
    }

    .btn-atualizar-acompanhamento {
        width: 100%;
    }
}

/* =========================================================
      ANIMAÇÃO DO ÍCONE QUANDO O PEDIDO FOR ENTREGUE
========================================================= */

@keyframes pulsarIconePedidoEntregue {
    0% {
        transform: scale(1);

        box-shadow:
            0 0 0 0 rgba(72, 169, 107, 0.38);
    }

    50% {
        transform: scale(1.12);

        box-shadow:
            0 0 0 13px rgba(72, 169, 107, 0);
    }

    100% {
        transform: scale(1);

        box-shadow:
            0 0 0 0 rgba(72, 169, 107, 0);
    }
}

@keyframes pulsarCasaPedidoEntregue {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.13);
    }

    100% {
        transform: scale(1);
    }
}

/*
 * O checkout adiciona "status-concluido"
 * automaticamente quando o status é entregue.
 */

.acompanhamento-status-card.status-concluido
.acompanhamento-status-icone {
    transform-origin: center;

    animation:
        pulsarIconePedidoEntregue
        1.55s
        ease-in-out
        infinite;

    will-change:
        transform,
        box-shadow;
}

.acompanhamento-status-card.status-concluido
.acompanhamento-status-icone i {
    display: inline-block;

    transform-origin: center;

    animation:
        pulsarCasaPedidoEntregue
        1.55s
        ease-in-out
        infinite;

    will-change: transform;
}

/* Respeita usuários que desativam animações */

@media (prefers-reduced-motion: reduce) {
    .acompanhamento-status-card.status-concluido
    .acompanhamento-status-icone,

    .acompanhamento-status-card.status-concluido
    .acompanhamento-status-icone i {
        animation: none;
    }
}

/* =========================================================
   PULSO NA ÚLTIMA ETAPA — PEDIDO ENTREGUE
========================================================= */

@keyframes pulsarMarcadorPedidoEntregue {
    0% {
        transform: scale(1);

        box-shadow:
            0 0 0 5px rgba(222, 107, 151, 0.12),
            0 0 0 0 rgba(222, 107, 151, 0.38);
    }

    50% {
        transform: scale(1.12);

        box-shadow:
            0 0 0 5px rgba(222, 107, 151, 0.12),
            0 0 0 12px rgba(222, 107, 151, 0);
    }

    100% {
        transform: scale(1);

        box-shadow:
            0 0 0 5px rgba(222, 107, 151, 0.12),
            0 0 0 0 rgba(222, 107, 151, 0);
    }
}

/*
 * A última etapa só fica como "etapa-atual"
 * quando o pedido está entregue ou retirado.
 */

.acompanhamento-etapa.etapa-atual:last-child
.acompanhamento-etapa-marcador {
    transform-origin: center;

    animation:
        pulsarMarcadorPedidoEntregue
        1.55s
        ease-in-out
        infinite;

    will-change:
        transform,
        box-shadow;
}

.acompanhamento-etapa.etapa-atual:last-child
.acompanhamento-etapa-marcador i {
    display: inline-block;

    transform-origin: center;

    animation:
        pulsarCasaPedidoEntregue
        1.55s
        ease-in-out
        infinite;

    will-change: transform;
}

/* Acessibilidade */

@media (prefers-reduced-motion: reduce) {
    .acompanhamento-etapa.etapa-atual:last-child
    .acompanhamento-etapa-marcador,

    .acompanhamento-etapa.etapa-atual:last-child
    .acompanhamento-etapa-marcador i {
        animation: none;
    }
}