/* ============================================================
   Marketplace Checkout / Carrinho
   ============================================================ */

.checkout-shell {
    padding: 42px 0 64px;
    background: linear-gradient(180deg, rgba(247, 241, 230, 0.72), rgba(255, 255, 255, 0));
}

.checkout-container {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto;
}

.checkout-narrow {
    width: min(820px, calc(100% - 32px));
}

.checkout-heading {
    margin-bottom: 24px;
}

.checkout-heading h1 {
    margin: 8px 0 8px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1;
    letter-spacing: -0.045em;
}

.checkout-heading p {
    max-width: 720px;
    color: var(--color-muted, #6b6258);
    font-size: 1rem;
}

.checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
    align-items: start;
}

.checkout-card,
.checkout-summary-card,
.checkout-empty-card,
.order-success-card {
    background: #fff;
    border: 1px solid rgba(63, 43, 24, 0.1);
    border-radius: 24px;
    box-shadow: 0 18px 50px rgba(40, 30, 18, 0.08);
    padding: 24px;
}

.checkout-card-head,
.summary-line,
.summary-total,
.checkout-mini-items > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.checkout-card-head {
    margin-bottom: 18px;
}

.checkout-card-head h2,
.checkout-summary-card h2,
.checkout-card h2 {
    margin: 0;
    font-size: 1.3rem;
}

.cart-item-list {
    display: grid;
    gap: 14px;
}

.cart-item-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) 130px auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(63, 43, 24, 0.08);
    border-radius: 18px;
    background: rgba(250, 247, 241, 0.62);
}

