/* =========================================
   CARRINHO
========================================= */

.cart-page {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 70px 24px 90px;
}


/* =========================================
   CABEÇALHO
========================================= */

.cart-header {
    margin-bottom: 42px;
}

.cart-header span {
    display: block;

    margin-bottom: 8px;

    font-size: 13px;
    font-weight: 700;

    color: #777;

    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.cart-header h1 {
    margin: 0;

    font-size: 42px;
    line-height: 1.1;
    font-weight: 700;

    color: #111;
}


/* =========================================
   CARRINHO VAZIO
========================================= */

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 360px;

    padding: 60px 30px;

    text-align: center;

    background: #fafafa;

    border: 1px solid #e8e8e8;
    border-radius: 18px;
}

.cart-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 72px;
    height: 72px;

    margin-bottom: 22px;

    font-size: 32px;

    background: #fff;

    border: 1px solid #e5e5e5;
    border-radius: 50%;
}

.cart-empty h2 {
    margin: 0 0 10px;

    font-size: 24px;
    font-weight: 700;

    color: #111;
}

.cart-empty p {
    max-width: 420px;

    margin: 0 0 28px;

    font-size: 15px;
    line-height: 1.6;

    color: #777;
}


/* =========================================
   BOTÃO CONTINUAR COMPRANDO
========================================= */

.cart-continue-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 46px;

    padding: 0 24px;

    background: #111;
    color: #fff;

    border-radius: 9px;

    font-size: 14px;
    font-weight: 600;

    text-decoration: none;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.cart-continue-button:hover {
    background: #2a2a2a;

    transform: translateY(-1px);
}


/* =========================================
   CONTEÚDO
========================================= */

.cart-content {
    display: grid;

    grid-template-columns: minmax(0, 1fr) 340px;

    gap: 30px;

    align-items: start;
}


/* =========================================
   LISTA DE PRODUTOS
========================================= */

.cart-items {
    display: flex;
    flex-direction: column;

    gap: 14px;
}


/* =========================================
   ITEM
========================================= */

.cart-item {
    display: grid;

    grid-template-columns:
        110px
        minmax(180px, 1fr)
        130px
        130px
        auto;

    align-items: center;

    gap: 22px;

    padding: 20px;

    background: #fff;

    border: 1px solid #e7e7e7;
    border-radius: 14px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.cart-item:hover {
    border-color: #d7d7d7;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.05);

    transform: translateY(-1px);
}


/* =========================================
   IMAGEM
========================================= */

.cart-item-image {
    width: 110px;
    height: 110px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    overflow: hidden;

    background: #f7f7f7;

    border-radius: 10px;
}

.cart-item-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    transition: transform 0.25s ease;
}

.cart-item:hover .cart-item-image img {
    transform: scale(1.04);
}

.cart-no-image {
    padding: 10px;

    font-size: 12px;
    text-align: center;

    color: #999;
}


/* =========================================
   INFORMAÇÕES DO PRODUTO
========================================= */

.cart-item-info {
    min-width: 0;
}

.cart-item-info h2 {
    margin: 0 0 10px;

    font-size: 17px;
    line-height: 1.4;
    font-weight: 600;

    color: #161616;
}

.cart-item-unit-price {
    display: block;

    font-size: 14px;

    color: #777;
}


/* =========================================
   QUANTIDADE
========================================= */

.cart-item-quantity {
    display: flex;
    flex-direction: column;

    gap: 8px;
}

.cart-item-quantity > span,
.cart-item-subtotal > span {
    display: block;

    font-size: 12px;
    font-weight: 600;

    color: #888;

    text-transform: uppercase;
    letter-spacing: 0.4px;
}


/* =========================================
   CONTROLE DE QUANTIDADE
========================================= */

.cart-quantity-control {
    display: inline-flex;
    align-items: center;

    width: fit-content;

    overflow: hidden;

    border: 1px solid #ddd;
    border-radius: 8px;

    background: #fff;
}

.cart-quantity-control form {
    display: flex;

    margin: 0;
    padding: 0;
}

.cart-quantity-control button {
    width: 34px;
    height: 34px;

    padding: 0;

    border: 0;

    background: #f8f8f8;
    color: #333;

    font-size: 18px;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.cart-quantity-control button:hover:not(:disabled) {
    background: #111;
    color: #fff;
}

.cart-quantity-control button:disabled {
    background: #f1f1f1;
    color: #aaa;

    cursor: not-allowed;
}

.cart-quantity-control strong {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 36px;
    height: 34px;

    text-align: center;

    font-size: 14px;
    font-weight: 600;

    color: #222;
}


/* =========================================
   SUBTOTAL
========================================= */

.cart-item-subtotal {
    display: flex;
    flex-direction: column;

    gap: 8px;
}

.cart-item-subtotal strong {
    font-size: 16px;
    font-weight: 700;

    color: #111;
}


/* =========================================
   REMOVER
========================================= */

.cart-item-action {
    display: flex;
    justify-content: flex-end;
}

.cart-item-action form {
    margin: 0;
}

.cart-remove-button {
    padding: 8px 12px;

    border: 1px solid #e1e1e1;
    border-radius: 7px;

    background: #fff;
    color: #c62828;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.cart-remove-button:hover {
    background: #c62828;

    border-color: #c62828;

    color: #fff;
}


/* =========================================
   RESUMO DA COMPRA
========================================= */

.cart-summary {
    position: sticky;
    top: 25px;

    padding: 26px;

    background: #fff;

    border: 1px solid #e5e5e5;
    border-radius: 14px;

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.04);
}

