/* ======================================= */
/* 1. Estilos Base y Reset */
/* ======================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    line-height: 1.6;
}

/* ======================================= */
/* 2. Encabezado y Resumen del Carrito */
/* ======================================= */

.encabezado-kiosco {
    background-color: #ff6f61; /* Rojo Coral vibrante */
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.encabezado-kiosco h1 {
    font-size: 1.8em;
}

.resumen-carrito {
    display: flex;
    align-items: center;
    gap: 20px;
}

.carrito-info span {
    margin-left: 20px;
    font-weight: bold;
    font-size: 1.1em;
}

/* Botón Vaciar Carrito (en header) */
.boton-quitar-todo {
    background-color: #ff3333;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: bold;
}

.boton-quitar-todo:hover {
    background-color: #cc0000;
}

/* ======================================= */
/* 3. Layout Principal (Productos + Detalle) */
/* ======================================= */

.contenedor-principal {
    display: flex;
    max-width: 1400px;
    margin: 30px auto;
    gap: 30px;
    padding: 0 30px;
}

.contenedor-productos {
    /* Ocupa 3/4 del espacio (para mostrar la mayoría de los productos) */
    flex: 3; 
    display: grid;
    /* Grid responsivo: min 220px por columna */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
    gap: 30px;
}

/* ======================================= */
/* 4. Tarjetas de Productos */
/* ======================================= */

.producto {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Empuja el botón hacia abajo */
}

.producto:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.producto img {
    width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: contain;
    border-radius: 5px;
    margin-bottom: 15px;
}

.producto h2 {
    font-size: 1.4em;
    margin-bottom: 8px;
    color: #333;
}

.precio {
    font-size: 1.2em;
    color: #4CAF50; /* Verde para el precio */
    font-weight: bold;
    margin-bottom: 15px;
}

/* Estilo para el botón AGREGAR */
.boton-agregar {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s;
    width: 100%;
    margin-top: auto; /* Asegura que el botón esté siempre en la parte inferior */
    font-weight: bold;
}

.boton-agregar:hover {
    background-color: #45a049;
}

/* ======================================= */
/* 5. Detalle del Carrito (Barra Lateral) */
/* ======================================= */

.carrito-detalle {
    /* Ocupa 1/4 del espacio */
    flex: 1; 
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    /* Para quiosco, es importante que se pueda hacer scroll si hay muchos items */
    max-height: 80vh; 
    overflow-y: auto; 
}

.carrito-detalle h2 {
    margin-bottom: 20px;
    border-bottom: 2px solid #ff6f61;
    padding-bottom: 10px;
    font-size: 1.5em;
    color: #333;
}

.carrito-vacio {
    text-align: center;
    color: #999;
    padding: 20px 0;
    font-style: italic;
}

/* Estilo para cada item en el carrito */
.item-carrito {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
}

.item-info {
    font-size: 1em;
    line-height: 1.4;
}

.item-info span {
    font-weight: bold;
    color: #555;
    display: block;
}

/* Botón de Quitar Individual */
.btn-quitar-item {
    background-color: #f44336; /* Rojo para Quitar */
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
    font-weight: bold;
}

.btn-quitar-item:hover {
    background-color: #d32f2f;
}

/* ======================================= */
/* 6. Pie de Página */
/* ======================================= */

.pie-pagina {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 15px 0;
    margin-top: 30px;
}

/* ======================================= */
/* 7. Responsive Básico (Para Quioscos/Tablets) */
/* ======================================= */

@media (max-width: 900px) {
    .contenedor-principal {
        flex-direction: column; /* Apila los productos y el carrito verticalmente */
        padding: 0 15px;
    }

    .contenedor-productos {
        flex: auto; /* Permite que ocupe todo el ancho disponible */
    }

    .carrito-detalle {
        flex: auto;
        max-height: none; /* Desactiva la altura fija en móviles/tablets */
        order: -1; /* Mueve el carrito arriba de los productos para que sea visible */
    }
}