/* =========================================================
   CARRITO DE COMPRAS
   ========================================================= */

/* BOTÓN FLOTANTE DEL CARRITO */
.carrito-flotante {
    position: fixed !important;
    right: 28px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;

    width: 64px;
    height: 64px;

    background: #17145b !important;
    color: white !important;

    border: none;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    z-index: 99999 !important;

    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.20);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}

/* EFECTO AL PASAR EL MOUSE */
.carrito-flotante:hover {
    background: #211d78 !important;
    transform: translateY(-50%) scale(1.08) !important;
    box-shadow: 0 10px 30px rgba(23, 20, 91, 0.35);
}

/* ICONO */
.carrito-flotante i,
.carrito-flotante span.icono-carrito {
    font-size: 28px;
    color: white !important;
}

/* CONTADOR */
.carrito-contador {
    position: absolute;

    top: -5px;
    right: -5px;

    min-width: 25px;
    height: 25px;

    padding: 0 6px;

    background: #ff6b00 !important;
    color: white !important;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 13px;
    font-weight: 800;

    border: 3px solid white;

    box-sizing: border-box;
}


/* =========================================================
   PANEL DEL CARRITO
   ========================================================= */

.carrito-panel {
    position: fixed !important;

    top: 0;
    right: -430px;

    width: 400px;
    max-width: 92vw;
    height: 100vh;

    background: white;

    z-index: 100000 !important;

    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.18);

    display: flex;
    flex-direction: column;

    transition: right 0.35s ease;

    overflow: hidden;
}

/* PANEL ABIERTO */
.carrito-panel.abierto {
    right: 0 !important;
}


/* =========================================================
   ENCABEZADO
   ========================================================= */

.carrito-header {
    background: #17145b;

    color: white;

    padding: 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.carrito-header h2 {
    margin: 0;

    font-size: 24px;
    font-weight: 800;
}

.carrito-cerrar {
    width: 38px;
    height: 38px;

    border: none;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.15);

    color: white;

    font-size: 22px;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: background 0.2s ease;
}

.carrito-cerrar:hover {
    background: rgba(255, 255, 255, 0.28);
}


/* =========================================================
   PRODUCTOS DEL CARRITO
   ========================================================= */

.carrito-productos {
    flex: 1;

    padding: 20px;

    overflow-y: auto;
}

/* PRODUCTO */
.carrito-producto {
    display: flex;

    align-items: center;

    gap: 14px;

    padding: 15px 0;

    border-bottom: 1px solid #eeeeee;
}

.carrito-producto img {
    width: 75px;
    height: 75px;

    object-fit: contain;

    border-radius: 10px;

    background: #f7f7f7;
}

.carrito-producto-info {
    flex: 1;
}

.carrito-producto-info h3 {
    margin: 0 0 5px;

    font-size: 16px;

    color: #17145b;
}

.carrito-producto-precio {
    margin: 0;

    color: #ff6b00;

    font-weight: 800;
}


/* =========================================================
   CONTROLES DE CANTIDAD
   ========================================================= */

.carrito-cantidad {
    display: flex;

    align-items: center;

    gap: 8px;

    margin-top: 10px;
}

.carrito-cantidad button {
    width: 28px;
    height: 28px;

    border: none;

    border-radius: 6px;

    background: #17145b;

    color: white;

    font-size: 17px;

    font-weight: 700;

    cursor: pointer;
}

.carrito-cantidad button:hover {
    background: #211d78;
}

.carrito-cantidad span {
    min-width: 20px;

    text-align: center;

    font-weight: 700;
}


/* =========================================================
   BOTÓN ELIMINAR
   ========================================================= */

.carrito-eliminar {
    border: none;

    background: transparent;

    color: #777;

    font-size: 18px;

    cursor: pointer;
}

.carrito-eliminar:hover {
    color: #e00000;
}


/* =========================================================
   CARRITO VACÍO
   ========================================================= */

.carrito-vacio {
    text-align: center;

    padding: 50px 20px;

    color: #777;
}

.carrito-vacio i {
    font-size: 50px;

    color: #17145b;

    margin-bottom: 15px;
}

.carrito-vacio p {
    margin: 0;

    font-size: 16px;
}


/* =========================================================
   RESUMEN
   ========================================================= */

.carrito-resumen {
    padding: 20px;

    border-top: 1px solid #eeeeee;

    background: white;
}

.carrito-subtotal,
.carrito-total {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 10px;
}

.carrito-subtotal {
    color: #555;

    font-size: 16px;
}

.carrito-total {
    color: #17145b;

    font-size: 22px;

    font-weight: 800;

    padding-top: 10px;

    border-top: 1px solid #eeeeee;
}


/* =========================================================
   BOTÓN FINALIZAR COMPRA
   ========================================================= */

.btn-finalizar-compra {
    width: 100%;

    margin-top: 15px;

    padding: 15px;

    border: none;

    border-radius: 10px;

    background: #ff6b00;

    color: white;

    font-size: 16px;

    font-weight: 800;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.btn-finalizar-compra:hover {
    background: #e85d00;

    transform: translateY(-2px);
}


/* =========================================================
   FONDO OSCURO CUANDO SE ABRE EL CARRITO
   ========================================================= */

.carrito-overlay {
    position: fixed;

    inset: 0;

    background: rgba(0, 0, 0, 0.45);

    z-index: 99998;

    opacity: 0;

    visibility: hidden;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.carrito-overlay.activo {
    opacity: 1;

    visibility: visible;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 700px) {

    .carrito-flotante {
        right: 18px !important;

        width: 58px;
        height: 58px;
    }

    .carrito-panel {
        width: 100%;
        max-width: 100%;
    }
}