* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fa;
    color: #14213d;
}

body {
    overflow: hidden;
}

button,
input {
    font-family: inherit;
}

button {
    cursor: pointer;
}

#app {
    width: 100%;
    height: 100vh;
}


/* ============================================================
   TOPBAR
   ============================================================ */

.topbar {
    height: 90px;
    background: #00529b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    color: white;
}

.logo-text {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 2px;
}

.top-actions {
    display: flex;
    gap: 16px;
}

.btn-top,
.btn-carrito {
    border: none;
    border-radius: 14px;
    min-height: 58px;
    padding: 0 24px;
    background: white;
    color: #00529b;
    font-size: 22px;
    font-weight: bold;
}

.btn-carrito {
    position: relative;
}

#contadorCarrito {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ffb703;
    color: #111;
    margin-left: 8px;
}


/* ============================================================
   PANTALLAS
   ============================================================ */

.pantalla {
    display: none;
    height: calc(100vh - 90px);
    overflow-y: auto;
    padding: 30px;
}

.pantalla.activa {
    display: block;
}


/* ============================================================
   BIENVENIDA
   ============================================================ */

.bienvenida {
    background: linear-gradient(
        135deg,
        #00498c,
        #0068b7
    );
    color: white;
}

.bienvenida.activa {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bienvenida-contenido {
    text-align: center;
    max-width: 900px;
}

.bienvenida h1 {
    font-size: 76px;
    margin-bottom: 24px;
}

.bienvenida-subtitulo {
    font-size: 32px;
    line-height: 1.4;
    margin-bottom: 55px;
}


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

.btn-principal {
    border: none;
    background: #ffb703;
    color: #111;
    min-height: 76px;
    padding: 0 44px;
    border-radius: 18px;
    font-size: 28px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(0,0,0,.15);
}

.btn-volver {
    border: none;
    background: white;
    color: #00529b;
    min-height: 60px;
    padding: 0 24px;
    border-radius: 14px;
    font-size: 22px;
    font-weight: bold;
}


/* ============================================================
   TITULOS
   ============================================================ */

.titulo-pantalla {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 30px;
}

.navegacion-superior {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 28px;
}

.navegacion-superior .titulo-pantalla {
    margin-bottom: 0;
}


/* ============================================================
   CATEGORIAS
   ============================================================ */

.grid-categorias {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(260px, 1fr)
    );
    gap: 26px;
}

.tarjeta-categoria {
    min-height: 180px;
    border: none;
    border-radius: 22px;
    background: white;
    padding: 26px;
    box-shadow: 0 4px 14px rgba(0,0,0,.09);
    text-align: center;
}

.tarjeta-categoria:active {
    transform: scale(.98);
}

.categoria-icono {
    font-size: 56px;
    margin-bottom: 15px;
}

.categoria-nombre {
    font-size: 28px;
    font-weight: 800;
}


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

.productos-header {
    display: flex;
    gap: 25px;
    align-items: center;
    margin-bottom: 28px;
}

.buscador-box {
    flex: 1;
}

.buscador-box input {
    width: 100%;
    height: 64px;
    border-radius: 16px;
    border: 2px solid #d8dee7;
    padding: 0 24px;
    font-size: 24px;
}

.grid-productos {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(280px, 1fr)
    );
    gap: 22px;
}

.producto-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
}

.producto-img {
    height: 180px;
    background: #eef2f6;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 54px;
    margin-bottom: 18px;
    overflow: hidden;
}

.producto-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.producto-descripcion {
    font-size: 23px;
    font-weight: 700;
    min-height: 58px;
}

.producto-marca {
    color: #687386;
    font-size: 18px;
    margin-top: 8px;
}

.producto-precio {
    font-size: 32px;
    color: #00529b;
    font-weight: 900;
    margin-top: 16px;
}

.producto-stock {
    margin-top: 8px;
    font-size: 18px;
}

.btn-agregar {
    width: 100%;
    min-height: 62px;
    border: none;
    border-radius: 14px;
    margin-top: 18px;
    background: #00529b;
    color: white;
    font-size: 22px;
    font-weight: bold;
}

.btn-agregar:disabled {
    background: #b9c0c7;
}


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

.carrito-lista {
    max-width: 1000px;
    margin: 0 auto;
}

.carrito-item {
    background: white;
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 22px;
    align-items: center;
}

.carrito-producto {
    font-size: 22px;
    font-weight: 700;
}

.carrito-precio {
    font-size: 22px;
    color: #00529b;
    font-weight: bold;
}

.controles-cantidad {
    display: flex;
    align-items: center;
    gap: 12px;
}

.controles-cantidad button {
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 12px;
    font-size: 28px;
    font-weight: bold;
}

.cantidad {
    min-width: 44px;
    text-align: center;
    font-size: 24px;
}

