:root {
    --primary: #2563eb;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Prevenir zoom en doble tap y resalte azul en iOS/Android */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.hidden {
    display: none !important;
}

/* --- Navegación DESKTOP --- */
nav {
    background-color: var(--primary);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* --- Contenedor Principal --- */
main {
    flex: 1;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* --- Pantallas Genéricas DESKTOP --- */
.screen {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 800px;
    text-align: center;
}

/* =====================================================
   MOBILE STYLES — aplica solo en pantallas <= 480px
   ===================================================== */
@media (max-width: 480px) {

    body {
        overflow: hidden;
        height: 100dvh; /* dynamic viewport height — respeta barra del navegador */
    }

    main {
        padding: 0;
        align-items: stretch;
        height: 100dvh;
        overflow: hidden;
    }

    /* Ocultar nav en mobile — la navegación es contextual */
    nav {
        display: none !important;
    }

    /* Pantalla base mobile */
    .mob-screen {
        display: flex;
        flex-direction: column;
        height: 100dvh;
        width: 100%;
        background: #f3f4f6;
        overflow: hidden;
        padding: 0;
    }

    /* POS tiene estructura especial */
    .mob-pos {
        background: #f3f4f6;
    }

    /* Header mobile */
    .mob-header {
        background: #1f2937;
        padding: 14px 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-shrink: 0;
    }

    .mob-logo {
        color: white;
        font-size: 1.2rem;
        font-weight: 900;
        letter-spacing: -0.5px;
    }

    .mob-turno {
        color: #9ca3af;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-top: 2px;
    }

    /* Header del POS */
    .mob-pos-header {
        background: white;
        padding: 12px 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid #f3f4f6;
        flex-shrink: 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }

    /* Botón volver */
    .mob-btn-volver {
        background: rgba(255,255,255,0.15);
        color: white;
        border: none;
        border-radius: 8px;
        padding: 8px 14px;
        font-weight: 700;
        font-size: 0.9rem;
        cursor: pointer;
    }

    /* Botón admin */
    .mob-btn-admin {
        background: #ec4899;
        color: white;
        border: none;
        border-radius: 10px;
        padding: 10px 16px;
        font-weight: 800;
        font-size: 0.9rem;
        cursor: pointer;
    }

    /* Botón primario (grande, ocupa ancho completo) */
    .mob-btn-primary {
        width: 100%;
        padding: 28px 20px;
        border: none;
        border-radius: 20px;
        font-size: 1.8rem;
        font-weight: 900;
        letter-spacing: 2px;
        cursor: pointer;
        color: white;
        text-align: center;
        margin: 12px 16px 0;
        width: calc(100% - 32px);
    }

    /* Grid 2 columnas */
    .mob-grid-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding: 12px 16px 0;
    }

    /* Botón secundario (en grid) */
    .mob-btn-secondary {
        padding: 20px 12px;
        border: none;
        border-radius: 16px;
        font-size: 1rem;
        font-weight: 900;
        cursor: pointer;
        color: white;
        text-align: center;
    }

    /* Botón ancho completo */
    .mob-btn-full {
        width: calc(100% - 32px);
        margin: 8px 16px 0;
        padding: 18px;
        border: none;
        border-radius: 14px;
        font-size: 1.1rem;
        font-weight: 800;
        cursor: pointer;
        color: white;
        text-align: center;
    }

    /* Efecto 3D para botones táctiles */
    .mob-btn-3d {
        box-shadow: 0 6px 0 rgba(0,0,0,0.2);
        transition: transform 0.08s, box-shadow 0.08s;
    }

    .mob-btn-3d:active {
        transform: translateY(5px);
        box-shadow: 0 1px 0 rgba(0,0,0,0.2);
    }

    /* Colores de botones */
    .mob-btn-green  { background: #10b981; }
    .mob-btn-blue   { background: #3b82f6; }
    .mob-btn-yellow { background: #f59e0b; }
    .mob-btn-amber  { background: #d97706; }
    .mob-btn-orange { background: #f97316; }
    .mob-btn-red    { background: #ef4444; }
    .mob-btn-pink   { background: #ec4899; }
    .mob-btn-purple { background: #8b5cf6; }
    .mob-btn-dark   { background: #1f2937; }
    .mob-btn-gray   { background: #6b7280; }

    /* En mobile el .screen desktop no aplica */
    .screen {
        background: transparent;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        max-width: 100%;
        text-align: left;
    }
}