/* =========================================================
   CARRITO (se carga en todo el sitio)
========================================================= */

.fe-carrito-boton[hidden],
.fe-carrito-aviso[hidden],
.fe-carrito-banner[hidden] {
    display: none !important;
}

.fe-carrito-boton,
.fe-carrito-panel,
.fe-carrito-aviso,
.fe-carrito-banner {
    font-family: var(--fe-fuente, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
    color: #111;
    box-sizing: border-box;
}

.fe-carrito-panel *,
.fe-carrito-aviso *,
.fe-carrito-banner * {
    box-sizing: border-box;
}


/* ---------- Botón flotante ---------- */

.fe-carrito-boton {
    position: fixed;
    right: 20px;
    bottom: 96px;
    z-index: 9990;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 56px;
    height: 56px;

    border: 0;
    border-radius: 50%;

    background: #111;
    color: #fff;

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.fe-carrito-boton svg {
    width: 26px;
    height: 26px;
}

.fe-carrito-contador {
    position: absolute;
    top: -4px;
    right: -4px;

    min-width: 22px;
    height: 22px;
    padding: 0 6px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 2px solid #fff;
    border-radius: 999px;

    background: #fff;
    color: #111;

    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.fe-carrito-pulso {
    animation: fe-carrito-pulso 0.5s ease;
}

@keyframes fe-carrito-pulso {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.18); }
    100% { transform: scale(1); }
}


/* ---------- Aviso al agregar ---------- */

.fe-carrito-aviso {
    position: fixed;
    left: 50%;
    bottom: 96px;
    z-index: 10040;

    transform: translateX(-50%);

    display: flex;
    align-items: center;
    gap: 14px;

    max-width: calc(100% - 40px);
    padding: 12px 18px;

    border-radius: 10px;

    background: #111;
    color: #fff;

    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.fe-carrito-aviso button {
    padding: 6px 12px;

    border: 1px solid #fff;
    border-radius: 6px;

    background: transparent;
    color: #fff;

    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}


/* ---------- Panel lateral ---------- */

.fe-carrito-panel {
    position: fixed;
    inset: 0;
    z-index: 10050;

    visibility: hidden;
    pointer-events: none;
}

.fe-carrito-panel.abierto {
    visibility: visible;
    pointer-events: auto;
}

.fe-carrito-fondo {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.fe-carrito-panel.abierto .fe-carrito-fondo {
    opacity: 1;
}

.fe-carrito-caja {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;

    width: min(480px, 100%);

    display: flex;
    flex-direction: column;

    background: #fff;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.25);

    transform: translateX(100%);
    transition: transform 0.28s ease;
}

.fe-carrito-panel.abierto .fe-carrito-caja {
    transform: translateX(0);
}

.fe-carrito-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.fe-carrito-cabecera h2 {
    margin: 0;
    font-size: 22px;
}

.fe-carrito-cerrar {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background: #eee;

    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.fe-carrito-cuerpo {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
}

.fe-carrito-pie {
    padding: 16px 20px 20px;
    border-top: 1px solid #e5e5e5;
    background: #fafafa;
}

.fe-carrito-mensaje {
    padding: 30px 10px;
    text-align: center;
    color: #666;
}

.fe-carrito-mensaje strong {
    display: block;
    margin-bottom: 8px;
    color: #111;
    font-size: 18px;
}


/* ---------- Eventos dentro del carrito ---------- */

.fe-carrito-linea {
    margin-bottom: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.fe-carrito-linea:last-child {
    border-bottom: 0;
}

.fe-carrito-linea-cab {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.fe-carrito-evento {
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    color: #111;
}

.fe-carrito-link {
    padding: 0;

    border: 0;
    background: none;

    color: #666;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
}

.fe-carrito-link:hover {
    color: #111;
}

.fe-carrito-fotos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;

    max-height: 260px;
    margin-bottom: 12px;
    overflow-y: auto;
}

.fe-carrito-foto {
    position: relative;
}

.fe-carrito-foto img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
    background: #eee;
}

.fe-carrito-foto-nombre {
    display: block;
    margin-top: 3px;
    overflow: hidden;

    font-size: 11px;
    color: #666;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fe-carrito-quitar-foto {
    position: absolute;
    top: 4px;
    right: 4px;

    width: 24px;
    height: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.75);
    color: #fff;

    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.fe-carrito-detalle {
    margin: 0 0 6px;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: #444;
}

.fe-carrito-detalle li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 2px;
}

.fe-carrito-ahorro {
    margin: 6px 0;
    padding: 8px 10px;

    border-radius: 6px;

    background: #f2f2f2;
    color: #111;

    font-size: 13px;
    font-weight: 600;
}

.fe-carrito-consejo {
    margin: 6px 0;
    font-size: 12px;
    color: #666;
}

.fe-carrito-subtotal {
    display: flex;
    justify-content: space-between;
    margin: 8px 0 0;
    font-size: 15px;
    font-weight: 700;
}

.fe-carrito-linea-error {
    padding: 12px 14px;

    border: 1px dashed #b3261e;
    border-radius: 8px;

    background: #fdecea;
}

.fe-carrito-linea-error p {
    margin: 0;
    font-size: 13px;
    color: #b3261e;
}


/* ---------- Pie: totales y botones ---------- */

.fe-carrito-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 4px;
}

.fe-carrito-total span {
    font-size: 15px;
    color: #444;
}

.fe-carrito-total strong {
    font-size: 26px;
}

.fe-carrito-ahorro-total {
    margin: 0 0 12px;
    font-size: 13px;
    color: #444;
}

.fe-carrito-acciones {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.fe-carrito-btn {
    flex: 1 1 auto;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 14px 18px;
    line-height: 1;

    border: 2px solid #111;
    border-radius: 6px;

    background: #fff;
    color: #111;

    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.fe-carrito-btn-principal {
    background: #111;
    color: #fff;
}

.fe-carrito-btn-whatsapp {
    border-color: #25d366;
    background: #25d366;
    color: #fff;
}

.fe-carrito-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.fe-carrito-acciones .fe-carrito-link {
    flex: 0 0 100%;
    text-align: center;
}


/* ---------- Datos del cliente ---------- */

.fe-carrito-resumen {
    margin-bottom: 20px;
    padding: 16px;

    border-radius: 10px;

    background: #f7f7f7;
}

.fe-carrito-resumen p {
    display: flex;
    justify-content: space-between;
    margin: 0 0 6px;
    font-size: 14px;
}

.fe-carrito-campo {
    margin-bottom: 14px;
}

.fe-carrito-campo label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
}

.fe-carrito-campo input {
    width: 100%;
    padding: 12px;

    border: 1px solid #ddd;
    border-radius: 6px;

    font-size: 15px;
    font-family: inherit;
}

.fe-carrito-campo input:focus {
    outline: 2px solid #111;
    outline-offset: 1px;
}

.fe-carrito-nota {
    margin: 4px 0 0;
    font-size: 13px;
    color: #555;
}

.fe-carrito-error {
    margin: 12px 0 0;
    padding: 10px 12px;

    border-radius: 6px;

    background: #fdecea;
    color: #b3261e;

    font-size: 13px;
}


/* ---------- Banner al volver de Mercado Pago ---------- */

.fe-carrito-banner {
    position: fixed;
    top: 16px;
    left: 50%;
    z-index: 10060;

    transform: translateX(-50%);

    width: min(560px, calc(100% - 32px));
    padding: 16px 44px 16px 18px;

    border-radius: 10px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.fe-carrito-banner strong {
    display: block;
    margin-bottom: 4px;
}

.fe-carrito-banner p {
    margin: 0;
    font-size: 14px;
}

.fe-carrito-banner button {
    position: absolute;
    top: 8px;
    right: 8px;

    width: 28px;
    height: 28px;

    border: 0;
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.1);

    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.fe-carrito-banner-success { background: #e6f7ec; color: #0a5c2e; }
.fe-carrito-banner-pending { background: #fff6e5; color: #8a5a00; }
.fe-carrito-banner-failure { background: #fdecea; color: #b3261e; }


@media (max-width: 600px) {

    .fe-carrito-boton {
        right: 14px;
        bottom: 88px;
    }

    .fe-carrito-fotos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}
