/* ==========================================================================
   Ecolivros — Carrinho no sistema visual da homepage
   Carregado só em is_cart(), depois de main.css / woocommerce.css.
   ========================================================================== */

body.eco-cart-page {
    --p-bg: #f6f5f1; --p-card: #fff; --p-line: #e6e3da; --p-line-2: #d6d2c6;
    --p-ink: #18261e; --p-soft: #5d6862; --p-forest: #173f2b; --p-forest-2: #1f5a3a;
    --p-tint: #eaf1ec; --p-live: #d9472f;
    --p-font: 'Hanken Grotesk', 'Inter', system-ui, sans-serif;
    background: var(--p-bg) !important;
}
body.eco-cart-page .eco-page-header,
body.eco-cart-page .woocommerce { font-family: var(--p-font); color: var(--p-ink); }

/* Título da página */
body.eco-cart-page .eco-page-header { border: 0 !important; padding-bottom: 0 !important; margin-bottom: 18px !important; }
body.eco-cart-page .eco-page-header::after { display: none !important; }
body.eco-cart-page .eco-page-title { font: 700 32px/1.15 var(--p-font) !important; letter-spacing: -.015em; color: var(--p-ink) !important; }

/* Grelha */
body.eco-cart-page .ec-cart.eco-cart-layout {
    display: grid !important; grid-template-columns: minmax(0, 1fr) 370px; gap: 28px; align-items: start;
}
body.eco-cart-page .ec-cart .eco-cart-layout__main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Portes grátis */
body.eco-cart-page .ec-ship {
    display: flex; flex-direction: column; gap: 9px; padding: 14px 16px;
    background: var(--p-card); border: 1px solid var(--p-line); border-radius: 14px;
    font: 400 15px/1.4 var(--p-font); color: var(--p-ink);
}
body.eco-cart-page .ec-ship b, body.eco-cart-page .ec-ship .amount { font-weight: 700; }
body.eco-cart-page .ec-ship__track { display: block; height: 6px; border-radius: 99px; background: #e3e0d6; overflow: hidden; }
body.eco-cart-page .ec-ship__track span { display: block; height: 100%; border-radius: 99px; background: var(--p-forest-2); }
body.eco-cart-page .ec-ship.is-done { background: var(--p-tint); border-color: transparent; color: var(--p-forest); }

/* Lista de artigos */
body.eco-cart-page .ec-list { background: var(--p-card); border: 1px solid var(--p-line); border-radius: 16px; overflow: hidden; }
body.eco-cart-page .ec-list__head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--p-line);
}
body.eco-cart-page .ec-list__head h2 { margin: 0 !important; font: 700 18px/1.2 var(--p-font) !important; color: var(--p-ink) !important; }
body.eco-cart-page .ec-list__more { font: 600 14.5px/1 var(--p-font); color: var(--p-forest-2) !important; text-decoration: underline !important; text-underline-offset: 3px; }

