/* Botón flotante del carrito */
.btn-flotante-carrito {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #000;
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.3s;
    border: 2px solid #fff;
}

.btn-flotante-carrito:hover {
    transform: scale(1.1);
}

.contador-carrito {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: red;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

/* Modal del carrito */
.modal-carrito {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background-color: #fff;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.4s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    padding: 0 0 30px 0;
    overflow: hidden;
}

.modal-carrito.activo {
    right: 0;
}

.carrito-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 20px;
    margin: 0;
    flex-shrink: 0;
}

.carrito-header h3 {
    margin: 0;
    font-size: 20px;
}

.carrito-items {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    min-height: 0;
}

.item-carrito {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #f9f9f9;
    padding-bottom: 10px;
}

.item-carrito img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

/* Badge de cantidad en la miniatura */
.cantidad-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid #fff;
    z-index: 10;
}

.item-info {
    flex: 1;
}

.item-info h4 {
    font-size: 14px;
    margin: 0;
}

.item-info p {
    font-size: 12px;
    color: #666;
    margin: 5px 0 0;
}

.btn-eliminar {
    margin-left: auto;
    background: none;
    border: none;
    color: rgb(26, 19, 19);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

.carrito-footer {
    border-top: 1px solid #eee;
    padding: 20px;
    margin-bottom: 30px;
    flex-shrink: 0;
    background-color: #fff;
}

.total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.btn-checkout {
    width: 100%;
    padding: 15px;
    background-color: #25d365ef;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn-checkout:hover {
    background-color: #128C7E;
}

.btn-vaciar {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background-color: #000000;
    color: white;
    border-radius: 8px;
    border:none;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-vaciar:hover {
    background-color: #cc3c3c;
    color: #ffffff;
    border-color: #dc3545;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.2);
}

.btn-vaciar:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.btn-cerrar {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #000;
    padding: 0;
    line-height: 1;
}

/* Controles de cantidad +/- */
.controles-cantidad {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.btn-decrementar,
.btn-incrementar {
    background: #fff;
    color: #000;
    border: 1.5px solid #000;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: none;
}

.btn-decrementar:hover,
.btn-incrementar:hover {
    background: #000;
    color: #fff;
    transform: scale(1.05);
}

.btn-decrementar:active,
.btn-incrementar:active {
    transform: scale(0.95);
}

.cantidad-texto {
    font-size: 13px;
    font-weight: 500;
    color: #000;
    min-width: 24px;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Botón eliminar todas las unidades */
.btn-eliminar-todo {
    margin-left: auto;
    background: #fff;
    border: 1.5px solid #000;
    color: #000;
    cursor: pointer;
    font-size: 18px;
    padding: 6px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-weight: 300;
}

.btn-eliminar-todo:hover {
    background: #000;
    color: #fff;
    transform: rotate(90deg) scale(1.05);
}

.btn-eliminar-todo:active {
    transform: rotate(90deg) scale(0.95);
}

/* Responsive */
@media (max-width: 480px) {
    .modal-carrito {
        max-width: 100%;
    }
}