/* ── Meu Carrinho (Convert) — CdA Ferramentas ───────────────────────────── */

/* ── Trigger ── */
.cdaf-mc-wrap{display:flex;align-items:center;width:100%}
.cdaf-mc-trigger{
    position:relative;display:inline-flex;align-items:center;gap:6px;
    background:none;border:none;cursor:pointer;padding:4px;
    line-height:1;color:inherit
}
.cdaf-mc-trigger-icon{display:inline-flex;align-items:center;line-height:1;position:relative}
.cdaf-mc-trigger-icon svg,.cdaf-mc-trigger-icon i{display:block}
.cdaf-mc-trigger-label{font-size:14px;font-weight:500}

.cdaf-mc-badge{
    position:absolute;top:50%;transform:translateY(-50%);right:-8px;
    min-width:18px;height:18px;
    background:#16a34a;color:#fff;
    border-radius:50%;font-size:11px;font-weight:700;
    display:flex;align-items:center;justify-content:center;
    padding:0 3px;line-height:1;
    transition:transform .2s;pointer-events:none
}
.cdaf-mc-badge[data-count="0"],.cdaf-mc-badge:empty{display:none}

/* ── Posição do badge configurável pelo Elementor ── */
.cdaf-mc-badge[data-mobile-side="left"]{
    right:auto;
    left:-8px;
}
.cdaf-mc-badge[data-mobile-side="right"],
.cdaf-mc-badge:not([data-mobile-side]){
    left:auto;
    right:-8px;
}
.cdaf-mc-desktop-info{
    display:flex;flex-direction:column;gap:2px;
    font-size:13px;line-height:1.4;text-align:right;
    order:-1;
}
.cdaf-mc-info-items,.cdaf-mc-info-total{display:block;white-space:nowrap}
.cdaf-mc-desktop-info strong{font-weight:700}

/* ── Overlay ── */
.cdaf-mc-overlay{
    position:fixed;inset:0;z-index:9998;
    background:rgba(0,0,0,0.45);
    opacity:0;pointer-events:none;
    transition:opacity .28s ease
}
.cdaf-mc-overlay.cdaf-mc-open{opacity:1;pointer-events:auto}

/* ── Drawer ── */
.cdaf-mc-drawer{
    position:fixed;top:0;bottom:0;z-index:9999;
    width:420px;max-width:100vw;
    background:#fff;
    display:flex;flex-direction:column;
    box-shadow:-8px 0 40px rgba(0,0,0,.18);
    transition:transform .3s cubic-bezier(.4,0,.2,1);
    will-change:transform;
    overflow:hidden
}
.cdaf-mc-drawer--right{right:0;transform:translateX(100%)}
.cdaf-mc-drawer--left{left:0;transform:translateX(-100%)}
.cdaf-mc-drawer--right.cdaf-mc-open,.cdaf-mc-drawer--left.cdaf-mc-open{transform:translateX(0)}

