/* ============================================
   CSS APLICATIVO MOBILE - DESIGN MODERNO
   Layout compacto tipo tabela horizontal
   ============================================ */

/* RESET PARA MOBILE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.lista-supermercado-container {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    background: #f5f5f7;
    min-height: 100vh;
    padding: 0;
}

/* ========== NOVO HEADER FIXO COM CAMPOS FINANCEIROS ========== */
.mobile-header {
    background: linear-gradient(135deg, #4a6bff 0%, #3a5bd9 100%);
    padding: 20px 15px 15px;
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.finance-header-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    text-align: center;
}

.finance-header-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.finance-header-label {
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 6px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.finance-header-input {
    width: 100%;
    padding: 10px 5px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    background: white;
    color: #4a6bff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.finance-header-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.finance-header-value {
    width: 100%;
    padding: 10px 5px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.finance-header-value.disponivel {
    color: #00c853;
    background: rgba(255, 255, 255, 0.95);
}

.finance-header-value.utilizado {
    color: #ff9800;
    background: rgba(255, 255, 255, 0.95);
}

/* ÁREA PRINCIPAL */
.lista-form-wrapper {
    background: #ffffff;
    border-radius: 25px 25px 0 0;
    margin-top: -15px;
    padding: 20px 15px 130px;
    min-height: calc(100vh - 80px);
    position: relative;
    z-index: 1;
}

/* SUPERMERCADO - CARD COMPACTO */
.supermercado-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
}

.supermercado-label {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 15px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.supermercado-label::before {
    content: '🏪';
    font-size: 18px;
}

.supermercado-input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    color: #1f2937;
    background: #f9fafb;
}

.supermercado-input:focus {
    border-color: #4a6bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 107, 255, 0.1);
}

.supermercado-instruction {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========== BOTÕES SUPERIORES ========== */
.top-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 20px 0;
    justify-content: center;
}

.top-action-btn {
    flex: 1;
    min-width: 70px;
    padding: 12px 8px;
    border-radius: 12px;
    border: 2px solid #4a6bff;
    background: white;
    color: #4a6bff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

.top-action-btn:hover {
    background: #4a6bff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(74, 107, 255, 0.3);
}

.top-action-btn.limpar {
    border-color: #ff4444;
    color: #ff4444;
    background: white;
}

.top-action-btn.limpar:hover {
    background: #ff4444;
    color: white;
    border-color: #ff4444;
}

/* ========== REMOVER BOTÃO DE ORGANIZAÇÃO MANUAL ========== */
.top-action-btn.organizar {
    display: none !important;
}

.top-action-btn.organizar:hover {
    background: #8b5cf6;
    color: white;
    border-color: #8b5cf6;
}

/* ========== LAYOUT DOS ITENS - CARD HORIZONTAL ========== */
.items-container {
    margin-bottom: 90px;
    border-radius: 16px;
    background: white;
}

.item-row {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.item-row:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.item-row.comprado {
    background: #f0fdf4;
    border-color: #10b981;
}

/* PARTE SUPERIOR DO ITEM */
.item-top {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e0e0e0;
}

.item-image-container {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    background: #f5f5f5;
    position: relative;
    flex-shrink: 0;
}

.image-placeholder-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: #999;
    text-align: center;
    line-height: 1.2;
    width: 100%;
    padding: 0 5px;
    z-index: 1;
}

.select-image-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 2;
}

.item-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.remover-imagem-overlay {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 9px;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* NOME DO PRODUTO */
.item-name-container {
    flex: 1;
}

.item-name-container label {
    display: block;
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.item-name-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    background: #fafafa;
}

.item-name-input:focus {
    border-color: #4a6bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 107, 255, 0.2);
}

.item-row.comprado .item-name-input {
    text-decoration: line-through;
    text-decoration-color: #10b981;
    text-decoration-thickness: 2px;
    color: #065f46;
    background: #e8f5e9;
}

/* CHECKBOX SEL. */
.item-sel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.item-sel-container label {
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

.custom-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid #4a6bff;
    appearance: none;
    -webkit-appearance: none;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.custom-checkbox:checked {
    background: #4a6bff;
}

.custom-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* SEPARADOR */
.item-separator {
    height: 1px;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent);
    margin: 10px 0;
}

/* PARTE INFERIOR DO ITEM */
.item-bottom {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item-data-section {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    align-items: center;
}
.item-buttons-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
/* Ajustar layout dos botões de ação */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-button {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.action-button:active {
    transform: scale(0.95);
}

.delete-button {
    background: #ff4444;
    color: white;
}

.delete-button:hover {
    background: #dc2626;
}

.buy-button {
    background: #10b981;
    color: white;
}

.buy-button:hover {
    background: #059669;
}

.item-row.comprado .buy-button {
    background: #6c757d;
}


/* ========== REMOVER BOTÃO DE ORGANIZAÇÃO MANUAL ========== */
.top-action-btn.organizar {
    display: none !important;
}

/* ========== BOTÕES DE SETA PARA CIMA/BAIXO ========== */
.arrow-buttons {
    display: flex;
    gap: 8px;
}

.arrow-button {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.arrow-button:active {
    transform: scale(0.95);
}

.arrow-up {
    background: #dc2626;
    color: white;
}

.arrow-up:hover {
    background: #b91c1c;
}

.arrow-down {
    background: #10b981;
    color: white;
}

.arrow-down:hover {
    background: #059669;
}



/* CAMPOS DE DADOS */
.item-quantity-container,
.item-value-container,
.item-total-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-quantity-container label,
.item-value-container label,
.item-total-container label {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    text-align: center;
}

.quantity-input,
.value-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    background: #fafafa;
}

.quantity-input:focus,
.value-input:focus {
    border-color: #4a6bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 107, 255, 0.2);
}

.total-price {
    font-size: 14px;
    font-weight: 700;
    color: #10b981;
    text-align: center;
    padding: 8px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    display: block;
}
.item-row.comprado .total-price {
    color: #065f46;
    background: rgba(6, 95, 70, 0.1);
}



/* ========== BOTÃO FLUTUANTE + ========== */
.floating-add-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border: none;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
}

.floating-add-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #155724 100%);
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.6);
}

.floating-add-btn:active {
    transform: scale(0.95);
}

/* ========== REMOVER ELEMENTOS ANTIGOS ========== */
.sort-section,
.finance-section,
#adicionar-item {
    display: none !important;
}

/* ========== BOTÕES MOBILE INFERIORES ========== */
.mobile-buttons-container {
    position: fixed;
    bottom: 00px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 900;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.mobile-buttons-scroll {
    display: flex;
    gap: 8px;
    min-width: min-content;
    justify-content: center;
}

.mobile-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    border: none;
    white-space: nowrap;
    min-height: 44px;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.mobile-button:active {
    transform: scale(0.96);
}

.mobile-button.scan {
    background: #4a6bff;
    color: white;
    min-width: 120px;
}

.mobile-button.scan:hover {
    background: #3a5bd9;
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(74, 107, 255, 0.3);
}

.mobile-button.danger {
    background: #ff4444;
    color: white;
    min-width: 100px;
}

.mobile-button.danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(239, 68, 68, 0.3);
}

.mobile-button.save {
    background: #10b981;
    color: white;
    min-width: 100px;
}

.mobile-button.save:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(16, 185, 129, 0.3);
}

