* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #222;
}

header {
    background: white;
    padding: 25px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

header h1 {
    margin: 0;
}

header p {
    margin-bottom: 0;
    color: #666;
}

main {
    max-width: 900px;
    margin: auto;
    padding: 20px;
}


/* ================================
   MENÚ CLIENTE
================================ */

#productos {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(220px, 1fr)
        );
    gap: 20px;
}

.producto {
    background: white;
    border-radius: 14px;
    padding: 20px;
    transition: 0.2s;
}

.producto h3 {
    margin-top: 0;
}

.precio {
    font-size: 22px;
    font-weight: bold;
}

.disponibles {
    color: #666;
}

.producto.agotado {
    opacity: 0.65;
}

.texto-agotado {
    font-weight: bold;
}

.agregar:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}

.mensaje-menu-cerrado {
    background: white;
    padding: 30px;
    border-radius: 14px;
    text-align: center;
}


/* ================================
   BOTONES
================================ */

button {
    border: none;
    border-radius: 8px;
    padding: 12px 18px;
    cursor: pointer;
    font-size: 16px;
}

button:disabled {
    cursor: not-allowed;
}

.agregar,
.boton-principal {
    background: #222;
    color: white;
}

.boton-secundario {
    background: #ddd;
    color: #222;
}


/* ================================
   CARRITO
================================ */

#carrito {
    margin-top: 35px;
    background: white;
    padding: 25px;
    border-radius: 14px;
}

.item-carrito {
    border-bottom: 1px solid #ddd;
    padding: 12px 0;
}

.botones-carrito {
    display: flex;
    gap: 8px;
}

input,
textarea,
select {
    width: 100%;
    margin: 10px 0;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-family: inherit;
}

#confirmarPedido {
    width: 100%;
    background: #222;
    color: white;
    margin-top: 10px;
}


/* ================================
   LOGIN / ADMIN GENERAL
================================ */

.panel-admin {
    max-width: 500px;
    margin: 40px auto;
    background: white;
    padding: 30px;
    border-radius: 14px;
}

.encabezado-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.botones-admin-superiores {
    display: flex;
    gap: 10px;
    align-items: center;
}

.boton-cerrar-menu {
    background: #333;
    color: white;
}


/* ================================
   PEDIDOS
================================ */

.acciones-pedidos {
    margin-bottom: 20px;
}

.pedido-card {
    background: white;
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 20px;
}

.pedido-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pedido-cabecera h3 {
    margin: 0;
}

.hora-pedido {
    color: #666;
}

.estado-pedido {
    font-weight: bold;
}

.datos-cliente {
    margin: 20px 0;
}

.productos-pedido {
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    padding: 15px 0;
}

.producto-pedido {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
}

.total-pedido {
    font-size: 20px;
    font-weight: bold;
    margin-top: 20px;
}

.acciones-estado {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.acciones-estado select {
    flex: 1;
}

.acciones-estado button {
    background: #222;
    color: white;
}


/* ================================
   ADMIN PRODUCTOS
================================ */

.admin-formulario {
    background: white;
    border-radius: 14px;
    padding: 25px;
    margin-bottom: 30px;
}

.productos-admin {
    margin-top: 30px;
}

.producto-admin-card {
    background: white;
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 20px;
}

.producto-admin-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.producto-admin-card label {
    display: block;
    margin-top: 12px;
    font-weight: bold;
}

.switch-activo {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
}

.switch-activo input {
    width: auto;
    margin: 0;
}

.producto-admin-card button {
    margin-top: 15px;
}

.producto-activo {
    font-weight: bold;
}

.producto-inactivo {
    color: #777;
    font-weight: bold;
}

.sin-productos-admin {
    background: white;
    padding: 25px;
    border-radius: 14px;
    text-align: center;
}


/* ================================
   CELULAR
================================ */

@media (max-width: 600px) {

    main {
        padding: 15px;
    }

    .encabezado-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .botones-admin-superiores {
        flex-direction: column;
        align-items: stretch;
    }

    .acciones-estado {
        flex-direction: column;
    }

    .producto-admin-cabecera {
        flex-direction: column;
        align-items: flex-start;
    }

    .botones-carrito {
        flex-wrap: wrap;
    }
}