body.eco-cart-page .ec-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 16px 20px; }
body.eco-cart-page .ec-item + .ec-item { border-top: 1px solid #efede6; }
body.eco-cart-page .ec-item__img { width: 72px; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: #8de57e; }
body.eco-cart-page .ec-item__img a, body.eco-cart-page .ec-item__img img { display: block; width: 100% !important; height: 100% !important; object-fit: cover; margin: 0 !important; border-radius: 0 !important; max-width: none !important; }
body.eco-cart-page .ec-item__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 0 !important; }
body.eco-cart-page .ec-item__title, body.eco-cart-page .ec-item__title a {
    font: 600 16px/1.35 var(--p-font) !important; color: var(--p-ink) !important; text-decoration: none !important;
}
body.eco-cart-page .ec-item__title a:hover { color: var(--p-forest-2) !important; }
body.eco-cart-page .ec-item__autor { font: 400 14.5px/1.3 var(--p-font); color: var(--p-soft); }
body.eco-cart-page .ec-item__body dl.variation { margin: 2px 0 0; font-size: 13.5px; color: var(--p-soft); }
body.eco-cart-page .ec-item__foot { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
body.eco-cart-page .ec-item__qty.is-single { display: none; }
body.eco-cart-page .ec-item__qty .quantity { margin: 0 !important; }
body.eco-cart-page .ec-item__qty .qty {
    width: 72px !important; height: 38px; padding: 0 8px !important; border: 1px solid var(--p-line-2) !important; border-radius: 9px !important;
    font: 600 15px/1 var(--p-font) !important; color: var(--p-ink); background: #fff !important; text-align: center;
}
body.eco-cart-page .ec-item .product-remove { display: inline; padding: 0 !important; border: 0 !important; width: auto !important; }
body.eco-cart-page .ec-item a.remove.ec-item__remove {
    display: inline !important; width: auto !important; height: auto !important; line-height: 1.2 !important;
    background: none !important; border: 0 !important; border-radius: 0 !important;
    font: 600 14px/1.2 var(--p-font) !important; color: var(--p-soft) !important;
    text-decoration: underline !important; text-underline-offset: 3px; text-indent: 0 !important;
}
body.eco-cart-page .ec-item a.remove.ec-item__remove:hover { color: #a3321f !important; background: none !important; }
body.eco-cart-page .ec-item__price { text-align: right; display: flex; flex-direction: column; gap: 4px; padding: 0 !important; }
body.eco-cart-page .ec-item__price, body.eco-cart-page .ec-item__price .amount { font: 700 17px/1 var(--p-font) !important; color: var(--p-ink) !important; white-space: nowrap; }
body.eco-cart-page .ec-item__unit, body.eco-cart-page .ec-item__unit .amount { font: 400 13px/1 var(--p-font) !important; color: var(--p-soft) !important; }

/* Cupão e atualizar */
body.eco-cart-page .ec-actions {
    display: flex !important; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    padding: 0 !important; background: none !important; border: 0 !important;
}
body.eco-cart-page .ec-coupon summary {
    cursor: pointer; list-style: none; font: 600 14.5px/1.3 var(--p-font); color: var(--p-forest-2);
    text-decoration: underline; text-underline-offset: 3px; padding: 4px 0;
}
body.eco-cart-page .ec-coupon summary::-webkit-details-marker { display: none; }
body.eco-cart-page .ec-coupon .coupon { display: flex !important; gap: 8px; margin-top: 10px; float: none !important; }
body.eco-cart-page .ec-coupon #coupon_code {
    width: 220px !important; height: 44px; padding: 0 12px !important; border: 1px solid var(--p-line-2) !important; border-radius: 10px !important;
    font: 400 15px/1 var(--p-font) !important; background: #fff !important; margin: 0 !important;
}
body.eco-cart-page .ec-coupon .button,
body.eco-cart-page .ec-update {
    height: 44px; padding: 0 18px !important; border-radius: 10px !important; border: 0 !important;
    background: var(--p-forest) !important; color: #fff !important; font: 600 15px/1 var(--p-font) !important; box-shadow: none !important;
}
body.eco-cart-page .ec-update { background: var(--p-card) !important; color: var(--p-ink) !important; border: 1.5px solid var(--p-line-2) !important; }
body.eco-cart-page .ec-update:disabled { opacity: .5; }
body.eco-cart-page .ec-update.is-hidden { display: none !important; }

/* ── Resumo ───────────────────────────────────────────────────────────── */
body.eco-cart-page .ec-cart .eco-cart-layout__sidebar { position: sticky; top: 96px; }
body.eco-cart-page .ec-cart .cart_totals {
    width: auto !important; float: none !important; margin: 0 !important; padding: 20px !important;
    background: var(--p-card) !important; border: 1px solid var(--p-line) !important; border-radius: 16px !important; box-shadow: none !important;
    display: flex; flex-direction: column; gap: 12px;
}
body.eco-cart-page .ec-cart .cart_totals > h2 {
    margin: 0 !important; padding: 0 !important; border: 0 !important; font: 700 19px/1.2 var(--p-font) !important; color: var(--p-ink) !important;
}
body.eco-cart-page .ec-cart .cart_totals > h2::after { display: none !important; }
body.eco-cart-page .ec-cart .eco-checkout-badge {
    margin: 0 !important; padding: 0 !important; background: none !important; border: 0 !important; text-align: left !important;
    font: 400 13.5px/1.4 var(--p-font) !important; color: var(--p-soft) !important;
}
body.eco-cart-page .ec-cart .eco-checkout-badge strong { color: var(--p-ink); font-weight: 600; }
body.eco-cart-page .ec-cart .eco-checkout-badge img.emoji { width: 14px !important; height: 14px !important; vertical-align: -2px !important; }
body.eco-cart-page .ec-cart .cart_totals table.shop_table { margin: 0 !important; border: 0 !important; background: none !important; }
body.eco-cart-page .ec-cart .cart_totals table.shop_table tr { display: flex !important; justify-content: space-between; align-items: baseline; gap: 12px; border: 0 !important; }
body.eco-cart-page .ec-cart .cart_totals table.shop_table th,
body.eco-cart-page .ec-cart .cart_totals table.shop_table td {
    display: block !important; padding: 7px 0 !important; border: 0 !important; background: none !important; width: auto !important;
    font: 400 15px/1.3 var(--p-font) !important; color: var(--p-soft) !important; text-align: left;
}
body.eco-cart-page .ec-cart .cart_totals table.shop_table td { color: var(--p-ink) !important; text-align: right !important; }
body.eco-cart-page .ec-cart .cart_totals table.shop_table td::before { display: none !important; }
body.eco-cart-page .ec-cart .cart_totals tr.order-total { margin-top: 6px; border-top: 1px solid var(--p-line) !important; padding-top: 6px; }
body.eco-cart-page .ec-cart .cart_totals tr.order-total th { color: var(--p-ink) !important; font-weight: 700 !important; font-size: 16px !important; }
body.eco-cart-page .ec-cart .cart_totals tr.order-total td,
body.eco-cart-page .ec-cart .cart_totals tr.order-total td .amount { font: 800 24px/1 var(--p-font) !important; color: var(--p-ink) !important; }
body.eco-cart-page .ec-cart .cart_totals tr.cart-discount td { color: var(--p-forest-2) !important; }
body.eco-cart-page .ec-cart .wc-proceed-to-checkout { padding: 0 !important; margin: 0 !important; }
body.eco-cart-page .ec-cart .wc-proceed-to-checkout .checkout-button {
    display: flex !important; align-items: center; justify-content: center; width: 100%; height: 54px; margin: 0 !important; padding: 0 !important;
    border-radius: 12px !important; background: var(--p-forest) !important; color: #fff !important; border: 0 !important; box-shadow: none !important;
    font: 700 16.5px/1 var(--p-font) !important; text-transform: none !important; letter-spacing: 0 !important;
}
body.eco-cart-page .ec-cart .wc-proceed-to-checkout .checkout-button:hover { background: #0f2c1d !important; }

/* Pontos */
body.eco-cart-page .ec-cart .eco-cart-pts {
    margin: 0 !important; padding: 14px !important; background: var(--p-bg) !important; border: 1px solid var(--p-line) !important;
    border-radius: 12px !important; box-shadow: none !important; font-family: var(--p-font); display: flex; flex-direction: column; gap: 6px;
}
body.eco-cart-page .ec-cart .eco-cart-pts__header { display: flex; align-items: center; gap: 7px; color: var(--p-forest-2); }
body.eco-cart-page .ec-cart .eco-cart-pts__header strong { font: 700 14.5px/1 var(--p-font); color: var(--p-ink); }
body.eco-cart-page .ec-cart .eco-cart-pts__earn { font: 400 14.5px/1.4 var(--p-font); color: var(--p-ink); }
body.eco-cart-page .ec-cart .eco-cart-pts__num { background: var(--p-tint) !important; color: var(--p-forest) !important; border-radius: 6px !important; padding: 3px 7px !important; font-weight: 700 !important; }
body.eco-cart-page .ec-cart .eco-cart-pts__guest { font: 400 13.5px/1.45 var(--p-font); color: var(--p-soft); }
body.eco-cart-page .ec-cart .eco-cart-pts__guest a, body.eco-cart-page .ec-cart .eco-cart-pts__link { color: var(--p-forest-2) !important; font-weight: 600; }
body.eco-cart-page .ec-cart .eco-cart-pts__link { font: 600 13.5px/1 var(--p-font); text-decoration: underline; text-underline-offset: 3px; }
body.eco-cart-page .ec-cart .eco-cart-layout__sidebar::after { font-family: var(--p-font) !important; color: var(--p-soft) !important; }

/* Sugestões do WooCommerce (cross-sells) */
body.eco-cart-page .ec-cart .cross-sells { margin-top: 16px; }
body.eco-cart-page .ec-cart .cross-sells > h2 { font: 700 17px/1.2 var(--p-font) !important; }

/* ── Carrinho vazio ───────────────────────────────────────────────────── */
body.eco-cart-page .ec-empty {
    max-width: 520px; margin: 30px auto 60px !important; padding: 36px 28px !important; text-align: center;
    background: var(--p-card) !important; border: 1px solid var(--p-line) !important; border-radius: 18px !important; box-shadow: none !important;
    font-family: var(--p-font);
}
body.eco-cart-page .ec-empty__icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--p-tint); color: var(--p-forest-2); }
body.eco-cart-page .ec-empty__title { margin: 16px 0 6px !important; font: 700 24px/1.2 var(--p-font) !important; color: var(--p-ink) !important; }
body.eco-cart-page .ec-empty__sub { margin: 0 0 20px !important; font: 400 16px/1.5 var(--p-font); color: var(--p-soft); }
body.eco-cart-page .ec-empty__ctas { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
body.eco-cart-page .ec-empty .ep-btn {
    display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 22px; border-radius: 11px;
    background: var(--p-forest); color: #fff !important; font: 700 15.5px/1 var(--p-font); text-decoration: none !important;
}
body.eco-cart-page .ec-empty .ep-btn:hover { background: #0f2c1d; }
body.eco-cart-page .ec-empty .ec-btn--ghost { background: var(--p-card); color: var(--p-ink) !important; border: 1.5px solid var(--p-line-2); }
body.eco-cart-page .ec-empty .ec-btn--ghost:hover { background: var(--p-tint); border-color: var(--p-forest-2); }

/* ── Responsivo ───────────────────────────────────────────────────────── */
@media (max-width: 960px) {
    body.eco-cart-page .ec-cart.eco-cart-layout { grid-template-columns: 1fr; gap: 18px; }
    body.eco-cart-page .ec-cart .eco-cart-layout__sidebar { position: static; }
}
@media (max-width: 600px) {
    body.eco-cart-page .eco-page-title { font-size: 26px !important; }
    body.eco-cart-page .ec-item { grid-template-columns: 62px minmax(0, 1fr) auto; gap: 12px; padding: 14px 16px; }
    body.eco-cart-page .ec-item__img { width: 62px; }
    body.eco-cart-page .ec-list__head { padding: 14px 16px; }
    body.eco-cart-page .ec-coupon #coupon_code { width: auto !important; flex: 1; }
    body.eco-cart-page .ec-coupon, body.eco-cart-page .ec-coupon .coupon { width: 100%; }
    body.eco-cart-page .ec-cart .cart_totals { padding: 16px !important; }
}

/* Ajustes */
body.eco-cart-page .eco-page-header,
body.eco-cart-page .eco-page-header * { border-bottom: 0 !important; box-shadow: none !important; }
body.eco-cart-page .ec-cart .woocommerce-cart-form {
    display: flex; flex-direction: column; gap: 14px;
    padding: 0 !important; margin: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
}
body.eco-cart-page .ec-item__img.product-thumbnail { width: 72px !important; max-width: 72px !important; min-width: 0 !important; padding: 0 !important; }
body.eco-cart-page .ec-cart .cart_totals tr.shipping { display: none !important; }
body.eco-cart-page .ec-cart .cart_totals > * { order: 6; }
body.eco-cart-page .ec-cart .cart_totals > h2 { order: 1; }
body.eco-cart-page .ec-cart .cart_totals > table { order: 2; }
body.eco-cart-page .ec-cart .eco-checkout-badge { order: 3; }
body.eco-cart-page .ec-cart .wc-proceed-to-checkout { order: 4; }
body.eco-cart-page .ec-cart .eco-cart-pts { order: 5; }
@media (max-width: 600px) {
    body.eco-cart-page .ec-item__img.product-thumbnail { width: 62px !important; max-width: 62px !important; }
}
body.eco-cart-page .ec-cart .cart_totals { box-sizing: border-box; max-width: 100%; }
body.eco-cart-page .ec-cart .cart_totals table.shop_table tr.shipping { display: none !important; }
body.eco-cart-page .ec-cart .cart_totals::before,
body.eco-cart-page .ec-cart .cart_totals::after { order: 7; }
body.eco-cart-page .ec-cart .eco-cart-layout__sidebar { width: auto !important; min-width: 0 !important; max-width: none !important; }

/* Mensagens (artigo removido, cupão aplicado, erros) */
body.eco-cart-page .woocommerce-notices-wrapper .woocommerce-message,
body.eco-cart-page .woocommerce-notices-wrapper .woocommerce-info,
body.eco-cart-page .woocommerce-notices-wrapper .woocommerce-error {
    margin: 0 0 14px !important; padding: 13px 16px !important; border: 1px solid var(--p-line) !important; border-left-width: 1px !important;
    border-radius: 12px !important; background: var(--p-card) !important; box-shadow: none !important;
    font: 400 15px/1.45 var(--p-font) !important; color: var(--p-ink) !important;
}
body.eco-cart-page .woocommerce-notices-wrapper .woocommerce-message::before,
body.eco-cart-page .woocommerce-notices-wrapper .woocommerce-info::before { color: var(--p-forest-2) !important; }
body.eco-cart-page .woocommerce-notices-wrapper .woocommerce-error { background: #fdf3f0 !important; border-color: #f0c9bf !important; }
body.eco-cart-page .woocommerce-notices-wrapper a { color: var(--p-forest-2) !important; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