/* ── Head ── */
.cdaf-mc-drawer-head{
    display:flex;align-items:center;justify-content:space-between;
    padding:18px 20px;border-bottom:1px solid #f3f4f6;flex-shrink:0;
    background:#fff;position:relative;z-index:1
}
.cdaf-mc-drawer-title{font-size:17px;font-weight:700;color:#111827}
.cdaf-mc-drawer-count{font-weight:400;color:#6b7280;font-size:15px}
.cdaf-mc-head-actions{display:flex;align-items:center;gap:12px}
.cdaf-mc-clear-btn{
    font-size:12px;color:#6b7280;background:none;border:none;
    cursor:pointer;text-decoration:none;padding:0;white-space:nowrap;
    transition:color .15s,background .15s
}
.cdaf-mc-clear-btn:hover{color:#111827}
.cdaf-mc-close{
    background:none;border:none;cursor:pointer;
    color:#6b7280;padding:2px;display:flex;align-items:center;
    border-radius:4px;transition:color .15s,background .15s
}
.cdaf-mc-close:hover{color:#111827;background:#f3f4f6}

/* ── Frete grátis ── */
.cdaf-mc-free-shipping{padding:10px 20px;background:#f0fdf4;flex-shrink:0;position:relative;z-index:1}
.cdaf-mc-free-text{font-size:12px;color:#16a34a;margin:0 0 6px;text-align:center}
.cdaf-mc-free-text strong{font-weight:700}
.cdaf-mc-free-track{height:4px;background:#e5e7eb;border-radius:2px;overflow:hidden}
.cdaf-mc-free-bar{height:100%;background:#16a34a;border-radius:2px;transition:width .4s ease}

/* ── Body / Items ── */
.cdaf-mc-body-wrap{flex:1;position:relative;min-height:0;display:flex;flex-direction:column}
.cdaf-mc-body{flex:1;overflow-y:auto;overflow-x:hidden;padding:0 20px;min-height:0}
.cdaf-mc-body::-webkit-scrollbar{width:4px}
.cdaf-mc-body::-webkit-scrollbar-track{background:transparent}
.cdaf-mc-body::-webkit-scrollbar-thumb{background:#e5e7eb;border-radius:2px}

/* Gradiente de fade na base da lista */
.cdaf-mc-scroll-fade{
    position:absolute;bottom:0;left:0;right:0;height:56px;
    background:linear-gradient(to bottom,rgba(255,255,255,0),#fff);
    pointer-events:none;
    opacity:1;
    transition:opacity .25s ease
}
.cdaf-mc-scroll-fade.is-hidden{opacity:0}

/* Pill "X mais itens" */
.cdaf-mc-scroll-pill{
    position:absolute;bottom:8px;left:50%;transform:translateX(-50%);
    background:rgba(30,30,30,.72);color:#fff;
    font-size:11px;font-weight:500;
    padding:5px 12px;border-radius:20px;
    display:flex;align-items:center;gap:4px;
    white-space:nowrap;pointer-events:none;
    opacity:1;
    transition:opacity .4s ease
}
.cdaf-mc-scroll-pill.is-hidden{opacity:0}

/* Loading */
.cdaf-mc-loading{display:flex;align-items:center;justify-content:center;padding:48px 0}
.cdaf-mc-spinner{
    width:28px;height:28px;border:3px solid #e5e7eb;
    border-top-color:#16a34a;border-radius:50%;
    animation:cdaf-spin .7s linear infinite
}
@keyframes cdaf-spin{to{transform:rotate(360deg)}}

/* Empty */
.cdaf-mc-empty{
    display:flex;flex-direction:column;align-items:center;
    justify-content:center;padding:48px 20px;text-align:center;
    color:#9ca3af;gap:12px
}
.cdaf-mc-empty p{font-size:14px;margin:0}

/* Item */
/* Item */
.cdaf-mc-item{
    display:grid;
    grid-template-columns:72px 1fr;
    gap:12px;align-items:stretch;
    padding:14px 0;
    border-top:1px solid #f3f4f6
}
.cdaf-mc-item:first-child{border-top:none}
.cdaf-mc-item-img{
    width:72px;height:72px;object-fit:cover;
    border-radius:6px;background:#f3f4f6;display:block;flex-shrink:0;
    align-self:start
}
.cdaf-mc-item-info{
    display:flex;flex-direction:column;gap:4px;min-width:0;
    min-height:72px
}
.cdaf-mc-item-top{
    display:flex;align-items:flex-start;justify-content:space-between;gap:8px
}
.cdaf-mc-item-name{
    font-size:13px;font-weight:600;color:#111827;
    line-height:1.35;flex:1;min-width:0;
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
    text-decoration:none
}
.cdaf-mc-item-name:hover{color:#111827}
.cdaf-mc-item-price{font-size:13px;font-weight:600;color:#111827;white-space:nowrap;flex-shrink:0}
.cdaf-mc-item-variation{font-size:11px;color:#6b7280}
.cdaf-mc-item-bottom{
    display:flex;align-items:center;justify-content:space-between;
    margin-top:auto;padding-top:6px
}

/* Qty + delete */
.cdaf-mc-item-actions{display:flex;flex-direction:column;align-items:flex-end;gap:10px}
.cdaf-mc-qty{
    display:inline-flex;align-items:center;
    border:1px solid #e5e7eb;border-radius:6px;overflow:hidden;height:30px
}
.cdaf-mc-qty-btn{
    width:28px;height:100%;background:none;border:none;
    font-size:16px;cursor:pointer;color:#374151;
    display:flex;align-items:center;justify-content:center;
    transition:background .12s;line-height:1
}
.cdaf-mc-qty-btn:hover{background:#f3f4f6}
.cdaf-mc-qty-val{
    min-width:26px;text-align:center;font-size:13px;
    font-weight:600;color:#111827;padding:0 2px;
    border:none;background:none;cursor:text;
    outline:none;border-radius:3px
}
.cdaf-mc-qty-val:focus{background:#f3f4f6}
.cdaf-mc-qty-val::-webkit-inner-spin-button,
.cdaf-mc-qty-val::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.cdaf-mc-delete{
    background:none;border:none;cursor:pointer;
    color:#d1d5db;padding:2px;display:flex;
    transition:color .15s
}
.cdaf-mc-delete:hover{color:#ef4444}

/* ── Footer ── */
.cdaf-mc-footer{
    flex-shrink:0;padding:16px 20px;
    border-top:1px solid #f3f4f6;background:#fff;
    display:flex;flex-direction:column;gap:14px;
    position:relative
}

/* Cupom */
.cdaf-mc-coupon-wrap{
    display:flex;border:1px solid #e5e7eb;
    border-radius:6px;overflow:hidden
}
.cdaf-mc-coupon-input{
    flex:1;border:none;outline:none;padding:9px 12px;
    font-size:13px;color:#374151;background:transparent
}
.cdaf-mc-coupon-btn{
    padding:9px 14px;background:#f3f4f6;border:none;border-left:1px solid #e5e7eb;
    font-size:12px;font-weight:600;color:#374151;cursor:pointer;white-space:nowrap;
    transition:background .15s
}
.cdaf-mc-coupon-btn:hover{background:#e5e7eb}
.cdaf-mc-coupon-msg{font-size:12px;padding:2px 0;min-height:16px}
.cdaf-mc-coupon-msg.error{color:#ef4444}
.cdaf-mc-coupon-msg.success{color:#16a34a}
.cdaf-mc-coupons-applied{display:flex;flex-wrap:wrap;gap:6px}
.cdaf-mc-coupon-tag{
    display:inline-flex;align-items:center;gap:5px;
    background:#f0fdf4;color:#15803d;border:1px solid #bbf7d0;
    border-radius:4px;font-size:11px;font-weight:600;padding:3px 7px
}
.cdaf-mc-coupon-remove{
    background:none;border:none;cursor:pointer;
    color:#6b7280;font-size:13px;line-height:1;padding:0
}

/* Totais */
.cdaf-mc-totals{display:flex;flex-direction:column;gap:7px}
.cdaf-mc-total-row{display:flex;justify-content:space-between;align-items:center}
.cdaf-mc-total-label{font-size:13px;color:#6b7280}
.cdaf-mc-total-value{font-size:13px;color:#111827;font-weight:500}
.cdaf-mc-grand{padding-top:10px;border-top:1px solid #f3f4f6;margin-top:3px}
.cdaf-mc-subtotal-strong .cdaf-mc-total-label,
.cdaf-mc-subtotal-strong .cdaf-mc-total-value{font-size:16px;font-weight:700;color:#111827}
.cdaf-mc-grand .cdaf-mc-total-label,
.cdaf-mc-grand .cdaf-mc-total-value{font-size:16px;font-weight:700;color:#111827}

/* Botão checkout */
.cdaf-mc-btn-checkout{
    display:flex;align-items:center;justify-content:center;gap:8px;
    width:100%;padding:14px 24px;
    background:#16a34a;color:#fff;
    border:none;border-radius:8px;
    font-size:14px;font-weight:700;letter-spacing:.4px;
    cursor:pointer;text-decoration:none;
    transition:background .18s,box-shadow .18s;
    will-change:background
}
.cdaf-mc-btn-checkout:disabled{opacity:.6;cursor:default}
.cdaf-mc-btn-ico{display:inline-flex;align-items:center;font-size:14px;line-height:1;background:none!important;color:inherit}
.cdaf-mc-btn-ico svg{width:1em;height:1em;display:block;stroke:currentColor;fill:none}
.cdaf-mc-btn-ico i{font-size:inherit;line-height:1;background:none!important;border:none!important;padding:0!important;margin:0!important}

/* Animação de atualização */
.cdaf-mc-item.cdaf-mc-updating{opacity:.5;pointer-events:none}

/* Carrinho inteiro travado durante add/qty/remove/clear (não só o item mexido) */
.cdaf-mc-busy .cdaf-mc-qty-btn,
.cdaf-mc-busy .cdaf-mc-qty-val,
.cdaf-mc-busy .cdaf-mc-delete,
.cdaf-mc-busy .cdaf-mc-clear-btn{
    pointer-events:none;opacity:.5;cursor:default
}
.cdaf-mc-busy .cdaf-mc-items{position:relative}

/* Pré-renderização: item recém-adicionado mostrado no fim antes do servidor */
.cdaf-mc-item--optimistic{
    animation:cdaf-mc-item-in .22s ease-out, cdaf-mc-pulse 1s ease-in-out infinite;
    pointer-events:none
}
.cdaf-mc-item-adding{font-size:12px;color:#9ca3af}
.cdaf-mc-mini-spinner{
    display:inline-block;width:14px;height:14px;border-radius:50%;
    border:2px solid #e5e7eb;border-top-color:#9ca3af;
    animation:cdaf-mc-spin .7s linear infinite;vertical-align:middle
}
@keyframes cdaf-mc-item-in{
    from{opacity:0;transform:translateY(8px)}
    to{opacity:1;transform:translateY(0)}
}
@keyframes cdaf-mc-pulse{
    0%,100%{background:transparent}
    50%{background:#fffbeb}
}
@keyframes cdaf-mc-spin{to{transform:rotate(360deg)}}

@media(max-width:480px){
    .cdaf-mc-drawer{width:calc(100vw - 16px);margin-right:0}
    .cdaf-mc-drawer--right{right:0;margin-right:8px}
    .cdaf-mc-drawer--left{left:0;margin-left:8px}
}

/* ── Shipping button & modal ─────────────────────────────────────────────── */
.cdaf-mc-ship-btn{
    display:inline-flex;align-items:center;gap:4px;
    background:none;border:none;cursor:pointer;
    font-size:12px;color:#111827;font-weight:500;
    padding:2px 6px;line-height:1.3;text-align:right;white-space:nowrap;
    border-radius:4px
}
.cdaf-mc-ship-btn svg{opacity:.5;flex-shrink:0;margin-top:2px;transition:transform .2s}
.cdaf-mc-ship-btn.open svg{transform:rotate(180deg)}
.cdaf-mc-ship-btn:hover{color:#16a34a}
.cdaf-mc-val-shipping-wrap{display:flex;align-items:center;justify-content:flex-end}

/* Rates inline — dentro do card, sem modal */
/* Ship inline — cobre o body inteiro do drawer por cima */
.cdaf-mc-ship-inline{
    position:absolute;
    bottom:0;left:0;right:0;
    /* sobe até cobrir o body (drawer tem flex-direction:column, footer é o último) */
    top:auto;
    background:#fff;
    border-top:1px solid #f3f4f6;
    max-height:0;overflow:hidden;
    transition:max-height .35s cubic-bezier(.4,0,.2,1);
    z-index:20
}
.cdaf-mc-ship-inline.open{
    max-height:calc(100vh - 120px);
    overflow-y:auto
}
.cdaf-mc-ship-inline .cdaf-mc-ship-rates{
    padding:0 20px;max-height:none;overflow:visible;
}
.cdaf-mc-ship-header{
    display:flex;flex-direction:column;gap:6px;
    padding:14px 0 20px
}
.cdaf-mc-ship-header-top{
    display:flex;align-items:center;justify-content:space-between
}
.cdaf-mc-ship-address{
    font-size:12px;color:#6b7280;line-height:1.4;
    padding:6px 10px;background:#f0fdf4;
    border-radius:6px;border-left:3px solid #bbf7d0
}
.cdaf-mc-ship-address-label{font-weight:500;color:#374151}
.cdaf-mc-ship-address-value{color:#6b7280}
.cdaf-mc-ship-rates-label{
    font-size:11px;font-weight:600;color:#6b7280;
    text-transform:uppercase;letter-spacing:.4px;
    padding:0;display:block
}
.cdaf-mc-ship-close-btn{
    background:none;border:none;cursor:pointer;
    color:#6b7280;padding:4px;display:flex;align-items:center;
    border-radius:4px;transition:color .15s,background .15s
}
.cdaf-mc-ship-inline .cdaf-mc-ship-rate{
    padding:10px 0;border-bottom:1px solid #f3f4f6;border-radius:0;
    gap:10px
}
.cdaf-mc-ship-inline .cdaf-mc-ship-rate:last-child{border-bottom:none}

/* Rates list */
.cdaf-mc-ship-rates{padding:8px 0}
.cdaf-mc-ship-rate{
    display:flex;align-items:center;gap:14px;
    padding:14px 20px;cursor:pointer;
    border-bottom:1px solid #f3f4f6;
    transition:background .12s;background:#fff
}
.cdaf-mc-ship-rate:last-child{border-bottom:none}
.cdaf-mc-ship-rate:hover{background:transparent}
.cdaf-mc-ship-rate.selected{background:transparent}

.cdaf-mc-ship-radio{
    width:14px;height:14px;flex-shrink:0;
    border:1.5px solid #d1d5db;border-radius:50%;
    display:flex;align-items:center;justify-content:center;
    transition:border-color .15s
}
.cdaf-mc-ship-rate.selected .cdaf-mc-ship-radio{border-color:#16a34a}
.cdaf-mc-ship-radio-dot{
    width:6px;height:6px;border-radius:50%;
    background:#16a34a;display:none
}
.cdaf-mc-ship-rate.selected .cdaf-mc-ship-radio-dot{display:block}

.cdaf-mc-ship-rate-info{flex:1;min-width:0}
.cdaf-mc-ship-rate-name{
    font-size:12px;font-weight:600;color:#111827;
    display:flex;align-items:center;flex-wrap:wrap;gap:4px;line-height:1.3
}
.cdaf-mc-ship-rate-prazo{font-size:11px;color:#6b7280;margin-top:1px}
.cdaf-mc-ship-rate-price{
    font-size:12px;font-weight:700;color:#111827;white-space:nowrap
}
.cdaf-mc-ship-rate-price.free{color:#16a34a}

/* Badges */
.cdaf-mc-badge-rate{
    display:inline-flex;align-items:center;gap:3px;
    font-size:10px;font-weight:600;
    padding:2px 7px;border-radius:20px;
    line-height:1.4;white-space:nowrap
}
.cdaf-mc-badge-fast{background:#eff6ff;color:#2563eb}
.cdaf-mc-badge-cheap{background:#f0fdf4;color:#16a34a}
