/* ==========================================================================
   SUSHIMAR - CLIENT UI & MOBILE-FIRST STYLES (FASES 1, 2, 3 e 4)
   Bottom Navigation Bar, FAB, Offcanvas Sheets, Touch Targets >= 48px,
   Contadores da Janela de Edição, Formas de Pagamento e Banner de Atraso.
   ========================================================================== */

/* Regra estrita de touch targets >= 48x48px para elementos interativos móveis */
.bottom-nav-item,
.btn-fab-waiter,
.stepper-btn,
.qty-btn-mini,
.btn-quick-add,
.btn-call-waiter-trigger,
.table-badge,
.cat-pill,
.filter-tag,
.payment-radio-card,
.modal-choice-btn {
    min-height: 48px;
    box-sizing: border-box;
}

/* --- BOTTOM NAVIGATION BAR FIXA (Fase 1) ---------------------------------- */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color, #ECEAE4);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1030;
    padding: 0 0.5rem;
    box-shadow: 0 -4px 16px rgba(28, 27, 24, 0.05);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: var(--text-secondary, #57554E);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    padding: 6px 0;
    transition: color 0.2s ease, transform 0.15s ease;
}

.bottom-nav-item i {
    font-size: 1.28rem;
    line-height: 1;
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--accent-gold, #B89052);
}

.bottom-nav-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    background: var(--accent-coral, #C75A47);
    color: #FFFFFF;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 19px;
    height: 19px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #FFFFFF;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Espaço de respiro no final da página para a bottom bar não cobrir o conteúdo */
body {
    padding-bottom: 76px !important;
}

/* --- BOTÃO FLUTUANTE CHAMAR GARÇOM - FAB (Fase 4) ------------------------ */
.btn-fab-waiter {
    position: fixed;
    right: 18px;
    bottom: 82px;
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    border-radius: 50%;
    background: var(--text-primary, #1C1B18);
    color: var(--accent-gold, #B89052);
    border: 2px solid var(--accent-gold, #B89052);
    box-shadow: 0 6px 20px rgba(28, 27, 24, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    cursor: pointer;
    z-index: 1025;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
    animation: fab-pulse 3s infinite;
}

.btn-fab-waiter:hover {
    transform: scale(1.08);
    background: #000000;
    color: #F8D348;
}

.btn-fab-waiter:active {
    transform: scale(0.94);
}

@keyframes fab-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(184, 144, 82, 0.5);
    }
    70% {
        box-shadow: 0 0 0 14px rgba(184, 144, 82, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(184, 144, 82, 0);
    }
}

/* --- BANNER DE ATRASO NOTIFICADO PELO GARÇOM (Fluxo 1.7) ----------------- */
.banner-atraso-alerta {
    background: #FFF7ED;
    border: 1px solid #FED7AA;
    color: #C2410C;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(194, 65, 12, 0.08);
}

.banner-atraso-alerta i {
    font-size: 1.25rem;
    color: #EA580C;
    flex-shrink: 0;
}

/* --- ITENS ENTREGUES (Fluxo 1.7) ----------------------------------------- */
.item-entregue {
    opacity: 0.5 !important;
    text-decoration: line-through;
    filter: grayscale(80%);
    background-color: #F9FAFB !important;
}

/* --- JANELA DE 5 MINUTOS E LOTES (Fase 3) -------------------------------- */
.lote-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color, #ECEAE4);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 6px rgba(28, 27, 24, 0.03);
}

.lote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border-subtle, #E2DFD6);
}

.lote-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-primary, #1C1B18);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.lote-timer {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.lote-timer.timer-ativo {
    background: #FEF3C7;
    color: #B45309;
    border: 1px solid #FDE68A;
}

.lote-timer.timer-expirado {
    background: #F3F4F6;
    color: #6B7280;
}

.lote-acoes {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.65rem;
    padding-top: 0.5rem;
    border-top: 1px solid #F3F4F6;
}

.btn-lote-editar,
.btn-lote-cancelar {
    flex: 1;
    min-height: 42px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.btn-lote-editar {
    background: #F3F1EC;
    color: var(--text-primary, #1C1B18);
}
.btn-lote-editar:hover {
    background: #EBE8E0;
}

.btn-lote-cancelar {
    background: #FEE2E2;
    color: #B91C1C;
}
.btn-lote-cancelar:hover {
    background: #FECACA;
}

/* --- FORMAS DE PAGAMENTO NO MODAL (Fluxo 1.8) ----------------------------- */
.payment-methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.payment-radio-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.85rem 0.5rem;
    border: 2px solid var(--border-color, #ECEAE4);
    border-radius: 12px;
    background: #FFFFFF;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    user-select: none;
}

.payment-radio-card i {
    font-size: 1.4rem;
    color: var(--text-secondary, #57554E);
}

.payment-radio-card span {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-primary, #1C1B18);
}

.payment-radio-card input[type="radio"] {
    display: none;
}

.payment-radio-card.selected {
    border-color: var(--accent-gold, #B89052);
    background: #FDFBF7;
    box-shadow: 0 4px 12px rgba(184, 144, 82, 0.15);
}

.payment-radio-card.selected i {
    color: var(--accent-gold, #B89052);
}

/* --- BOTÕES DE SELEÇÃO RÁPIDA (Modal Chamar Garçom - Fase 4) ------------- */
.modal-choice-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color, #ECEAE4);
    background: #FFFFFF;
    color: var(--text-primary, #1C1B18);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0.55rem;
    transition: all 0.2s ease;
    text-align: left;
}

.modal-choice-btn i {
    font-size: 1.25rem;
    color: var(--accent-gold, #B89052);
}

.modal-choice-btn:hover,
.modal-choice-btn.active {
    border-color: var(--accent-gold, #B89052);
    background: #FAF7F0;
    transform: translateX(3px);
}

/* --- OFFCANVAS BOOTSTRAP PERSONALIZADO ----------------------------------- */
.offcanvas.offcanvas-bottom {
    max-height: 85vh;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border: none;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.18);
}

.offcanvas-drag-handle {
    width: 44px;
    height: 5px;
    background: #D1D5DB;
    border-radius: 9999px;
    margin: 8px auto 4px auto;
}

.offcanvas-header {
    border-bottom: 1px solid var(--border-color, #ECEAE4);
    padding: 0.85rem 1.25rem;
}

.offcanvas-body {
    padding: 1.1rem 1.25rem;
}

/* Banner de conflito de mesa ou aviso */
.table-notice-banner {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1E40AF;
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

.table-notice-banner.danger {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #991B1B;
}

/* Status do pedido badges */
.badge-status-pill {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-status-pendente {
    background: #FEF3C7;
    color: #92400E;
}

.badge-status-preparando {
    background: #FFEDD5;
    color: #C2410C;
}

.badge-status-entregue {
    background: #DCFCE7;
    color: #166534;
}

.badge-status-esgotado {
    background: #FEE2E2;
    color: #991B1B;
}

/* Toasts não obstrutivos */
.toast-container-sushimar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1080;
    width: 90%;
    max-width: 420px;
    pointer-events: none;
}

.toast-sushimar {
    pointer-events: auto;
    background: rgba(28, 27, 24, 0.94);
    backdrop-filter: blur(8px);
    color: #FAF9F5;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
    margin-bottom: 0.5rem;
    animation: toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-sushimar i {
    font-size: 1.15rem;
    color: var(--accent-gold, #B89052);
    flex-shrink: 0;
}

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