/* ─── RESET GENERAL ─────────────────────────────────────── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%;
    /* 1rem = 16px base */
    scroll-behavior: smooth;
}

@media screen and (max-width: 480px) {
    html {
        font-size: 115%;
        /* 1rem ≈ 18.4px */
    }

    body {
        padding: 1rem;
    }

    .contenedor {
        padding: 1.5rem;
        margin: 0;
        width: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    h1 {
        font-size: 2.6rem;
    }

    h2 {
        font-size: 2.1rem;
    }

    img.logo {
        width: 130px;
        margin-bottom: 2rem;
    }

    input,
    select,
    button {
        font-size: 1.4rem;
        padding: 1.2rem;
    }

    .form-add {
        display: flex;
        flex-direction: column;
        gap: 1.2rem;
    }

    table {
        min-width: 100%;
    }

    th,
    td {
        font-size: 1.3rem;
        padding: 1.2rem;
    }

    .resultado {
        font-size: 1.4rem;
        padding: 1.2rem;
    }
}

/* ─── BODY ─────────────────────────────────────────────── */
body {
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(to right, #e0f7fa, #f1f8e9);
    color: #333;
    padding: 2rem;
    line-height: 1.6;
    text-align: center;
}

/* ─── CONTENEDOR PRINCIPAL ─────────────────────────────── */
.contenedor {
    background: #fff;
    max-width: 800px;
    margin: auto;
    padding: 2.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

/* ─── CABECERAS Y LOGOTIPO ─────────────────────────────── */
img.logo {
    width: 250px;
    max-width: 40vw;
    display: block;
    margin: 0 auto 1.5rem;
    transition: transform 0.2s ease;
}

h1 {
    font-size: 2.4rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    text-align: left;
}

/* ─── ENLACE DE CIERRE DE SESIÓN ───────────────────────── */
.logout-link {
    text-align: right;
    margin-top: 1rem;
    font-size: 1.2rem;
}

.logout-link a {
    color: #c62828;
    text-decoration: none;
}

.logout-link a:hover {
    text-decoration: underline;
}

/* ─── FORMULARIOS Y BOTONES ────────────────────────────── */
input[type="text"],
input[type="password"],
input[type="number"],
select,
button {
    width: 100%;
    padding: 1.2rem;
    margin: 0.7rem 0;
    font-size: 1.2rem;
    border-radius: 0.8rem;
    border: 2px solid #b0bec5;
}

select {
    background-color: #e0f2f1;
}

button {
    background-color: #00bfa5;
    color: white;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #00796b;
}

/* ─── MENSAJES DE VALIDACIÓN ───────────────────────────── */
.success {
    color: #2e7d32;
    font-weight: bold;
    margin: 1.2rem 0;
    font-size: 1.4rem;
}

.error {
    color: #c62828;
    font-weight: bold;
    margin: 1.2rem 0;
    font-size: 1.4rem;
}

/* ─── FORMULARIO DE ALTA DE PEDIDOS ────────────────────── */
.form-add {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    text-align: left;
    margin-bottom: 2rem;
}

.form-add label {
    font-weight: bold;
    margin-top: 0.5rem;
    font-size: 1.2rem;
}

/* ─── SECCIÓN DE RESULTADOS (CONSULTA) ─────────────────── */
.resultado {
    margin-top: 1.5rem;
    background: #f9fbe7;
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: left;
    font-size: 1.3rem;
    line-height: 1.6;
}

/* ─── TABLAS ────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem;
    border-bottom: 1px solid #ccc;
    text-align: center;
    font-size: 1.2rem;
}

th {
    background-color: #80deea;
    color: #004d40;
}

/* ─── RESPONSIVO PARA MÓVILES PEQUEÑOS ─────────────────── */
@media (max-width: 480px) {
    h1 {
        font-size: 2.6rem;
    }

    h2 {
        font-size: 2rem;
    }

    button {
        font-size: 1.4rem;
    }

    th,
    td {
        font-size: 1.3rem;
        padding: 1.2rem;
    }

    .resultado {
        font-size: 1.4rem;
    }
}