/* ============================================================
   MHDCommerce — Página de Carrinho + Drawer de revisão
   Arquivo: wwwroot/css/carrinho.css
   Carregar DEPOIS de site.css
   ============================================================ */

.content { max-width: 1200px; margin: 0 auto; padding: 28px 32px 60px; }
.page-title { font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.page-sub { font-size: 14px; color: var(--muted); margin-bottom: 24px; }

.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }

/* ── Lista de itens ── */
.cart-items { display: flex; flex-direction: column; gap: 12px; }
.cart-item { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; gap: 16px; align-items: flex-start; position: relative; transition: opacity .2s; }
.cart-item.removendo { opacity: .4; pointer-events: none; }
.ci-thumb { width: 88px; height: 88px; border-radius: var(--radius-md); background: white; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 42px; position: relative; overflow: hidden; }
.ci-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.ci-clube-selo { position: absolute; bottom: 2px; left: 2px; width: 20px; height: 20px; border-radius: 99px; background: var(--clube); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; border: 2px solid #fff; }
.ci-info { flex: 1; min-width: 0; }
.ci-badges { display: flex; gap: 5px; margin-bottom: 5px; flex-wrap: wrap; }
.ci-badge { font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 99px; text-transform: uppercase; letter-spacing: .3px; }
.ci-badge.oferta { background: var(--brand-light); color: var(--brand-dark); }
.ci-badge.exclusivo { background: var(--brand-dark); color: #fff; }
.ci-badge.clube { background: var(--clube-light); color: var(--clube); }
.ci-badge.atacarejo { background: var(--atacarejo-light); color: var(--atacarejo); }
.ci-nome { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.ci-preco-unit { font-size: 13px; color: var(--muted); }
.ci-preco-unit b { color: var(--brand); font-weight: 700; }
.ci-obs { margin-top: 8px; font-size: 12px; color: var(--text-2); background: var(--bg); border-radius: var(--radius-sm); padding: 6px 10px; display: inline-flex; gap: 6px; align-items: center; }
.ci-obs .ico { color: var(--muted); }

.ci-right { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; flex-shrink: 0; }
.ci-remover { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 4px; padding: 4px; }
.ci-remover:hover { color: var(--red); }
.ci-qtd { display: flex; align-items: center; background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.ci-qtd-btn { width: 36px; height: 36px; border: none; background: var(--white); cursor: pointer; font-size: 17px; color: var(--brand); display: flex; align-items: center; justify-content: center; }
.ci-qtd-btn:hover:not(:disabled) { background: var(--brand-light); }
.ci-qtd-btn:disabled { color: #ccc; cursor: not-allowed; }
.ci-qtd-value { width: 64px; height: 36px; border: none; border-left: 1.5px solid var(--border); border-right: 1.5px solid var(--border); text-align: center; font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 600; }
.ci-total { font-family: 'Sora', sans-serif; font-size: 19px; font-weight: 700; color: var(--text); }

/* ── Resumo (sticky) ── */
.cart-summary { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; position: sticky; top: 20px; }
.cs-title { font-family: 'Sora', sans-serif; font-size: 17px; font-weight: 700; margin-bottom: 16px; }
.cs-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-2); padding: 7px 0; }
.cs-row.economia { color: var(--brand); font-weight: 600; }
.cs-divider { height: 1px; background: var(--border); margin: 12px 0; }
.cs-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.cs-total-label { font-size: 15px; font-weight: 600; }
.cs-total-valor { font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 700; color: var(--brand); }
.cs-btn { width: 100%; height: 52px; background: var(--brand); color: #fff; border: none; border-radius: var(--radius-md); font-family: 'DM Sans', sans-serif; font-size: 16px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.cs-btn:hover { background: var(--brand-mid); }
.cs-continuar { display: block; text-align: center; margin-top: 12px; font-size: 13px; color: var(--brand); text-decoration: none; font-weight: 600; }
.cs-continuar:hover { text-decoration: underline; }
.cs-selo { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

/* ── Estado vazio ── */
.cart-vazio { text-align: center; padding: 80px 20px; }
.cart-vazio-ico { font-size: 64px; margin-bottom: 16px; }
.cart-vazio-titulo { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.cart-vazio-sub { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.cart-vazio-btn { display: inline-flex; background: var(--brand); color: #fff; border: none; border-radius: var(--radius-md); padding: 14px 28px; font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; }

/* ── Drawer lateral de revisão ── */
.drawer-cart-overlay { position: fixed; inset: 0; background: rgba(20,30,25,.5); z-index: 1000; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-cart-overlay.open { opacity: 1; pointer-events: all; }
.drawer-cart { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 90vw; background: var(--white); z-index: 1001; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s; box-shadow: -8px 0 40px rgba(0,0,0,.2); }
.drawer-cart.open { transform: translateX(0); }
.dc-head { padding: 20px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.dc-title { font-family: 'Sora', sans-serif; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.dc-count { background: var(--brand); color: #fff; border-radius: 99px; padding: 1px 9px; font-size: 12px; font-weight: 700; }
.dc-close { width: 34px; height: 34px; border: none; background: var(--bg); border-radius: 99px; cursor: pointer; font-size: 16px; color: var(--text-2); }
.dc-body { flex: 1; overflow-y: auto; padding: 16px 22px; display: flex; flex-direction: column; gap: 14px; }
.dc-item { display: flex; gap: 12px; align-items: flex-start; }
.dc-thumb { width: 56px; height: 56px; border-radius: var(--radius-sm); background: white; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; overflow: hidden; }
.dc-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.dc-info { flex: 1; min-width: 0; }
.dc-nome { font-size: 13px; font-weight: 600; line-height: 1.3; }
.dc-qtd { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dc-preco { font-family: 'Sora', sans-serif; font-weight: 700; color: var(--brand); font-size: 14px; }
.dc-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); gap: 8px; }
.dc-empty-ico { font-size: 48px; }
.dc-foot { padding: 20px 22px; border-top: 1px solid var(--border); }
.dc-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.dc-total-label { font-size: 14px; color: var(--text-2); }
.dc-total-valor { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 700; color: var(--brand); }
.dc-btn-primary { display: flex; align-items: center; justify-content: center; width: 100%; height: 50px; background: var(--brand); color: #fff; border: none; border-radius: var(--radius-md); font-size: 15px; font-weight: 700; cursor: pointer; margin-bottom: 8px; text-decoration: none; }
.dc-btn-primary:hover { background: var(--brand-mid); }
.dc-btn-secondary { width: 100%; height: 46px; background: var(--white); color: var(--brand); border: 1.5px solid var(--border); border-radius: var(--radius-md); font-size: 14px; font-weight: 600; cursor: pointer; }

/* ── Responsivo: resumo vira barra fixa no rodapé ── */
@media (max-width: 900px) {
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: fixed; left: 0; right: 0; bottom: 0; top: auto; border-radius: var(--radius-xl) var(--radius-xl) 0 0; border: none; border-top: 1px solid var(--border); box-shadow: 0 -8px 30px rgba(0,0,0,.1); padding: 16px 20px; z-index: 100; }
    .cs-title, .cs-selo, .cs-rows-detalhe, .cs-divider { display: none; }
    .cs-total { margin-bottom: 12px; }
    .content { padding-bottom: 180px; }
    .cart-item { padding: 12px; gap: 12px; }
    .ci-thumb { width: 70px; height: 70px; }
    .drawer-cart { width: 100%; max-width: none; }
}
@media (max-width: 520px) {
    .content { padding-left: 16px; padding-right: 16px; }
    .ci-right { gap: 8px; }
    .ci-total { font-size: 17px; }
}

.spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 99px;
    animation: girar .6s linear infinite;
    vertical-align: -2px;
    margin-right: 4px;
}

@keyframes girar {
    to {
        transform: rotate(360deg);
    }
}

.cs-btn.carregando {
    opacity: .9;
    cursor: wait;
}


