/* =========================================================
   MC2 DELIVERY — checkout.css
   FASE 4 — PADRONIZAÇÃO VISUAL
   Cores, raios e sombras usam o Design System global.
========================================================= */

/* =========================================================
   MC2 DELIVERY
   CHECKOUT
========================================================= */


/* =========================================================
   PÁGINA
========================================================= */

.checkout-page {

    width: 100%;

    background: var(--mc2-bg, #F9FAFB);

    min-height: calc(100vh - 70px);

    padding: 35px 0 60px;

    box-sizing: border-box;

}


.checkout-container {

    width: 100%;

    max-width: 1200px;

    margin: 0 auto;

    padding: 0 24px;

    box-sizing: border-box;

}


/* =========================================================
   CABEÇALHO
========================================================= */

.checkout-header {

    margin-bottom: 28px;

}


.checkout-header h1 {

    margin: 0 0 7px;

    color: var(--mc2-text, #111827);

    font-size: 30px;

    line-height: 1.25;

    font-weight: 700;

}


.checkout-header p {

    margin: 0;

    color: var(--mc2-text-secondary, #6B7280);

    font-size: 15px;

    line-height: 1.5;

}


/* =========================================================
   LAYOUT
========================================================= */

.checkout-layout {

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        360px;

    align-items: start;

    gap: 24px;

}


.checkout-main {

    display: flex;

    flex-direction: column;

    gap: 18px;

}


/* =========================================================
   CARD
========================================================= */

.checkout-card {

    width: 100%;

    padding: 22px;

    background: var(--mc2-surface, #FFFFFF);

    border: 1px solid var(--mc2-border, #E5E7EB);

    border-radius: var(--mc2-radius-lg, 16px);

    box-sizing: border-box;

}


.checkout-card-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 20px;

}


.checkout-card h2 {

    margin: 0 0 18px;

    color: var(--mc2-text, #111827);

    font-size: 19px;

    line-height: 1.3;

    font-weight: 700;

}


.checkout-card-header h2 {

    margin: 0;

}


/* =========================================================
   LINK DO CARD
========================================================= */

.checkout-card-link {

    color: var(--mc2-primary, #EA1D2C);

    text-decoration: none;

    font-size: 14px;

    font-weight: 600;

    white-space: nowrap;

}


.checkout-card-link:hover {

    text-decoration: underline;

}


/* =========================================================
   LIMPAR PEDIDO
========================================================= */

.checkout-clear-button {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 36px;

    padding: 0 13px;

    border: 1px solid var(--mc2-border, #E5E7EB);

    border-radius: var(--mc2-radius-sm, 8px);

    background: var(--mc2-surface, #FFFFFF);

    color: var(--mc2-primary-hover, #D91827);

    font-family: inherit;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;

}


.checkout-clear-button:hover {

    background: var(--mc2-danger-soft, #FEF2F2);

    border-color: var(--mc2-danger-border, #FECACA);

}


/* =========================================================
   ITENS
========================================================= */

.checkout-items {

    display: flex;

    flex-direction: column;

}


.checkout-item {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    padding: 15px 0;

    border-bottom: 1px solid var(--mc2-border, #E5E7EB);

}


.checkout-item:first-child {

    padding-top: 0;

}


.checkout-item:last-child {

    padding-bottom: 0;

    border-bottom: 0;

}


.checkout-item-info {

    display: flex;

    align-items: center;

    gap: 10px;

    min-width: 0;

}


.checkout-item-info strong {

    color: var(--mc2-text, #111827);

    font-size: 15px;

    font-weight: 600;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

}


.checkout-item-info span {

    flex-shrink: 0;

    color: var(--mc2-text-secondary, #6B7280);

    font-size: 13px;

}


.checkout-item-price {

    flex-shrink: 0;

    color: var(--mc2-text, #111827);

    font-size: 14px;

    font-weight: 700;

}


/* =========================================================
   ENDEREÇOS
========================================================= */

.checkout-address-list {

    display: flex;

    flex-direction: column;

    gap: 10px;

}


.checkout-address-option {

    position: relative;

    display: flex;

    align-items: flex-start;

    gap: 12px;

    padding: 15px;

    border: 1px solid var(--mc2-border, #E5E7EB);

    border-radius: var(--mc2-radius-md, 12px);

    background: var(--mc2-surface, #FFFFFF);

    cursor: pointer;

    box-sizing: border-box;

    transition:
        border-color 0.2s ease,
        background 0.2s ease;

}


.checkout-address-option:hover {

    border-color: var(--mc2-border-strong, #D1D5DB);

    background: var(--mc2-surface, #FFFFFF);

}


.checkout-address-option input {

    position: absolute;

    opacity: 0;

    pointer-events: none;

}


.checkout-radio {

    width: 18px;

    height: 18px;

    flex: 0 0 18px;

    margin-top: 2px;

    border: 2px solid var(--mc2-border-strong, #D1D5DB);

    border-radius: 50%;

    box-sizing: border-box;

}


.checkout-address-option
input:checked
+ .checkout-radio {

    border: 5px solid var(--mc2-primary, #EA1D2C);

}


.checkout-address-option
input:checked
~ .checkout-address-content {

    color: var(--mc2-text, #111827);

}


.checkout-address-option:has(
    input:checked
) {

    border-color: var(--mc2-primary, #EA1D2C);

    background: var(--mc2-danger-soft, #FEF2F2);

}


.checkout-address-content {

    display: flex;

    flex-direction: column;

    gap: 4px;

    min-width: 0;

    color: var(--mc2-text-secondary, #6B7280);

    font-size: 13px;

    line-height: 1.4;

}


.checkout-address-content strong {

    color: var(--mc2-text, #111827);

    font-size: 14px;

    font-weight: 600;

}


/* =========================================================
   NOVO ENDEREÇO
========================================================= */

.checkout-new-address {

    display: inline-flex;

    margin-top: 15px;

    color: var(--mc2-primary, #EA1D2C);

    text-decoration: none;

    font-size: 14px;

    font-weight: 600;

}


.checkout-new-address:hover {

    text-decoration: underline;

}


/* =========================================================
   CAMPOS
========================================================= */

.checkout-help {

    margin: -8px 0 18px;

    color: var(--mc2-text-secondary, #6B7280);

    font-size: 13px;

    line-height: 1.4;

}


.checkout-field {

    display: flex;

    flex-direction: column;

    gap: 7px;

}


.checkout-field label {

    color: var(--mc2-text, #111827);

    font-size: 13px;

    font-weight: 600;

}


.checkout-field input {

    width: 100%;

    height: 44px;

    padding: 0 13px;

    border: 1px solid var(--mc2-border-strong, #D1D5DB);

    border-radius: var(--mc2-radius-sm, 8px);

    background: var(--mc2-surface, #FFFFFF);

    color: var(--mc2-text, #111827);

    font-family: inherit;

    font-size: 14px;

    outline: none;

    box-sizing: border-box;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;

}


.checkout-field input:focus {

    border-color: var(--mc2-primary, #EA1D2C);

    box-shadow:
        0 0 0 3px rgba(var(--mc2-primary-rgb), 0.08);

}


/* =========================================================
   CUPOM
========================================================= */

.checkout-coupon {

    display: flex;

    align-items: stretch;

    gap: 10px;

}


.checkout-coupon input {

    flex: 1;

    min-width: 0;

    height: 44px;

    padding: 0 13px;

    border: 1px solid var(--mc2-border-strong, #D1D5DB);

    border-radius: var(--mc2-radius-sm, 8px);

    background: var(--mc2-surface, #FFFFFF);

    color: var(--mc2-text, #111827);

    font-family: inherit;

    font-size: 14px;

    outline: none;

    box-sizing: border-box;

}


.checkout-coupon input:focus {

    border-color: var(--mc2-primary, #EA1D2C);

    box-shadow:
        0 0 0 3px rgba(var(--mc2-primary-rgb), 0.08);

}


.checkout-coupon-button {

    height: 44px;

    padding: 0 18px;

    border: 0;

    border-radius: var(--mc2-radius-sm, 8px);

    background: var(--mc2-primary, #EA1D2C);

    color: var(--mc2-surface, #FFFFFF);

    font-family: inherit;

    font-size: 14px;

    font-weight: 700;

    cursor: pointer;

    white-space: nowrap;

    transition:
        background 0.2s ease,
        transform 0.2s ease;

}


.checkout-coupon-button:hover {

    background: var(--mc2-primary-hover, #D91827);

}


.checkout-coupon-button:active {

    transform: scale(0.98);

}


.checkout-coupon-message {

    margin-top: 10px;

    font-size: 13px;

}


/* =========================================================
   PAGAMENTO
========================================================= */

.checkout-payment-list {

    display: grid;

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

    gap: 10px;

}


.checkout-payment-option {

    position: relative;

    display: flex;

    align-items: center;

    gap: 12px;

    min-height: 70px;

    padding: 13px;

    border: 1px solid var(--mc2-border, #E5E7EB);

    border-radius: var(--mc2-radius-md, 12px);

    background: var(--mc2-surface, #FFFFFF);

    cursor: pointer;

    box-sizing: border-box;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;

}


.checkout-payment-option:hover {

    border-color: var(--mc2-border-strong, #D1D5DB);

    background: var(--mc2-surface, #FFFFFF);

}


.checkout-payment-option:has(
    input:checked
) {

    border-color: var(--mc2-primary, #EA1D2C);

    background: var(--mc2-danger-soft, #FEF2F2);

    box-shadow:
        0 0 0 1px var(--mc2-primary, #EA1D2C);

}


.checkout-payment-option input {

    position: absolute;

    opacity: 0;

    pointer-events: none;

}


.checkout-payment-icon {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 38px;

    height: 38px;

    flex: 0 0 38px;

    border-radius: var(--mc2-radius-sm, 8px);

    background: var(--mc2-surface-soft, #F3F4F6);

    font-size: 20px;

}


.checkout-payment-content {

    display: flex;

    flex-direction: column;

    gap: 3px;

    min-width: 0;

}


.checkout-payment-content strong {

    color: var(--mc2-text, #111827);

    font-size: 14px;

    font-weight: 600;

}


.checkout-payment-content small {

    color: var(--mc2-text-secondary, #6B7280);

    font-size: 11px;

}


/* =========================================================
   RESUMO
========================================================= */

.checkout-summary {

    position: sticky;

    top: 20px;

    width: 100%;

    padding: 22px;

    background: var(--mc2-surface, #FFFFFF);

    border: 1px solid var(--mc2-border, #E5E7EB);

    border-radius: var(--mc2-radius-lg, 16px);

    box-sizing: border-box;

    box-shadow:
        var(--mc2-shadow-sm);

}


.checkout-summary h2 {

    margin: 0 0 22px;

    color: var(--mc2-text, #111827);

    font-size: 19px;

    font-weight: 700;

}


.checkout-summary-row {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 13px;

    color: var(--mc2-text-secondary, #6B7280);

    font-size: 14px;

}


.checkout-summary-row strong {

    color: var(--mc2-text, #111827);

    font-weight: 600;

}


.checkout-summary-divider {

    width: 100%;

    height: 1px;

    margin: 18px 0;

    background: var(--mc2-border, #E5E7EB);

}


.checkout-summary-total {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 20px;

}


.checkout-summary-total span {

    color: var(--mc2-text, #111827);

    font-size: 16px;

    font-weight: 600;

}


.checkout-summary-total strong {

    color: var(--mc2-primary, #EA1D2C);

    font-size: 22px;

    font-weight: 700;

}


/* =========================================================
   BOTÃO FINALIZAR
========================================================= */

.checkout-submit {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 100%;

    min-height: 48px;

    padding: 0 20px;

    border: 0;

    border-radius: var(--mc2-radius-md, 12px);

    background: var(--mc2-primary, #EA1D2C);

    color: var(--mc2-surface, #FFFFFF);

    font-family: inherit;

    font-size: 15px;

    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;

}


.checkout-submit:hover {

    background: var(--mc2-primary-hover, #D91827);

    box-shadow:
        0 5px 14px rgba(var(--mc2-primary-rgb), 0.2);

}


.checkout-submit:active {

    transform: translateY(1px);

}


/* =========================================================
   ESTADO VAZIO
========================================================= */

.checkout-empty {

    display: flex;

    flex-direction: column;

    align-items: flex-start;

    gap: 10px;

    padding: 20px;

    border-radius: var(--mc2-radius-md, 12px);

    background: var(--mc2-bg-alt, #FAFAFA);

    color: var(--mc2-text-secondary, #6B7280);

}


.checkout-empty p {

    margin: 0;

    font-size: 14px;

}


.checkout-empty a {

    color: var(--mc2-primary, #EA1D2C);

    text-decoration: none;

    font-size: 14px;

    font-weight: 600;

}


.checkout-empty a:hover {

    text-decoration: underline;

}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1000px) {

    .checkout-layout {

        grid-template-columns: 1fr;

    }


    .checkout-summary {

        position: static;

    }


}


/* =========================================================
   TABLET PEQUENO
========================================================= */

@media (max-width: 700px) {

    .checkout-page {

        padding: 25px 0 100px;

    }


    .checkout-container {

        padding: 0 16px;

    }


    .checkout-header {

        margin-bottom: 20px;

    }


    .checkout-header h1 {

        font-size: 25px;

    }


    .checkout-header p {

        font-size: 14px;

    }


    .checkout-main {

        gap: 14px;

    }


    .checkout-card {

        padding: 17px;

        border-radius: var(--mc2-radius-md, 12px);

    }


    .checkout-card h2 {

        font-size: 17px;

    }


    .checkout-card-header {

        align-items: flex-start;

    }


    .checkout-payment-list {

        grid-template-columns: 1fr;

    }


    .checkout-summary {

        padding: 18px;

        border-radius: var(--mc2-radius-md, 12px);

    }

}


/* =========================================================
   CELULAR
========================================================= */

@media (max-width: 480px) {

    .checkout-page {

        padding-top: 20px;

    }


    .checkout-container {

        padding-left: 12px;

        padding-right: 12px;

    }


    .checkout-header h1 {

        font-size: 23px;

    }


    .checkout-header p {

        font-size: 13px;

    }


    .checkout-card {

        padding: 15px;

    }


    .checkout-card-header {

        gap: 10px;

    }


    .checkout-card-header h2 {

        font-size: 16px;

    }


    .checkout-clear-button {

        min-height: 34px;

        padding: 0 10px;

        font-size: 12px;

    }


    .checkout-item {

        gap: 10px;

    }


    .checkout-item-info {

        gap: 7px;

    }


    .checkout-item-info strong {

        font-size: 14px;

    }


    .checkout-item-price {

        font-size: 13px;

    }


    .checkout-coupon {

        flex-direction: column;

    }


    .checkout-coupon-button {

        width: 100%;

    }


    .checkout-address-option {

        padding: 13px;

    }


    .checkout-payment-option {

        min-height: 64px;

        padding: 11px;

    }


    .checkout-payment-icon {

        width: 34px;

        height: 34px;

        flex-basis: 34px;

        font-size: 18px;

    }


    .checkout-summary-total strong {

        font-size: 20px;

    }
    

    .checkout-item-image {

    width: 58px;

    height: 58px;

    flex-basis: 58px;

    border-radius: var(--mc2-radius-sm, 8px);

    }


    .checkout-item-image-placeholder {

    font-size: 22px;

    }


    .checkout-item-info strong {

    font-size: 13px;

    }


    .checkout-item-quantity {

    font-size: 12px;

    }


    .checkout-item-unit-price {

    font-size: 11px;

    }


    .checkout-item-price {

    font-size: 12px;

    }


    .checkout-add-products-button {

    width: 100%;

    }
    
    .checkout-item-image {

        width: 54px;

        height: 54px;

        flex-basis: 54px;

        border-radius: var(--mc2-radius-sm, 8px);

    }

}

/* =========================================================
   IMAGEM DO PRODUTO
========================================================= */

.checkout-item-image {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 72px;

    height: 72px;

    flex: 0 0 72px;

    overflow: hidden;

    border-radius: var(--mc2-radius-md, 12px);

    background: var(--mc2-surface-soft, #F3F4F6);

}


.checkout-item-image img {

    display: block;

    width: 100%;

    height: 100%;

    object-fit: cover;

}


.checkout-item-image-placeholder {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 100%;

    height: 100%;

    background: var(--mc2-surface-soft, #F3F4F6);

    font-size: 27px;

}


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

.checkout-item-info {

    display: flex;

    flex: 1 1 auto;

    flex-direction: column;

    align-items: flex-start;

    justify-content: center;

    gap: 4px;

    min-width: 0;

}


.checkout-item-info strong {

    display: block;

    width: 100%;

    color: var(--mc2-text, #111827);

    font-size: 15px;

    line-height: 1.3;

    font-weight: 600;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

}


.checkout-item-quantity {

    color: var(--mc2-text-soft, #4B5563);

    font-size: 13px;

    font-weight: 600;

}


.checkout-item-unit-price {

    color: var(--mc2-text-muted, #9CA3AF);

    font-size: 12px;

}


/* =========================================================
   ADICIONAR MAIS PRODUTOS
========================================================= */

.checkout-add-products {

    margin-top: 18px;

    padding-top: 18px;

    border-top: 1px solid var(--mc2-border, #E5E7EB);

}


.checkout-add-products-button {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    min-height: 42px;

    padding: 0 16px;

    border: 1px solid var(--mc2-primary, #EA1D2C);

    border-radius: var(--mc2-radius-sm, 8px);

    background: var(--mc2-surface, #FFFFFF);

    color: var(--mc2-primary, #EA1D2C);

    text-decoration: none;

    font-size: 14px;

    font-weight: 700;

    box-sizing: border-box;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;

}


.checkout-add-products-button span {

    font-size: 19px;

    line-height: 1;

}


.checkout-add-products-button:hover {

    background: var(--mc2-primary, #EA1D2C);

    color: var(--mc2-surface, #FFFFFF);

}


/* =========================================================
   TÍTULO DO ENDEREÇO
========================================================= */

.checkout-address-title {

    color: var(--mc2-text, #111827) !important;

    font-size: 13px !important;

    font-weight: 700 !important;

}

/* =========================================================
   IMAGEM DO PRODUTO
========================================================= */

.checkout-item-image {

    width: 64px;

    height: 64px;

    flex: 0 0 64px;

    overflow: hidden;

    border-radius: var(--mc2-radius-md, 12px);

    background: var(--mc2-surface-soft, #F3F4F6);

}


.checkout-item-image img {

    display: block;

    width: 100%;

    height: 100%;

    object-fit: cover;

}


.checkout-item-image-placeholder {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 100%;

    height: 100%;

    font-size: 25px;

}