/* Carrito flotante (se carga en todo el sitio) */
.ewv-fc {
    position: fixed; right: 22px; bottom: 22px; z-index: 9990;
    font-family: inherit; line-height: 1.4;
}
.ewv-fc.is-empty { display: none; }

.ewv-fc-btn {
    position: relative;
    width: 58px; height: 58px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%;
    background: var(--pc-accent, #cd4665); color: #fff;
    box-shadow: 0 10px 28px rgba(0,0,0,.22);
    cursor: pointer; transition: transform .25s, box-shadow .25s;
}
.ewv-fc-btn:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 14px 34px rgba(0,0,0,.28); }
.ewv-fc-btn svg { width: 26px; height: 26px; }
.ewv-fc-count {
    position: absolute; top: -5px; right: -5px;
    min-width: 22px; height: 22px; padding: 0 6px; box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
    border-radius: 999px; border: 2px solid var(--pc-accent, #cd4665);
    background: #fff; color: var(--pc-accent, #cd4665);
    font-size: .75rem; font-weight: 700; line-height: 1;
}
.ewv-fc.is-bump .ewv-fc-btn { animation: ewvbump .6s ease; }
@keyframes ewvbump {
    0% { transform: scale(1); } 30% { transform: scale(1.22); } 60% { transform: scale(.94); } 100% { transform: scale(1); }
}

/* fondo oscuro */
.ewv-fc-ov {
    position: fixed; inset: 0; z-index: 9991;
    background: rgba(20,32,26,.35);
    opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.ewv-fc.is-open .ewv-fc-ov { opacity: 1; visibility: visible; }

/* ventana */
.ewv-fc-pop {
    position: fixed; right: 22px; bottom: 92px; z-index: 9992;
    width: 390px; max-width: calc(100vw - 24px);
    max-height: min(72vh, 600px);
    display: flex; flex-direction: column;
    background: #fff; color: var(--pc-contrast, #2d4a3e);
    border: var(--pc-bw, 1px) solid var(--pc-bc, rgba(205,70,101,.2));
    border-radius: var(--pc-radius-lg, 28px);
    box-shadow: 0 24px 60px rgba(0,0,0,.25);
    overflow: hidden;
    opacity: 0; visibility: hidden; transform: translateY(14px) scale(.98);
    transition: opacity .25s, transform .25s, visibility .25s;
}
.ewv-fc.is-open .ewv-fc-pop { opacity: 1; visibility: visible; transform: none; }

.ewv-fc-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--pc-line, rgba(205,70,101,.2));
}
.ewv-fc-head strong { font-size: 1.05rem; }
.ewv-fc-n { margin-left: 6px; font-size: .8rem; color: #8a8a8a; }
.ewv-fc-close {
    width: 36px; height: 36px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--pc-line, rgba(205,70,101,.2)); border-radius: 50%;
    background: #fff; color: var(--pc-accent, #cd4665); cursor: pointer; transition: all .2s;
}
.ewv-fc-close:hover { background: var(--pc-accent, #cd4665); color: #fff; }

.ewv-fc-body { flex: 1; overflow-y: auto; padding: 6px 20px; }
.ewv-fc-list { list-style: none; margin: 0; padding: 0; }
.ewv-fc-item {
    display: grid; grid-template-columns: 58px 1fr 32px; gap: 12px; align-items: center;
    padding: 12px 0; margin: 0;
    border-bottom: 1px solid rgba(0,0,0,.06);
    transition: opacity .2s;
}
.ewv-fc-item:last-child { border-bottom: 0; }
.ewv-fc-item.is-loading { opacity: .4; pointer-events: none; }
.ewv-fc-thumb img { display: block; width: 58px; height: 58px; object-fit: cover; border-radius: 12px; }
.ewv-fc-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ewv-fc-name { color: var(--pc-contrast, #2d4a3e) !important; font-weight: 600; font-size: .95rem; text-decoration: none; overflow-wrap: anywhere; }
.ewv-fc-name:hover { color: var(--pc-accent, #cd4665) !important; }
.ewv-fc-line { font-size: .85rem; color: var(--pc-accent, #cd4665); font-weight: 600; }
.ewv-fc-info dl.variation { margin: 0; font-size: .75rem; color: #888; }
.ewv-fc-info dl.variation dt, .ewv-fc-info dl.variation dd, .ewv-fc-info dl.variation p { display: inline; margin: 0; }
.ewv-fc-rm {
    width: 30px; height: 30px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--pc-line, rgba(205,70,101,.2)); border-radius: 50%;
    background: #fff; color: #9a9a9a; cursor: pointer; transition: all .2s;
}
.ewv-fc-rm:hover { background: var(--pc-accent, #cd4665); border-color: var(--pc-accent, #cd4665); color: #fff; }

.ewv-fc-foot { padding: 14px 20px 20px; border-top: 1px solid var(--pc-line, rgba(205,70,101,.2)); background: #fff; }
.ewv-fc-sub { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; font-size: .95rem; }
.ewv-fc-sub strong { font-size: 1.15rem; color: var(--pc-accent, #cd4665); }
.ewv-fc-go {
    display: block; text-align: center; padding: 15px 20px;
    border-radius: 999px; background: var(--pc-accent, #cd4665); color: #fff !important;
    font-weight: 600; letter-spacing: .5px; text-decoration: none !important;
    transition: background .25s, transform .25s;
}
.ewv-fc-go:hover { background: var(--pc-contrast, #2d4a3e); transform: translateY(-2px); }
.ewv-fc-view {
    display: block; text-align: center; margin-top: 12px;
    font-size: .88rem; color: var(--pc-contrast, #2d4a3e) !important; text-decoration: underline !important;
}

/* barra de envío gratis dentro de la ventana */
.ewv-fc .mc-ship { margin: 12px 0 4px; padding: 12px 14px; background: var(--pc-accent-soft, rgba(205,70,101,.08)); border-radius: 16px; }
.ewv-fc .mc-ship-msg { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .85rem; }
.ewv-fc .mc-ship-msg svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--pc-accent, #cd4665); }
.ewv-fc .mc-ship-msg strong { color: var(--pc-accent, #cd4665); }
.ewv-fc .mc-ship-track { height: 7px; border-radius: 99px; background: #fff; overflow: hidden; }
.ewv-fc .mc-ship-track span { display: block; height: 100%; border-radius: 99px; background: var(--pc-accent, #cd4665); transition: width .5s; }
.ewv-fc .mc-ship.is-done .mc-ship-track span { background: #25a05a; }
.ewv-fc .mc-ship.is-done .mc-ship-msg svg { color: #25a05a; }

/* móvil: el carrito se abre desde abajo */
@media (max-width: 600px) {
    .ewv-fc { right: 14px; bottom: 16px; }
    .ewv-fc-btn { width: 54px; height: 54px; }
    .ewv-fc-pop {
        left: 0; right: 0; bottom: 0; width: auto; max-width: none; max-height: 84vh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .ewv-fc.is-open .ewv-fc-pop { transform: none; }
    html.ewv-fc-lock { overflow: hidden; }
}
/* en la ficha de producto móvil sube sobre la barra fija de compra */
@media (max-width: 800px) {
    body.single-product .ewv-fc { bottom: 96px; }
}
@media (max-width: 600px) {
    body.single-product .ewv-fc-pop { bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .ewv-fc *, .ewv-fc-pop, .ewv-fc-ov { transition: none !important; animation: none !important; }
}