.cart-item-image {
    width: 92px;
    height: 92px;
    border-radius: 16px;
    overflow: hidden;
    background: #f7f1e8;
    display: block;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cart-item-info h3 {
    margin: 0 0 6px;
    font-size: 1.04rem;
}

.cart-item-info h3 a {
    color: inherit;
    text-decoration: none;
}

.cart-item-info p,
.checkout-note,
.checkout-section-title p,
.checkout-payment-box p,
.checkout-legal-box p,
.order-status-box small {
    color: var(--color-muted, #6b6258);
    font-size: 0.92rem;
}

.cart-item-controls {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.cart-item-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--color-muted, #6b6258);
}

.cart-item-controls input {
    width: 74px;
    padding: 10px 8px;
    border-radius: 12px;
    border: 1px solid rgba(63, 43, 24, 0.14);
    text-align: center;
}

.cart-remove-button,
.cart-clear-form button,
.checkout-inline-form button {
    border: 0;
    background: transparent;
    color: #8b4a2f;
    cursor: pointer;
    font-weight: 700;
    text-decoration: underline;
}

.cart-actions-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.checkout-summary-card {
    position: sticky;
    top: 18px;
}

.summary-line {
    padding: 12px 0;
    border-bottom: 1px solid rgba(63, 43, 24, 0.08);
}

.summary-total {
    margin-top: 14px;
    padding: 16px;
    border-radius: 18px;
    background: #f6efe2;
}

.summary-total strong {
    font-size: 1.25rem;
}

.checkout-full-button {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
}

.cart-clear-form {
    margin-top: 14px;
    text-align: center;
}

.checkout-empty-card {
    text-align: center;
    padding: 48px 24px;
}

.checkout-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0;
    margin: 0 0 24px;
    list-style: none;
}

.checkout-steps li {
    padding: 10px 12px;
    border-radius: 999px;
    background: #f7f1e8;
    color: var(--color-muted, #6b6258);
    font-weight: 700;
    font-size: 0.88rem;
    text-align: center;
}

.checkout-steps li.is-active,
.checkout-steps li.is-done {
    background: #1f4d34;
    color: #fff;
}

.checkout-section-title {
    margin-bottom: 18px;
}

.checkout-section-title h2 {
    margin: 0 0 6px;
}

.checkout-form {
    display: grid;
    gap: 16px;
}

.checkout-form label {
    display: grid;
    gap: 7px;
}

.checkout-form label > span,
.checkout-legal-check span {
    font-weight: 700;
}

.checkout-form input[type="text"],
.checkout-form input[type="email"],
.checkout-form input[type="number"] {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid rgba(63, 43, 24, 0.14);
    border-radius: 14px;
    background: #fff;
}

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

.checkout-radio-card {
    border: 1px solid rgba(63, 43, 24, 0.12);
    border-radius: 16px;
    padding: 14px;
    background: rgba(250, 247, 241, 0.65);
    cursor: pointer;
}

.checkout-radio-card input {
    margin-right: 8px;
}

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

.checkout-form-grid .span-2 {
    grid-column: 1 / -1;
}

.checkout-payment-box,
.checkout-legal-box,
.checkout-delivery-summary,
.order-status-box {
    border: 1px solid rgba(63, 43, 24, 0.1);
    border-radius: 18px;
    padding: 16px;
    background: rgba(250, 247, 241, 0.62);
}

.checkout-payment-box h3,
.checkout-legal-box h3,
.checkout-delivery-summary h3 {
    margin: 0 0 6px;
}

.checkout-legal-check {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: flex-start;
    gap: 10px !important;
    padding: 12px 0;
    border-top: 1px solid rgba(63, 43, 24, 0.08);
}

.checkout-legal-check:first-of-type {
    border-top: 0;
}

.checkout-legal-check input {
    margin-top: 4px;
}

.checkout-legal-check small {
    display: block;
    color: var(--color-muted, #6b6258);
    font-weight: 500;
}

.checkout-mini-items {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.checkout-mini-items > div {
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(63, 43, 24, 0.08);
}

.checkout-warning {
    display: inline-flex;
    color: #9a3412;
    font-size: 0.86rem;
    font-weight: 700;
}

.order-success-card {
    text-align: center;
    margin-bottom: 22px;
}

.order-success-icon {
    display: inline-grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #1f4d34;
    color: #fff;
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 14px;
}

.order-status-box {
    margin-top: 18px;
    text-align: left;
}

.order-status-box span {
    display: block;
    margin: 4px 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.marketplace-cart-header-button span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    margin-left: 7px;
    background: #fff;
    color: #1f4d34;
    font-size: 0.78rem;
    font-weight: 900;
}

.product-cart-form {
    display: grid;
    gap: 14px;
}

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

    .checkout-summary-card {
        position: static;
    }

    .cart-item-card {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .cart-item-controls {
        grid-column: 1 / -1;
        justify-items: start;
    }

    .cart-remove-button {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

@media (max-width: 640px) {
    .checkout-channel-grid,
    .checkout-form-grid,
    .checkout-steps {
        grid-template-columns: 1fr;
    }

    .checkout-card,
    .checkout-summary-card,
    .checkout-empty-card,
    .order-success-card {
        padding: 18px;
        border-radius: 20px;
    }
}

/* Ajustes finos do carrinho: layout limpo e ações por item */
.cart-update-hidden-form {
    display: none;
}

.checkout-card-head h1 {
    margin: 0;
    font-size: 1.3rem;
}

.cart-item-info h2 {
    margin: 0 0 6px;
    font-size: 1.04rem;
}

.cart-item-info h2 a {
    color: inherit;
    text-decoration: none;
}

.cart-quantity-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(63, 43, 24, 0.14);
    border-radius: 10px;
    background: #fff;
}

.cart-quantity-control input {
    width: 52px;
    height: 34px;
    padding: 0 4px;
    border: 0;
    border-left: 1px solid rgba(63, 43, 24, 0.08);
    border-right: 1px solid rgba(63, 43, 24, 0.08);
    border-radius: 0;
    text-align: center;
    font-weight: 700;
    appearance: textfield;
}

.cart-quantity-control input::-webkit-outer-spin-button,
.cart-quantity-control input::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
}

.cart-quantity-btn {
    width: 34px;
    height: 34px;
    border: 0;
    background: #fff;
    color: #3866d6;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.cart-quantity-btn:hover {
    background: #f6f1e8;
}

.cart-remove-form {
    justify-self: end;
    align-self: start;
}

.cart-remove-button {
    min-width: auto;
    padding: 4px 6px;
    border-radius: 8px;
    color: #8b4a2f;
    text-decoration: none;
    font-size: 0.78rem;
}

.cart-remove-button:hover {
    background: rgba(139, 74, 47, 0.08);
}

@media (max-width: 900px) {
    .cart-remove-form {
        grid-column: 1 / -1;
        justify-self: start;
    }
}
