/* =========================================================
   CHECKOUT PREMIUM - CARDAFOOD
   CSS separado e isolado para evitar conflito com app.css
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: #edf0f5;
    scroll-behavior: smooth;
}

body.checkout-premium-page {
    margin: 0 !important;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, .9), transparent 32%),
        #edf0f5 !important;
    color: #182033;
    font-family: Arial, Helvetica, sans-serif;
}

body.checkout-premium-page button,
body.checkout-premium-page input,
body.checkout-premium-page select,
body.checkout-premium-page textarea {
    font: inherit;
}

.checkout-form-premium {
    width: 100%;
    margin: 0;
}

.checkout-app-shell {
    width: min(100%, 760px);
    min-height: 100vh;
    margin: 0 auto;
    background: #5e5d5d;
    box-shadow: 0 0 40px rgba(21, 28, 40, .14);
    overflow: hidden;
}

.checkout-hero {
    position: relative;
    padding: 26px 20px 22px;
    overflow: hidden;
    background:
        radial-gradient(circle at 8% 0%, rgba(255, 255, 255, .14), transparent 25%),
        linear-gradient(135deg, var(--cor-principal), #24263b);
    color: #fff;
}

.checkout-hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -150px;
    top: -160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    pointer-events: none;
}

.checkout-topo-premium {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

#btnVoltarTopoCheckout {
    all: unset !important;
    box-sizing: border-box !important;
    width: 46px !important;
    height: 46px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid rgba(255, 255, 255, .35) !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, .08) !important;
    color: #fff !important;
    cursor: pointer !important;
    transition: .2s ease !important;
}

#btnVoltarTopoCheckout:hover {
    background: rgba(255, 255, 255, .16) !important;
}

#btnVoltarTopoCheckout svg {
    width: 24px !important;
    height: 24px !important;
    fill: currentColor !important;
}

.checkout-loja-identidade {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.checkout-logo-premium {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, .92);
    border-radius: 15px;
    background: #fff;
    color: var(--cor-principal);
    font-size: 20px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .14);
}

.checkout-logo-premium img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.checkout-loja-identidade small {
    display: block;
    margin-bottom: 3px;
    color: rgba(255, 255, 255, .76);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .55px;
    text-transform: uppercase;
}

.checkout-loja-identidade h1 {
    margin: 0;
    overflow: hidden;
    color: #fff;
    font-size: clamp(18px, 3.2vw, 24px);
    font-weight: 900;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkout-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.checkout-status.aberto {
    background: #ecfff1;
    color: #14803a;
}

.checkout-status.fechado {
    background: #fff0f0;
    color: #c33131;
}

.checkout-etapas {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto 1fr auto 1fr auto;
    align-items: start;
    gap: 12px;
    margin-top: 24px;
    padding: 15px 16px 11px;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 18px;
    background: rgba(16, 19, 34, .16);
    backdrop-filter: blur(8px);
}

.checkout-etapa {
    min-width: 58px;
    display: grid;
    justify-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, .62);
}

.checkout-etapa span {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    font-size: 12px;
    font-weight: 900;
}

.checkout-etapa small {
    font-size: 10px;
    font-weight: 800;
}

.checkout-etapa.ativa,
.checkout-etapa.concluida {
    color: #fff;
}

.checkout-etapa.ativa span {
    background: #fff;
    color: var(--cor-principal);
    border-color: #fff;
}

.checkout-etapa.concluida span {
    background: #ddffe6;
    color: #16843d;
    border-color: #ddffe6;
}

.checkout-etapas > i {
    height: 2px;
    margin-top: 15px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .34);
}

.checkout-conteudo-premium {
    display: grid;
    gap: 14px;
    padding: 14px 14px 24px;
}

.checkout-alerta-fechada {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid #ffd5d5;
    border-radius: 18px;
    background: #fff2f2;
    color: #a52525;
}

.checkout-alerta-icone {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #ffdede;
    font-weight: 900;
}

.checkout-alerta-fechada strong,
.checkout-alerta-fechada small {
    display: block;
}

.checkout-alerta-fechada strong {
    font-size: 13px;
}

.checkout-alerta-fechada small {
    margin-top: 3px;
    font-size: 11px;
}

.checkout-card-premium {
    padding: 18px;
    border: 1px solid rgba(226, 229, 236, .92);
    border-radius: 23px;
    background: #fff;
    box-shadow: 0 11px 24px rgba(26, 32, 44, .09);
}

.checkout-secao-titulo {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 17px;
    padding-bottom: 14px;
    border-bottom: 1px solid #edf0f4;
}

.checkout-secao-icone {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: color-mix(in srgb, var(--cor-principal) 12%, white);
    color: var(--cor-principal);
}

.checkout-secao-icone svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.checkout-secao-titulo h2,
.checkout-secao-titulo p {
    margin: 0;
}

.checkout-secao-titulo h2 {
    color: #152037;
    font-size: 15px;
    font-weight: 900;
}

.checkout-secao-titulo p {
    margin-top: 3px;
    color: #7c8598;
    font-size: 10px;
    line-height: 1.35;
}

.checkout-campos-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.checkout-campo {
    min-width: 0;
}

.checkout-campo-largo {
    grid-column: 1 / -1;
}

.checkout-campo-numero {
    grid-column: span 1;
}

.checkout-campo-complemento {
    grid-column: span 1;
}

.checkout-campo + .checkout-campo,
.checkout-box-entrega .checkout-campos-grid {
    margin-top: 14px;
}

.checkout-campo label {
    display: block;
    margin-bottom: 7px;
    color: #394257;
    font-size: 11px;
    font-weight: 800;
}

.checkout-input-box,
.checkout-select-box,
.checkout-textarea-box {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 51px;
    border: 1px solid #dfe4ec;
    border-radius: 15px;
    background: #fbfcfe;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.checkout-input-box:focus-within,
.checkout-select-box:focus-within,
.checkout-textarea-box:focus-within {
    border-color: var(--cor-principal);
    background: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cor-principal) 13%, transparent);
}

.checkout-input-box > svg {
    width: 19px;
    height: 19px;
    margin-left: 14px;
    flex: 0 0 19px;
    fill: #8a93a5;
}

.checkout-input-box input,
.checkout-select-box select,
.checkout-textarea-box textarea {
    width: 100%;
    min-width: 0;
    margin: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1e273a;
    font-size: 13px;
    font-weight: 600;
}

.checkout-input-box input {
    height: 49px;
    padding: 0 14px;
}

.checkout-input-box > svg + input {
    padding-left: 10px;
}

.checkout-select-box select {
    height: 49px;
    padding: 0 42px 0 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.checkout-select-box::after {
    content: "";
    position: absolute;
    right: 16px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #6f788b;
    border-bottom: 2px solid #6f788b;
    transform: rotate(45deg) translateY(-3px);
    pointer-events: none;
}

.checkout-textarea-box {
    align-items: stretch;
    min-height: 112px;
}

.checkout-textarea-box textarea {
    min-height: 110px;
    padding: 14px;
    resize: vertical;
    line-height: 1.45;
}

.checkout-input-box input::placeholder,
.checkout-textarea-box textarea::placeholder {
    color: #a3abba;
    font-weight: 500;
}

.checkout-tipos-pedido {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.checkout-tipo-card {
    display: block;
    cursor: pointer;
}

.checkout-tipo-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkout-tipo-conteudo {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border: 1px solid #dfe4ec;
    border-radius: 17px;
    background: #fbfcfe;
    transition: .2s ease;
}

.checkout-tipo-card input:checked + .checkout-tipo-conteudo {
    border-color: var(--cor-principal);
    background: color-mix(in srgb, var(--cor-principal) 7%, white);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cor-principal) 10%, transparent);
}

.checkout-tipo-icone {
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #eef1f5;
    color: #596276;
}

.checkout-tipo-card input:checked + .checkout-tipo-conteudo .checkout-tipo-icone {
    background: var(--cor-principal);
    color: #fff;
}

.checkout-tipo-icone svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.checkout-tipo-conteudo strong,
.checkout-tipo-conteudo small {
    display: block;
}

.checkout-tipo-conteudo strong {
    color: #1c2639;
    font-size: 12px;
    font-weight: 900;
}

.checkout-tipo-conteudo small {
    margin-top: 3px;
    color: #8790a2;
    font-size: 9px;
    line-height: 1.3;
}

.checkout-box-entrega {
    margin-top: 17px;
    padding-top: 17px;
    border-top: 1px dashed #dfe3eb;
}

.checkout-box-troco {
    margin-top: 14px;
}

.checkout-input-dinheiro > span {
    margin-left: 14px;
    color: #596276;
    font-size: 12px;
    font-weight: 900;
}

.checkout-input-dinheiro input {
    padding-left: 8px;
}

.checkout-resumo-itens {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.checkout-resumo-itens:empty {
    display: none;
}

.checkout-resumo-itens > * {
    padding: 9px 0;
    border-bottom: 1px dashed #e6e9ef;
}

.checkout-linha-resumo,
.checkout-linha-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.checkout-linha-resumo {
    min-height: 51px;
    border-top: 1px solid #edf0f4;
    color: #50596c;
    font-size: 11px;
}

.checkout-linha-resumo strong {
    color: #162038;
    font-size: 12px;
    font-weight: 900;
}

.checkout-linha-total {
    min-height: 70px;
    margin-top: 3px;
    padding: 11px 13px;
    border: 1px dashed color-mix(in srgb, var(--cor-principal) 18%, #dfe3ea);
    border-radius: 17px;
    background: color-mix(in srgb, var(--cor-principal) 7%, white);
}

.checkout-linha-total span small,
.checkout-linha-total span b {
    display: block;
}

.checkout-linha-total span small {
    color: #344057;
    font-size: 11px;
    font-weight: 900;
}

.checkout-linha-total span b {
    margin-top: 3px;
    color: #848da0;
    font-size: 9px;
    font-weight: 600;
}

.checkout-linha-total > strong {
    color: var(--cor-principal);
    font-size: 21px;
    font-weight: 900;
    white-space: nowrap;
}

.checkout-seguranca {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 16px;
    border: 1px solid #d5f2df;
    border-radius: 18px;
    background: #effdf4;
    color: #16723b;
}

.checkout-seguranca > span {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #d8f7e4;
}

.checkout-seguranca svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.checkout-seguranca strong,
.checkout-seguranca small {
    display: block;
}

.checkout-seguranca strong {
    font-size: 12px;
    font-weight: 900;
}

.checkout-seguranca small {
    margin-top: 3px;
    color: #4c8261;
    font-size: 9px;
    line-height: 1.35;
}

.checkout-footer-premium {
    position: sticky;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(120px, .75fr) minmax(180px, 1.6fr);
    gap: 12px;
    padding: 13px 14px calc(13px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(218, 222, 230, .92);
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(12px);
    box-shadow: 0 -10px 28px rgba(20, 27, 39, .09);
}

#btnVoltarCarrinho {
    all: unset !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 58px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 0 15px !important;
    border: 1px solid #dfe3ea !important;
    border-radius: 17px !important;
    background: #fff !important;
    color: #303849 !important;
    box-shadow: 0 5px 14px rgba(28, 34, 46, .07) !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    cursor: pointer !important;
}

#btnVoltarCarrinho svg {
    width: 20px !important;
    height: 20px !important;
    flex: 0 0 20px !important;
    fill: currentColor !important;
}

#btnVoltarCarrinho:hover {
    background: #f6f7fa !important;
    color: var(--cor-principal) !important;
}

.checkout-btn-enviar {
    all: unset !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 58px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 9px !important;
    padding: 0 18px !important;
    border-radius: 17px !important;
    background: linear-gradient(100deg, var(--cor-botao), var(--cor-principal)) !important;
    color: #fff !important;
    box-shadow: 0 11px 22px color-mix(in srgb, var(--cor-botao) 24%, transparent) !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: transform .2s ease, filter .2s ease !important;
}

.checkout-btn-enviar svg {
    width: 20px !important;
    height: 20px !important;
    flex: 0 0 20px !important;
    fill: currentColor !important;
}

.checkout-btn-enviar:hover:not(:disabled) {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.checkout-btn-enviar:active:not(:disabled) {
    transform: scale(.985);
}

.checkout-btn-enviar:disabled {
    background: #aeb4bf !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    opacity: .72;
}

@media (max-width: 620px) {
    .checkout-app-shell {
        width: 100%;
        box-shadow: none;
    }

    .checkout-hero {
        padding: 20px 13px 18px;
    }

    .checkout-conteudo-premium {
        padding: 12px 10px 20px;
    }

    .checkout-card-premium {
        padding: 15px;
        border-radius: 20px;
    }

    .checkout-topo-premium {
        grid-template-columns: 43px minmax(0, 1fr) auto;
        gap: 9px;
    }

    #btnVoltarTopoCheckout {
        width: 42px !important;
        height: 42px !important;
        border-radius: 13px !important;
    }

    .checkout-logo-premium {
        width: 43px;
        height: 43px;
        flex-basis: 43px;
        border-radius: 13px;
    }

    .checkout-loja-identidade h1 {
        font-size: 17px;
    }

    .checkout-status {
        min-height: 27px;
        padding: 0 9px;
        font-size: 9px;
    }

    .checkout-etapas {
        gap: 7px;
        padding-inline: 9px;
    }

    .checkout-etapa {
        min-width: 48px;
    }

    .checkout-etapa small {
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .checkout-campos-grid {
        grid-template-columns: 1fr;
    }

    .checkout-campo-numero,
    .checkout-campo-complemento {
        grid-column: 1 / -1;
    }

    .checkout-tipos-pedido {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .checkout-tipo-conteudo {
        min-height: 72px;
        padding: 10px;
        gap: 8px;
    }

    .checkout-tipo-icone {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .checkout-footer-premium {
        grid-template-columns: minmax(105px, .72fr) minmax(165px, 1.45fr);
        gap: 9px;
        padding-inline: 10px;
    }

    #btnVoltarCarrinho,
    .checkout-btn-enviar {
        height: 54px !important;
        font-size: 12px !important;
    }

    #btnVoltarCarrinho {
        padding: 0 10px !important;
    }

    .checkout-btn-enviar {
        padding: 0 12px !important;
    }
}

@media (max-width: 360px) {
    .checkout-loja-identidade small {
        display: none;
    }

    .checkout-loja-identidade h1 {
        font-size: 14px;
    }

    .checkout-status {
        padding-inline: 7px;
        font-size: 8px;
    }

    .checkout-etapas {
        grid-template-columns: auto 1fr auto 1fr auto;
        gap: 4px;
    }

    .checkout-etapa {
        min-width: 43px;
    }

    .checkout-etapa small {
        font-size: 7px;
    }

    .checkout-tipos-pedido {
        grid-template-columns: 1fr;
    }

    .checkout-footer-premium {
        grid-template-columns: 1fr 1.55fr;
    }

    #btnVoltarCarrinho,
    .checkout-btn-enviar {
        font-size: 11px !important;
    }
}
