/* Estilos generales del carrito */

.carrito-btn {
    background-color: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

.carrito-btn:hover {
    color: #8f0000; /* Color al pasar el mouse por encima */
}

.carrito-contador {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #e74c3c;
    color: white;
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 50%;
}


/* Estilos generales del carrito */
.carrito {
    position: fixed;
    top: 0;
    right: -100%;
    width: 360px;
    max-width: 100%;
    height: 100vh;
    background-color: #000000;
    overflow-y: auto;
    transition: 0.3s ease-out;
    z-index: 1000;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
}

.carrito.visible {
    right: 0;
}

.btn-close {
    background: transparent;
    border: none;
    color: rgb(255, 255, 255);
    font-size: 24px;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 20px;
}

.btn-close:hover {
    color: rgb(128, 0, 0);
}

.carrito .header-carrito {
    padding: 20px;
    background-color: #700000;
    position: sticky;
    top: 0;
    z-index: 1;
}

.carrito .carrito-items {
    padding: 20px;
}

.carrito .carrito-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.carrito .carrito-item img {
    width: 80px;
    margin-right: 20px;
}

.carrito .carrito-item-detalles {
    flex-grow: 1;
}

.carrito .carrito-item .selector-cantidad{
    display: inline-block;
    margin-right: 25px;
}

.carrito .carrito-item .selector-cantidad i{
    font-size: 18px;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    border: 1px solid #000;
    cursor: pointer;
}

.carrito-item-cantidad{
    background: #fff;
    color: #000;
    border: none;
    border-radius: .5em;
}

.carrito-total {
    background-color: #800000;
    padding: 20px;
    position: sticky;
    bottom: 0;
}

.btn-eliminar {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #ff0000;
    cursor: pointer;
}

.carrito .carrito-item .btn-eliminar i{
    pointer-events: none;
}

.carrito-total {
    background-color: #000000;
    padding: 20px;
    position: sticky;
    bottom: 0;
}

.carrito-total .btn-pagar{
    display: block;
    width: 100%;
    border: none;
    background: #700000;
    color: #fff;
    border-radius: 5px;
    font-size: 18px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: .3s;
}
.carrito-total .btn-pagar:hover{
    scale: 1.05;
    color: #fff;
}


/* Estilos responsive */
@media screen and (max-width: 850px) {

    .carrito {
        width: 100%;
    }

    .carrito-btn {
        /* Asegúrate de que el botón sea visible y fácil de hacer clic */
        display: block;
        position: fixed; /* o absolute, dependiendo de tu diseño */
        top: 10px; /* ajusta según sea necesario */
        right: 10px; /* ajusta según sea necesario */
        z-index: 1001; /* asegúrate de que esté por encima de otros elementos */
    }
    
    .carrito-contador {
        font-size: 0.6rem;
        padding: 1px 4px;
    }

    .carrito .carrito-item img {
        width: 60px;
        margin-right: 10px;
    }

    .carrito .header-carrito {
        padding: 15px;
    }

    .carrito-total {
        padding: 15px;
    }

    .carrito-total .btn-pagar {
        font-size: 16px;
        padding: 10px;
    }
}