/* Estilos para el icono del carrito en el header */
.header-carrito {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.icono-carrito {
    position: relative;
    display: inline-block;
    cursor: pointer;
    background-color: #fff;
    padding: 10px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.icono-carrito img {
    width: 30px;
    height: 30px;
}

.carrito-contador {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    display: none;
    /* Se muestra con JS si hay items */
}

/* Estilos para el botón "Pedir" en el catálogo */
/* Estilos para el botón "Pedir" en el catálogo */
.btn-pedir {
    background-color: #9b59b6;
    /* Theme purple */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    /* Smoother rounding */
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    width: 100%;
    transition: background-color 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    /* Space between icon and text */
    font-size: 16px;
    /* Slightly larger text */
    text-transform: capitalize;
    /* "Agregar" format */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-pedir:hover {
    background-color: #9575cd;
    /* Darker shade for hover */
}

/* Estilos para la página del carrito (carrito.php) */
.carrito-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.carrito-tabla {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.carrito-tabla th,
.carrito-tabla td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.carrito-tabla th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.carrito-input-cantidad {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn-eliminar {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.carrito-resumen {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* Alinea todo a la derecha */
    margin-top: 20px;
    padding: 20px;
    border-top: 2px solid #eee;
}

.carrito-total {
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 20px;
}

.carrito-botones {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Espacio entre botones */
    width: 100%;
    max-width: 300px;
    /* Ancho máximo para los botones */
}

.btn-confirmar {
    background-color: #28a745;
    /* Verde */
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: background-color 0.3s;
}

.btn-confirmar:hover {
    background-color: #218838;
}

.btn-volver {
    background-color: #007bff;
    /* Azul */
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    text-decoration: none;
    /* Porque será un enlace (a) */
    display: inline-block;
    /* Para comportarse como bloque/botón */
    transition: background-color 0.3s;
}

.btn-volver:hover {
    background-color: #0056b3;
}

.btn-vaciar {
    background-color: #343a40;
    /* Gris oscuro / Azulado */
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: background-color 0.3s;
}

.btn-vaciar:hover {
    background-color: #23272b;
}

.mensaje-vacio {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.2em;
}

@media screen and (max-width: 768px) {
    .carrito-container {
        padding: 10px;
        margin: 20px 10px;
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 20px;
        border: 1px solid #eee;
    }

    .carrito-tabla {
        width: 100%;
        min-width: 600px;
        /* Force table to retain width for readability */
    }

    .carrito-botones {
        width: 100%;
        max-width: none;
        align-items: stretch;
    }

    .btn-confirmar,
    .btn-volver,
    .btn-vaciar {
        width: 100%;
    }

    .carrito-resumen {
        padding: 15px;
        width: 100%;
        align-items: stretch;
    }

    .carrito-total {
        text-align: right;
    }
}