/* ========== TOTAL GERAL FIXO ========== */
.mobile-total-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    padding: 16px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.total-label {
    font-size: 15px;
    color: #64748b;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.total-label::before {
    content: '💰';
    font-size: 18px;
}

.total-value {
    font-size: 24px;
    font-weight: 900;
    color: #10b981;
}

/* MODAL DO SCANNER - CORRIGIDO PARA MOBILE */
/* MODAL DO SCANNER - CORRIGIDO PARA Z-INDEX MÁXIMO */
.scanner-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    z-index: 999999; /* AUMENTADO PARA VALOR MÁXIMO */
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
/* FORÇAR O HEADER A FICAR ABAIXO DO MODAL QUANDO ELE ESTIVER ABERTO */
.scanner-modal ~ .mobile-header {
    z-index: 100 !important; /* GARANTIR QUE FIQUE ABAIXO */
}
.scanner-content {
    background: white;
    border-radius: 20px;
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    z-index: 9999999; /* Z-INDEX AINDA MAIOR PARA O CONTEÚDO */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.scanner-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.scanner-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.close-scanner {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 99999999; /* BOTÃO DE FECHAR COM Z-INDEX AINDA MAIOR */
}

.close-scanner:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.scanner-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.scanner-viewport {
    width: 100%;
    height: 300px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}

.scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.scanner-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    background: #1a1a1a;
    flex-direction: column;
    gap: 10px;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.scanner-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 150px;
    border: 3px solid #10b981;
    border-radius: 12px;
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.7);
}

