/* Carrinho — painel do header, página /carrinho/ e toast */

.header-top__badge[hidden] {
    display: none !important;
}

.header-panel__box.cart-panel {
    width: min(440px, 100%);
    max-height: min(78vh, 640px);
    display: flex;
    flex-direction: column;
    padding: 20px 20px 18px;
}

.cart-panel__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    margin: 0 0 14px;
    padding-right: 2px;
    max-height: 46vh;
}

.cart-panel__list[hidden],
.cart-panel__empty[hidden],
.cart-panel__footer[hidden] {
    display: none !important;
}

.cart-panel__footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #e8eef3;
}

.cart-panel__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 0 0 12px;
    font-size: 14px;
    color: #64748b;
}

.cart-panel__total strong {
    font-family: var(--font-display, inherit);
    font-size: 1.05rem;
    color: #003d4d;
}

.cart-line {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    background: #f7fafc;
    border: 1px solid #e8eef3;
    border-radius: 10px;
}

.cart-line--compact {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    padding: 8px;
}

.cart-line__media {
    display: block;
    width: 64px;
    height: 48px;
    overflow: hidden;
    border-radius: 8px;
    background: #e8eef3;
}

.cart-line--compact .cart-line__media {
    width: 52px;
    height: 40px;
}

.cart-line__media img,
.cart-line__placeholder {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-line__placeholder {
    background: linear-gradient(135deg, #034059, #0068b3);
}

.cart-line__body {
    min-width: 0;
}

.cart-line__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: #003d4d;
    text-decoration: none;
}

.cart-line__title:hover {
    color: #0068b3;
}

.cart-line__price {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 700;
    color: #0068b3;
}

.cart-line__remove {
    border: 0;
    background: transparent;
    color: #94a3b8;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px;
}

.cart-line__remove:hover {
    color: #b91c1c;
}

.cart-toast {
    position: fixed;
    right: 16px;
    bottom: 24px;
    z-index: 400;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #003d4d;
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 40, 55, 0.24);
    font-size: 14px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.cart-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.cart-toast a {
    color: #8ee0b0;
    font-weight: 700;
    text-decoration: none;
}

.sheet-card__actions .js-add-cart,
.sheet-detail__actions .js-add-cart,
.pub-article__actions .js-add-cart {
    white-space: normal;
    text-align: center;
}

.cart-page {
    padding-block: 2.5rem 4rem;
}

.cart-page__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 1.5rem;
    align-items: start;
}

.cart-page__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-page__list .cart-line {
    background: #fff;
    padding: 14px;
    grid-template-columns: 88px minmax(0, 1fr) auto;
}

.cart-page__list .cart-line__media {
    width: 88px;
    height: 64px;
}

.cart-page__summary {
    background: #fff;
    border: 1px solid #e8eef3;
    border-radius: 12px;
    padding: 1.25rem 1.35rem;
    box-shadow: 0 1px 2px rgb(0 0 0 / 6%);
}

.cart-page__summary h2 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    color: #003d4d;
}

.cart-page__meta {
    display: flex;
    justify-content: space-between;
    margin: 0 0 0.5rem;
    color: #64748b;
    font-size: 14px;
}

.cart-page__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 0.75rem 0 1.1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e8eef3;
    font-size: 15px;
    color: #64748b;
}

.cart-page__total strong {
    font-family: var(--font-display, inherit);
    font-size: 1.25rem;
    color: #003d4d;
}

.cart-page__note {
    margin: 12px 0 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.45;
}

.cart-page__empty {
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
    background: #fff;
    border: 1px solid #e8eef3;
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
}

.cart-page__empty p {
    margin: 0 0 1.25rem;
    color: #64748b;
}

.cart-page__layout[hidden],
.cart-page__empty[hidden],
#cartPagePay[hidden] {
    display: none !important;
}

.pub-article__paywall {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 1.5rem;
    margin-block: 1.5rem;
    background: #f7fafc;
    border: 1px solid #e8eef3;
    border-radius: 12px;
}

.pub-article__paywall p {
    flex: 1 1 100%;
    margin: 0 0 0.25rem;
}

@media (max-width: 860px) {
    .cart-page__layout {
        grid-template-columns: 1fr;
    }

    .cart-page__summary {
        position: static;
    }
}

@media (max-width: 560px) {
    .cart-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .cart-page__list .cart-line,
    .cart-line {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    .cart-line__remove {
        grid-column: 1 / -1;
        justify-self: start;
        padding-left: 0;
    }
}
