/* ===== ESTILOS GLOBAIS ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    padding-top: 0;
    margin: 0;
}

/* ===== CHAT STYLES (Movidos do header.php) ===== */
#chat-container {
    position: fixed;
    bottom: 0;
    right: 20px;
    width: 350px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
}

#chat-body {
    display: flex;
    flex-direction: column;
}

#pedidos-chat-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 8px;
    background-color: #f8f9fa;
    min-height: 200px;
}

.chat-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.chat-message.cliente {
    align-self: flex-end;
    background: #DCF8C6;
    border-bottom-right-radius: 2px;
}

.chat-message.restaurante,
.chat-message.entregador {
    align-self: flex-start;
    background: #FFFFFF;
    border-bottom-left-radius: 2px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.chat-message.entregador {
    background: #E8F5E9;
}

.texto-hora {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: right;
    margin-top: 4px;
}

.input-form {
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 10;
    padding: 10px;
    border-top: 1px solid #dee2e6;
}

@media (max-width: 576px) {
    
     /* Ajustes no container do dropdown */
  .dropdown-menu#notificacoes-dropdown {
    position: fixed 
    top: 50% 
    left: 50% 
    transform: translate(-50%, -50%) 
    width: 40vw 
    max-width: 200px 
    max-height: 70vh 
    overflow-y: auto 
    z-index: 1060 
  }
    
    .input-form.focused {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        padding: 10px;
        background: #fff;
        box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    }


body.keyboard-active {
    padding-bottom: 200px;
}

.input-group {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    position: relative;
}

.attach-btn {
    order: -1;
    margin-right: 5px;
}

.send-btn {
    display: none;
}

.input-form.typing .send-btn {
    display: inline-block;
}

.typing-indicator {
    font-size: 0.9rem;
    color: #6c757d;
    padding: 5px 10px;
    align-self: flex-start;
}

.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.image-modal .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

}

.input-form.uploading .input-group > *:not(.attach-btn) {
    opacity: 0.5;
    pointer-events: none;
}

#chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    z-index: 999;
}

#chat-toggle .badge {
    position: absolute;
    top: -5px;
    right: -5px;
}

.espaco-rodape {
    padding: 20px 0;
    background-color: #f8f9fa;
    color: #333;
    font-family: Arial, sans-serif;
}

.espaco-rodape .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.espaco-rodape .mt-4 {
    margin-top: 1.5rem !important;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1024px) {
    main.container {
        padding-bottom: 80px !important;
    }
    
    footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }
    
    #chat-toggle {
        bottom: 80px;
    }
    
    #chat-container {
        bottom: 80px;
        right: 10px;
        width: calc(100% - 20px);
        max-width: 350px;
    }
    
    .navbar {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    header.bg-primary {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    h1.h4 {
        font-size: 1.1rem;
    }
    
    .breadcrumb {
        font-size: 0.85rem;
        padding: 0.25rem 0;
    }
    
    .container.my-4 {
        margin-top: 1rem !important;
        margin-bottom: 1rem !important;
    }
}

   @media (max-width: 590px) {
    main.container {
        padding-bottom: 60px !important;
    }
    
    footer {
        padding: 8px 0;
        font-size: 0.9rem;
    }
    
    #chat-toggle {
        width: 50px;
        height: 50px;
        bottom: 70px;
        right: 15px;
    }
    
    #chat-toggle i {
        font-size: 1.2rem;
    }
    
    .btn-group a {
        flex: 1;
        text-align: center;
        padding: 0.25rem 0.5rem;
        font-size: 0.9rem;
    }
}

   @supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
}