﻿/* ============================================
   TOPBAR ENHANCEMENTS - Rmetrics POS
   ============================================ */

/* Badge Soft Primary personalizado */
.badge-soft-primary {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Mejoras para el dropdown del usuario */
.dropdown-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

/* Hover effects suaves */
.dropdown-item {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-item:hover {
    transform: translateX(4px);
}

/* Mejoras para el sidebar cuando está colapsado */
body[data-sidebar-size="sm"] .main-content {
    margin-left: 70px;
}

body[data-sidebar-size="sm"] #page-topbar .layout-width {
    padding-left: 0;
}

/* Transiciones suaves para el contenido principal */
.page-content {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sombras profesionales */
.card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Botones mejorados */
.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

/* Badges con mejor diseño */
.badge {
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
}

/* Mejoras para tablas */
.table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.03);
    transform: scale(1.001);
}

/* Breadcrumb mejorado */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.25rem;
    color: #adb5bd;
}

/* Formularios con mejor diseño */
.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading spinner personalizado */
.spinner-border-custom {
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animación de entrada para modales */
.modal.fade .modal-dialog {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* Footer mejorado */
.footer {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* ============================================
   POS - PUNTO DE VENTA STYLES
   ============================================ */

/* Touch-friendly buttons for POS toolbar (min 48x48px for finger targets) */
.touch-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

/* Touch-friendly quantity buttons in cart (36x36px, easy to tap) */
.touch-qty-btn {
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    font-size: 1rem;
    touch-action: manipulation;
}

/* Action buttons for items in cart (discount %, delete) */
.touch-action-btn {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    font-size: 1.15rem;
    border-radius: 0.375rem;
    touch-action: manipulation;
}

.touch-action-btn i {
    font-size: 1.15rem;
}

.touch-action-btn:hover {
    transform: none;
    box-shadow: none;
}

/* === Payment Method Carousel (horizontal scroll, touch-friendly) === */
.metodos-pago-carousel {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 2rem;
    scrollbar-width: none; /* Firefox */
}

.metodos-pago-carousel::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.metodo-pago-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    padding: 0.75rem 0.5rem;
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    text-align: center;
    flex-shrink: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.metodo-pago-card i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.metodo-pago-card span {
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

.metodo-pago-card:hover {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.05);
    transform: translateY(-2px);
}

.metodo-pago-card.selected {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.08);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.2);
}

/* Carousel navigation arrows */
.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.carousel-nav-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.carousel-nav-btn.left {
    left: 0;
}

.carousel-nav-btn.right {
    right: 0;
}

/* Mejoras para dispositivos móviles */
@media (max-width: 768px) {
    #page-topbar .navbar-header {
        padding: 0.5rem 1rem;
    }

    .navbar-brand-box .logo-lg {
        font-size: 1rem;
    }

    body[data-sidebar-size="sm"] .main-content {
        margin-left: 0;
    }
}

/* Tema oscuro (opcional para futuro) */
@media (prefers-color-scheme: dark) {
    #page-topbar.topbar-enhanced {
        background: linear-gradient(135deg, #1a1d29 0%, #2a2d3a 100%);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .navbar-brand-box .logo {
        color: #e9ecef;
    }

    .table thead th {
        background-color: #2a2d3a;
        color: #e9ecef;
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
}

/* Animaciones suaves para elementos que aparecen */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sombra profesional para cards importantes */
.card-elevated {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Botones con gradiente (opcional) */
.btn-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.btn-gradient-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
    color: white;
}

/* Indicadores de carga elegantes */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* Botón Cerrar Día - POS */
.btn-cerrar-dia {
    background: linear-gradient(135deg, #405189, #6c5ce7);
    color: #fff;
    border: none;
    transition: all 0.3s ease;
}

.btn-cerrar-dia:hover:not(:disabled) {
    background: linear-gradient(135deg, #364474, #5a4bd1);
    color: #fff;
    box-shadow: 0 2px 8px rgba(64, 81, 137, 0.4);
    transform: translateY(-1px);
}

.btn-cerrar-dia:disabled {
    background: #ced4da;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ============================================================
   @media print — solo imprime el div con class="print-area"
   ============================================================ */
@media print {
    body > * { display: none !important; }
    .print-area {
        display: block !important;
        position: fixed !important;
        inset: 0 !important;
        background: white !important;
        z-index: 9999 !important;
        padding: 24px 32px !important;
        font-size: 11pt !important;
        color: #000 !important;
    }
    .no-print { display: none !important; }
    .print-area * { color: #000 !important; background: transparent !important; }
    .print-area table { border-collapse: collapse !important; width: 100% !important; }
    .print-area th, .print-area td { border: 1px solid #999 !important; padding: 4px 8px !important; }
    .print-firma {
        border-bottom: 1.5px solid #000 !important;
        min-width: 180px !important;
        display: inline-block !important;
        padding-bottom: 2px !important;
    }
}

