/* 
 * Estilos Personalizados y Tipografía Premium
 * Arquitecto de Software: Senior Full-Stack
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Outfit', sans-serif;
    background-color: #0f172a; /* bg-slate-900 */
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Scrollbar moderno estilo dark */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #1e293b; /* bg-slate-800 */
}
::-webkit-scrollbar-thumb {
    background: #475569; /* bg-slate-600 */
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #64748b; /* bg-slate-500 */
}

/* Efectos de Glassmorphism */
.glass-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Animaciones suaves */
.transition-all-300 {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Micro-animaciones para botones */
.active-scale:active {
    transform: scale(0.96);
}

/* Estilo para inputs de PIN */
.pin-input {
    letter-spacing: 0.75em;
    text-align: center;
    font-size: 1.75rem;
}

/* Estilos KDS */
.kds-card {
    border-left-width: 6px;
}
.kds-pendiente {
    border-left-color: #f59e0b; /* Amber */
}
.kds-preparando {
    border-left-color: #3b82f6; /* Blue */
}
.kds-listo {
    border-left-color: #10b981; /* Emerald */
}

/* Switch de moneda premium slider */
.switch-moneda {
    position: relative;
    display: inline-block;
    width: 120px;
    height: 40px;
}
.switch-moneda input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    transition: .4s;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    font-weight: 600;
    font-size: 0.85rem;
}
.switch-slider:before {
    position: absolute;
    content: "";
    height: 32px;
    width: 54px;
    left: 4px;
    bottom: 4px;
    background-color: #6366f1; /* Indigo */
    transition: .4s;
    border-radius: 16px;
    z-index: 1;
}
.switch-moneda input:checked + .switch-slider:before {
    transform: translateX(58px);
}
.switch-label-usd, .switch-label-ves {
    z-index: 2;
    pointer-events: none;
}

/* Estilos de impresión */
@media print {
    .no-print {
        display: none !important;
    }
    .print-only {
        display: block !important;
    }
}

/* Modo Accesible: Alto Contraste */
body.high-contrast {
    background-color: #000000 !important;
    color: #ffffff !important;
}

body.high-contrast .glass-card, 
body.high-contrast aside, 
body.high-contrast header, 
body.high-contrast main {
    background-color: #000000 !important;
    background: #000000 !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
}

body.high-contrast .glass-card {
    border: 2.5px solid #ffffff !important;
}

body.high-contrast button, 
body.high-contrast .sidebar-btn {
    border: 2px solid #ffffff !important;
    background-color: #000000 !important;
    color: #ffffff !important;
    opacity: 1 !important;
}

body.high-contrast button:hover, 
body.high-contrast .sidebar-btn:hover {
    background-color: #ffffff !important;
    color: #000000 !important;
}

body.high-contrast input, 
body.high-contrast select, 
body.high-contrast textarea {
    border: 2px solid #ffffff !important;
    background-color: #000000 !important;
    color: #ffffff !important;
}

body.high-contrast .text-indigo-400, 
body.high-contrast .text-indigo-300, 
body.high-contrast .text-emerald-400, 
body.high-contrast .text-rose-400 {
    color: #ffff00 !important; /* Amarillo fluorescente de alto contraste */
    font-weight: 900 !important;
}

body.high-contrast .kds-card {
    border: 3px solid #ffffff !important;
    border-left-width: 10px !important;
}

/* Forzar mayúsculas visuales en campos de escritura (no contraseñas) */
input[type="text"], textarea {
    text-transform: uppercase;
}

/* Adaptación Responsiva Móvil / Tablets */
@media (max-width: 1024px) {
    /* Ocultar barra lateral en escritorio */
    aside {
        display: none !important;
    }
    
    /* Añadir espacio al fondo para que el contenido no quede tapado por la barra de navegación */
    main {
        padding-bottom: 5rem !important;
    }
    
    /* Ajustes generales de vista del POS */
    #view-pos {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    /* Ocultar la comanda si estamos en la pestaña menú/catálogo */
    #view-pos.show-menu > div:nth-child(3) {
        display: none !important;
    }
    
    /* Ocultar el catálogo si estamos en la pestaña comanda */
    #view-pos.show-comanda > div:nth-child(2) {
        display: none !important;
    }
    
    /* Ajustar panel de la comanda a ancho completo en móviles */
    #view-pos .w-\[450px\] {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Ocultar el panel de totales de escritorio en móviles */
    #desktop-totals-panel {
        display: none !important;
    }
    
    /* Adaptar márgenes generales del contenedor de vistas */
    main > div.flex-1 {
        padding: 1rem !important;
    }
}

@media (max-width: 768px) {
    /* Forzar que las columnas de KDS y formularios se ajusten mejor */
    #kds-board {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* Hacer que las modales ocupen casi todo el ancho */
    .glass-card {
        padding: 1.5rem !important;
    }
}

/* Tooltip animado al agregar productos */
.cart-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(99, 102, 241, 0.95); /* indigo-500 */
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 50;
    animation: tooltipFadeInOut 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.cart-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(99, 102, 241, 0.95) transparent transparent transparent;
}
@keyframes tooltipFadeInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(5px) scale(0.8);
    }
    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(-5px) scale(1);
    }
    85% {
        opacity: 1;
        transform: translateX(-50%) translateY(-5px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-15px) scale(0.9);
    }
}

@keyframes bounceSubtle {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-2px) scale(1.05);
    }
}
.animate-bounce-subtle {
    animation: bounceSubtle 2s infinite ease-in-out;
}