.cart-summary h2 {
    margin: 0 0 24px;

    font-size: 19px;
    font-weight: 700;

    color: #111;
}


/* =========================================
   LINHA DO RESUMO
========================================= */

.cart-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    font-size: 14px;

    color: #666;
}

.cart-summary-row span:last-child {
    font-weight: 600;

    color: #222;
}


/* =========================================
   DIVISOR
========================================= */

.cart-summary-divider {
    width: 100%;
    height: 1px;

    margin: 20px 0;

    background: #e8e8e8;
}


/* =========================================
   TOTAL
========================================= */

.cart-summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 24px;
}

.cart-summary-total span {
    font-size: 15px;
    font-weight: 600;

    color: #555;
}

.cart-summary-total strong {
    font-size: 24px;
    font-weight: 700;

    color: #111;
}


/* =========================================
   FINALIZAR COMPRA
========================================= */

.cart-checkout-button {
    width: 100%;
    min-height: 48px;

    padding: 0 20px;

    border: 0;
    border-radius: 9px;

    background: #111;
    color: #fff;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.cart-checkout-button:hover {
    background: #292929;

    transform: translateY(-1px);
}


/* =========================================
   CONTINUAR COMPRANDO
========================================= */

.cart-continue-link {
    display: block;

    margin-top: 16px;

    text-align: center;

    font-size: 13px;
    font-weight: 600;

    color: #555;

    text-decoration: none;

    transition: color 0.2s ease;
}

.cart-continue-link:hover {
    color: #111;
}


/* =========================================
   RESPONSIVO
========================================= */

@media (max-width: 1050px) {

    .cart-content {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }

    .cart-item {
        grid-template-columns:
            100px
            minmax(180px, 1fr)
            120px
            120px;
    }

    .cart-item-action {
        grid-column: 2 / -1;

        justify-content: flex-start;
    }
}


/* =========================================
   TABLET
========================================= */

@media (max-width: 800px) {

    .cart-page {
        padding: 50px 18px 70px;
    }

    .cart-header {
        margin-bottom: 30px;
    }

    .cart-header h1 {
        font-size: 36px;
    }

    .cart-item {
        grid-template-columns: 90px 1fr;

        gap: 18px;

        padding: 16px;
    }

    .cart-item-image {
        width: 90px;
        height: 90px;

        grid-row: span 3;
    }

    .cart-item-info {
        grid-column: 2;
    }

    .cart-item-quantity {
        grid-column: 2;
    }

    .cart-item-subtotal {
        grid-column: 2;
    }

    .cart-item-action {
        grid-column: 2;
    }
}


/* =========================================
   CELULAR
========================================= */

@media (max-width: 520px) {

    .cart-page {
        padding: 35px 14px 60px;
    }

    .cart-header {
        margin-bottom: 25px;
    }

    .cart-header span {
        font-size: 11px;
    }

    .cart-header h1 {
        font-size: 30px;
    }

    .cart-empty {
        min-height: 300px;

        padding: 40px 20px;
    }

    .cart-empty h2 {
        font-size: 21px;
    }

    .cart-empty p {
        font-size: 14px;
    }

    .cart-content {
        gap: 20px;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;

        gap: 15px;

        padding: 14px;

        border-radius: 12px;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
    }

    .cart-item-info h2 {
        font-size: 15px;
    }

    .cart-item-unit-price {
        font-size: 13px;
    }

    .cart-item-quantity {
        margin-top: 3px;
    }

    .cart-item-subtotal {
        margin-top: 3px;
    }

    .cart-item-subtotal strong {
        font-size: 15px;
    }

    .cart-item-action {
        margin-top: 2px;
    }

    .cart-remove-button {
        padding: 8px 11px;
    }

    .cart-summary {
        padding: 22px 18px;
    }

    .cart-summary-total strong {
        font-size: 21px;
    }
}

.cart-header p { margin-top: 10px; color: #777; font-size: 14px; }
.cart-item-info h2 a { color: inherit; text-decoration: none; }
.cart-item-info h2 a:hover { color: #9a7130; }
.cart-stock-warning { margin-top: 8px; color: #a33b2f; font-size: 12px; line-height: 1.5; }
.cart-item-quantity small { color: #888; font-size: 11px; }
.cart-shipping-note { margin-top: 12px; color: #777; font-size: 12px; line-height: 1.5; }
.cart-checkout-button { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.cart-checkout-button:focus-visible, .cart-continue-link:focus-visible, .cart-remove-button:focus-visible, .cart-quantity-control button:focus-visible { outline: 3px solid #d4a351; outline-offset: 2px; }