.carrito-resumen {
    margin: 32px auto;
    max-width: 1000px;
    background: white;
    border-radius: 22px;
    padding: 30px;
    text-align: right;
}

.total-label {
    font-size: 24px;
}

.total-importe {
    font-size: 52px;
    font-weight: 900;
    color: #00529b;
    margin: 12px 0 28px;
}


/* ============================================================
   CHECKOUT
   ============================================================ */

.checkout-box {
    max-width: 720px;
    margin: 50px auto;
    background: white;
    border-radius: 24px;
    padding: 38px;
}

.checkout-box h2 {
    font-size: 38px;
    margin-bottom: 28px;
}

.checkout-box input {
    width: 100%;
    height: 68px;
    border-radius: 14px;
    border: 2px solid #dce2e8;
    font-size: 22px;
    padding: 0 20px;
    margin-bottom: 18px;
}

.checkout-box .btn-principal {
    width: 100%;
    margin-top: 14px;
}


/* ============================================================
   QR
   ============================================================ */

.qr-box {
    max-width: 760px;
    margin: 20px auto;
    text-align: center;
    background: white;
    padding: 32px;
    border-radius: 26px;
}

.qr-box h2 {
    font-size: 38px;
}

.qr-total {
    font-size: 52px;
    color: #00529b;
    font-weight: 900;
    margin: 18px 0;
}

.qr-imagen {
    width: min(420px, 80vw);
    height: min(420px, 80vw);
    object-fit: contain;
}

.esperando {
    margin-top: 22px;
    font-size: 26px;
    font-weight: bold;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 6px solid #ddd;
    border-top-color: #00529b;
    border-radius: 50%;
    margin: 20px auto 0;
    animation: girar 1s linear infinite;
}

@keyframes girar {
    to {
        transform: rotate(360deg);
    }
}


/* ============================================================
   APROBADO
   ============================================================ */

.aprobado-box {
    max-width: 700px;
    margin: 80px auto;
    text-align: center;
    background: white;
    padding: 50px;
    border-radius: 26px;
}

.check {
    width: 130px;
    height: 130px;
    margin: 0 auto 25px;
    border-radius: 50%;
    background: #14a44d;
    color: white;
    font-size: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aprobado-box h2 {
    font-size: 46px;
}

.aprobado-box p {
    font-size: 24px;
    margin: 20px 0;
}

.numero-pedido {
    font-size: 30px;
    font-weight: bold;
    margin-bottom: 32px;
}


/* ============================================================
   ERROR
   ============================================================ */

.error-box {
    max-width: 680px;
    margin: 100px auto;
    text-align: center;
    background: white;
    border-radius: 24px;
    padding: 40px;
}

.error-box h2 {
    font-size: 42px;
    margin-bottom: 20px;
}

.error-box p {
    font-size: 23px;
    margin-bottom: 30px;
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 700px) {

    .topbar {
        height: 76px;
        padding: 0 14px;
    }

    .logo-text {
        font-size: 24px;
    }

    .btn-top {
        display: none;
    }

    .btn-carrito {
        min-height: 50px;
        padding: 0 14px;
    }

    .pantalla {
        height: calc(100vh - 76px);
        padding: 18px;
    }

    .bienvenida h1 {
        font-size: 46px;
    }

    .bienvenida-subtitulo {
        font-size: 24px;
    }

    .btn-principal {
        width: 100%;
        font-size: 23px;
    }

    .titulo-pantalla {
        font-size: 30px;
    }

    .grid-categorias,
    .grid-productos {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .tarjeta-categoria {
        min-height: 145px;
        padding: 16px;
    }

    .categoria-nombre {
        font-size: 21px;
    }

    .producto-card {
        padding: 13px;
    }

    .producto-img {
        height: 130px;
    }

    .producto-descripcion {
        font-size: 18px;
    }

    .producto-precio {
        font-size: 25px;
    }

    .productos-header {
        flex-direction: column;
        align-items: stretch;
    }

    .carrito-item {
        grid-template-columns: 1fr;
    }

    .total-importe {
        font-size: 40px;
    }
}


/* ============================================================
   MODAL INACTIVIDAD
   ============================================================ */

#modalInactividad {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: none;

    align-items: center;
    justify-content: center;

    background: rgba(0, 25, 60, 0.72);

    padding: 24px;
}

.modal-inactividad-box {
    width: min(600px, 95vw);

    background: white;

    border-radius: 26px;

    padding: 48px;

    text-align: center;

    box-shadow:
        0 20px 60px rgba(0,0,0,.3);
}

.modal-inactividad-box h2 {
    font-size: 46px;
    margin-bottom: 18px;
}

.modal-inactividad-box p {
    font-size: 24px;
    margin-bottom: 34px;
}