.scanner-line {
    position: absolute;
    top: 30%;
    left: 15%;
    width: 70%;
    height: 3px;
    background: #10b981;
    animation: scanLine 2s infinite linear;
    z-index: 6;
}

@keyframes scanLine {
    0%, 100% { 
        top: 30%;
        opacity: 1;
    }
    50% { 
        top: 70%;
        opacity: 0.7;
    }
}

.scanner-instruction {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    padding: 0 15px;
    z-index: 7;
}

.scanner-instruction-text {
    text-align: center;
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.scanner-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.scanner-input {
    flex: 1;
    padding: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.scanner-input:focus {
    border-color: #10b981;
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.scanner-button {
    padding: 14px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.scanner-button:hover {
    background: linear-gradient(135deg, #0da271 0%, #047852 100%);
    transform: translateY(-1px);
}

.scanner-button:active {
    transform: scale(0.98);
}

.scanner-status {
    padding: 15px;
    border-radius: 12px;
    font-size: 14px;
    display: none;
    line-height: 1.5;
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
    z-index: 8;
}

.scanner-status.success {
    background: #d1fae5;
    color: #065f46;
    display: block;
    border-left: 4px solid #10b981;
}

.scanner-status.error {
    background: #fee2e2;
    color: #991b1b;
    display: block;
    border-left: 4px solid #ef4444;
}

/* ========== MENSAGENS FLUTUANTES - CORRIGIDO Z-INDEX ========== */
.mensagem-flutuante {
    animation: fadeIn 0.3s, fadeOut 0.5s 2.5s !important;
    z-index: 999999; /* AUMENTADO PARA FICAR ACIMA DE QUASE TUDO */
}

/* ========== BOTÃO FLUTUANTE + - CORRIGIDO Z-INDEX ========== */
.floating-add-btn {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #4a6bff;
    color: white;
    border: none;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 9999; /* REDUZIDO PARA FICAR ABAIXO DO MODAL */
    box-shadow: 0 4px 12px rgba(74, 107, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* ========== BOTÕES MOBILE INFERIORES - CORRIGIDO Z-INDEX ========== */
.mobile-buttons-container {
    position: fixed;
    bottom: 00px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 9000; /* REDUZIDO PARA FICAR ABAIXO DO MODAL */
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

/* ========== HEADER FIXO - CORRIGIDO Z-INDEX ========== */
.mobile-header {
    background: linear-gradient(135deg, #4a6bff 0%, #3a5bd9 100%);
    padding: 20px 15px 15px;
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000; /* REDUZIDO PARA FICAR ABAIXO DO MODAL */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ========== TOTAL GERAL FIXO - CORRIGIDO Z-INDEX ========== */
.mobile-total-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    padding: 16px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 1000; /* REDUZIDO PARA FICAR ABAIXO DO MODAL */
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

/* ========== ANIMAÇÕES ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.item-row {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== RESPONSIVIDADE ========== */
@media (max-width: 768px) {
    .scanner-modal {
        z-index: 999999; /* MANTIDO ALTO EM MOBILE TAMBÉM */
    }
    
    .scanner-content {
        width: 98%;
        max-height: 95vh;
        margin: 10px;
    }
    
    .scanner-viewport {
        height: 250px;
    }
    
    /* Garantir que o modal ocupe tela cheia em mobile muito pequeno */
    @media (max-width: 480px) {
        .scanner-modal {
            background: rgba(0, 0, 0, 0.99);
        }
        
        .scanner-content {
            width: 100%;
            height: 100%;
            max-width: none;
            max-height: none;
            border-radius: 0;
            margin: 0;
        }
        
        .scanner-viewport {
            height: 280px;
        }
    }
}

/* ========== ESTILOS PARA PREVENIR SCROLL ========== */
body.scanner-active {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* ========== ESTILOS PARA OVERLAY DO MODAL ========== */
.scanner-modal::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: -1;
}

/* ========== GARANTIR QUE NADA FIQUE ACIMA DO MODAL ========== */
* {
    max-z-index: 999998 !important; /* FORÇAR QUE NADA ULTRAPASSE ESTE VALOR */
}

.scanner-modal,
.scanner-modal * {
   z-index: 999999 !important;
}
/* ========== ESTILOS PARA MODO DRAG ATIVO ========== */


/* ========== ESTILOS PARA ITEM COMPRADO ========== */
.item-row.comprado {
    background: #f0fdf4;
    border-color: #10b981;
}

.item-row.comprado .item-name-input {
    color: #065f46;
}

.item-row.comprado .total-price {
    background: rgba(6, 95, 70, 0.1);
}

/* ========== AJUSTES PARA MOBILE ========== */
@media (hover: none) {
    .top-action-btn:hover,
    .action-button:hover,
    .mobile-button:hover,
    .floating-add-btn:hover {
        transform: none;
    }
    
    .top-action-btn:active,
    .action-button:active,
    .mobile-button:active {
        transform: scale(0.95);
    }
}

/* OCULTAR VALOR TOTAL DEIXAR SOMENTE UTILIZADO */
.totals-container {
    display: none;
}


/* ========== ANIMAÇÕES PARA O MODAL DE RESTAURAÇÃO ========== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Estilos para botões do modal */
.modal-button {
    transition: all 0.2s ease !important;
}

.modal-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15) !important;
}

.modal-button.yes:hover {
    background: linear-gradient(135deg, #0da271 0%, #047852 100%) !important;
}

.modal-button.no:hover {
    background: #e5e7eb !important;
    border-color: #d1d5db !important;
}

.modal-button:active {
    transform: scale(0.95) !important;
}

/* Responsividade do modal */
@media (max-width: 480px) {
    .lista-modal-content {
        width: 95% !important;
        padding: 20px !important;
    }
    
    .modal-icon {
        font-size: 40px !important;
    }
    
    h3 {
        font-size: 20px !important;
    }
    
    p {
        font-size: 14px !important;
    }
    
    .modal-button {
        padding: 10px 20px !important;
        font-size: 14px !important;
    }
}

/* ========== BOTÃO FLUTUANTE COM MENU EXPANSÍVEL NA LATERAL ========== */
.floating-menu-container {
    position: fixed;
    bottom: 100px; /* Ajustado para ficar acima do botão + */
    right: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.floating-menu-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a6bff 0%, #2c50ff 100%);
    border: none;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(74, 107, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1002;
}

.floating-menu-btn:hover {
    background: linear-gradient(135deg, #3a5bef 0%, #1c40ef 100%);
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(74, 107, 255, 0.6);
}

.floating-menu-btn:active {
    transform: scale(0.95);
}

/* Menu expansível que abre para a esquerda */
.floating-menu-actions {
    position: absolute;
    bottom: 0;
    right: 70px; /* Posicionado à esquerda do botão principal */
    background: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    z-index: 1000;
    animation: slideInFromRight 0.3s ease;
    border: 1px solid #e5e7eb;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.floating-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.floating-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    background: #f8f9fa;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    white-space: nowrap;
}

.floating-menu-item:hover {
    background: #e9ecef;
    transform: translateX(-3px);
}

.floating-menu-item.scan:hover {
    background: #e3f2fd;
    color: #0d6efd;
}

.floating-menu-item.danger:hover {
    background: #fde8e8;
    color: #dc3545;
}

.floating-menu-item.save:hover {
    background: #e8f5e8;
    color: #28a745;
}

.floating-menu-emoji {
    font-size: 18px;
    width: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-menu-text {
    flex: 1;
    text-align: left;
}

/* Indicador do botão flutuante (seta para a direita) */
.floating-menu-actions:before {
    content: '';
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid white;
}

/* Ajuste do botão + para evitar sobreposição */
.floating-add-btn {
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

/* Responsivo para mobile */
@media (max-width: 768px) {
    .floating-menu-container {
        bottom: 90px;
        right: 15px;
    }
    
    .floating-menu-btn {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
    
    .floating-menu-actions {
        right: 65px;
        min-width: 170px;
    }
    
    .floating-add-btn {
        bottom: 15px;
        right: 15px;
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
}

/* Para telas muito pequenas */
@media (max-width: 480px) {
    .floating-menu-container {
        bottom: 80px;
        right: 10px;
    }
    
    .floating-menu-btn {
        width: 52px;
        height: 52px;
        font-size: 22px;
    }
    
    .floating-menu-actions {
        right: 60px;
        min-width: 160px;
        padding: 10px;
    }
    
    .floating-menu-item {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .floating-add-btn {
        bottom: 10px;
        right: 10px;
        width: 52px;
        height: 52px;
        font-size: 22px;
    }
}

/* Garantir que os emojis nas imagens tenham tamanho consistente */
.floating-menu-emoji img.emoji {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}