/* Estilos adicionais para o sistema PDV */

/* Animações */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Classes utilitárias */
.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* Estilos para impressão */
@media print {
    body {
        background: white !important;
    }
    
    .no-print {
        display: none !important;
    }
    
    .receipt-print {
        font-family: 'Courier New', monospace;
        font-size: 12px;
        line-height: 1.2;
    }
    
    header, main, footer {
        display: none !important;
    }
    
    #receiptModal {
        position: static !important;
        background: white !important;
        box-shadow: none !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Estilos para modo escuro */
@media (prefers-color-scheme: dark) {
    .glass-effect {
        background: rgba(30, 41, 59, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    body {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    }
    
    .text-gray-800 {
        color: #f1f5f9;
    }
    
    .text-gray-600 {
        color: #cbd5e1;
    }
    
    .bg-white {
        background: #334155;
    }
    
    .bg-gray-50 {
        background: #475569;
    }
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 0.5rem;
    }
    
    header .flex {
        flex-direction: column;
        gap: 1rem;
    }
    
    header .text-right {
        text-align: center;
    }
    
    .lg\\:col-span-2 {
        grid-column: span 1;
    }
    
    .sticky {
        position: relative !important;
    }
}

/* Estilos para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* Estilos para telas grandes */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* Estilos para foco e acessibilidade */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Estilos para estados hover */
.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Estilos para loading */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Estilos para badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-success {
    background-color: #10b981;
    color: white;
}

.badge-warning {
    background-color: #f59e0b;
    color: white;
}

.badge-error {
    background-color: #ef4444;
    color: white;
}

.badge-info {
    background-color: #3b82f6;
    color: white;
}

/* Estilos para cards de produto */
.product-card {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.product-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.product-card.selected {
    border-color: #10b981;
    background-color: rgba(16, 185, 129, 0.1);
}

/* Estilos para o carrinho */
.cart-item {
    transition: all 0.3s ease;
}

.cart-item:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

/* Estilos para modais */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* Estilos para inputs numéricos */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
    height: 40px;
}

/* Estilos para scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Estilos para notificações */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 400px;
}

/* Estilos para estados de estoque */
.stock-high {
    color: #10b981;
}

.stock-medium {
    color: #f59e0b;
}

.stock-low {
    color: #ef4444;
}

.stock-critical {
    color: #dc2626;
    font-weight: bold;
}

/* Estilos para categorias */
.category-alimentos {
    background-color: #10b981;
}

.category-bebidas {
    background-color: #3b82f6;
}

.category-limpeza {
    background-color: #8b5cf6;
}

.category-eletronicos {
    background-color: #f97316;
}

/* Estilos para formas de pagamento */
.payment-method-dinheiro {
    color: #10b981;
}

.payment-method-cartao {
    color: #3b82f6;
}

.payment-method-pix {
    color: #8b5cf6;
}

/* Estilos para animações de entrada */
.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Estilos para tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Estilos para grade de produtos otimizada */
.product-grid-optimized {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Estilos para performance */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Estilos para o carrinho fixo com scrollbar */
.main-container {
    padding-right: 350px !important;
}

/* Carrinho fixo com scrollbar personalizado */
.cart-fixed {
    position: fixed !important;
    top: 6rem !important;
    right: 1rem !important;
    width: 20rem !important;
    height: calc(100vh - 6rem) !important;
    max-height: calc(100vh - 6rem) !important;
    z-index: 40 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Scrollbar personalizado para o carrinho */
.cart-items-scroll {
    flex: 1 !important;
    overflow-y: auto !important;
    margin-bottom: 1rem !important;
    max-height: calc(100% - 280px) !important;
}

/* Estilos para o scrollbar do carrinho */
.cart-items-scroll::-webkit-scrollbar {
    width: 6px !important;
}

.cart-items-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1) !important;
    border-radius: 3px !important;
}

.cart-items-scroll::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5) !important;
    border-radius: 3px !important;
}

.cart-items-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7) !important;
}

/* Garantir que o resumo e ações fiquem fixos no final */
.cart-footer {
    flex-shrink: 0 !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
    padding-top: 1rem !important;
}

/* Ajustes para responsividade */
@media (max-width: 1024px) {
    .cart-fixed {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        width: 100% !important;
        height: auto !important;
        max-height: 600px !important;
        margin-top: 1rem !important;
    }
    
    .main-container {
        padding-right: 0 !important;
    }
    
    .cart-items-scroll {
        max-height: 300px !important;
    }
}

@media (max-width: 768px) {
    .cart-fixed {
        max-height: 400px !important;
    }
    
    .cart-items-scroll {
        max-height: 200px !important;
    }
}

/* Animações para itens do carrinho */
.cart-item {
    transition: all 0.3s ease !important;
}

.cart-item:hover {
    background-color: rgba(59, 130, 246, 0.05) !important;
    transform: translateX(-2px) !important;
}

/* Sombra para destacar o carrinho fixo */
.cart-fixed {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Estilo para o scrollbar do carrinho na posição original */
#cartItems::-webkit-scrollbar {
    width: 8px !important;
}

#cartItems::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05) !important;
    border-radius: 4px !important;
}

#cartItems::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3) !important;
    border-radius: 4px !important;
}

#cartItems::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5) !important;
}

/* Estilo para Firefox */
#cartItems {
    scrollbar-width: thin !important;
    scrollbar-color: rgba(59, 130, 246, 0.3) rgba(0, 0, 0, 0.05) !important;
}

/* Estilos para modal de sugestões de busca */
#searchSuggestionsModal {
    animation: slideDown 0.2s ease-out;
}

.search-suggestion-item {
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.search-suggestion-item:hover {
    border-left-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.05);
}

.search-suggestion-item:active {
    background-color: rgba(59, 130, 246, 0.1);
    transform: scale(0.98);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Indicador visual para duplo clique */
.search-suggestion-item::after {
    content: "duplo clique para adicionar";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #6b7280;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.search-suggestion-item:hover::after {
    opacity: 0.7;
}

/* Estilos para tema personalizado */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
}

/* Aplicação das variáveis CSS */
.bg-primary {
    background-color: var(--primary-color);
}

.text-primary {
    color: var(--primary-color);
}

.border-primary {
    border-color: var(--primary-color);
}
