/* ── Bell button ──────────────────────────────────────────────── */
.app-notif-bell {
    position: fixed;
    left: 16px;
    top: 152px;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    border: 1px solid rgba(42, 36, 29, 0.24);
    background: linear-gradient(180deg, #fffdf9 0%, #f9f2e6 100%);
    color: #2a241d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(42, 36, 29, 0.2);
    transition: 0.18s ease;
    z-index: 70;
}

.app-notif-bell svg {
    width: 22px;
    height: 22px;
    pointer-events: none;
}

.app-notif-bell:hover {
    transform: translateY(-1px);
    background: #fff5e7;
}

.app-notif-bell:focus-visible {
    outline: 3px solid #8f5221;
    outline-offset: 1px;
}

.app-drawer-open .app-notif-bell {
    opacity: 0;
    pointer-events: none;
}

/* ── Badge ────────────────────────────────────────────────────── */
.app-notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #c0392b;
    color: #fff;
    border-radius: 9px;
    font-size: 0.68rem;
    font-weight: 800;
    font-family: Manrope, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    pointer-events: none;
    line-height: 1;
}

.app-notif-badge.hidden { display: none; }

/* ── Panel ────────────────────────────────────────────────────── */
.app-notif-panel {
    position: fixed;
    left: 80px;
    top: 144px;
    width: 300px;
    background: #fffbf3;
    border: 1px solid rgba(42, 36, 29, 0.16);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(42, 36, 29, 0.18);
    z-index: 200;
    font-family: Manrope, sans-serif;
    overflow: hidden;
}

.app-notif-panel.hidden { display: none; }

.app-notif-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 14px 11px;
    border-bottom: 1px solid rgba(42, 36, 29, 0.1);
    font-size: 0.82rem;
    font-weight: 800;
    color: #2a241d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.app-notif-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #8a7a6a;
    font-size: 1.2rem;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.12s;
}

.app-notif-panel-close:hover { color: #2a241d; }

.app-notif-panel-empty {
    padding: 24px 16px;
    text-align: center;
    color: #8a7a6a;
    font-size: 0.85rem;
    font-style: italic;
    margin: 0;
}

.app-notif-panel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 280px;
    overflow-y: auto;
}

.app-notif-panel-item {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(42, 36, 29, 0.07);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    align-items: center;
}

.app-notif-panel-item:last-child { border-bottom: none; }

.app-notif-item-name {
    font-size: 0.87rem;
    font-weight: 700;
    color: #2a241d;
    grid-column: 1;
}

.app-notif-item-meta {
    font-size: 0.76rem;
    color: #8a7a6a;
    grid-column: 1;
}

.app-notif-item-qty {
    grid-column: 2;
    grid-row: 1 / 3;
    text-align: right;
    white-space: nowrap;
    font-size: 0.8rem;
}

.qty-atual {
    font-weight: 800;
    color: #c0392b;
}

.qty-sep {
    color: #aaa;
    margin: 0 2px;
}

.qty-min {
    color: #8a7a6a;
    font-size: 0.74rem;
}

.app-notif-panel-foot {
    padding: 10px 14px;
    border-top: 1px solid rgba(42, 36, 29, 0.1);
}

.app-notif-refresh-btn {
    width: 100%;
    padding: 7px;
    background: transparent;
    border: 1px solid rgba(42, 36, 29, 0.2);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    color: #665f55;
    cursor: pointer;
    transition: background 0.14s;
}

.app-notif-refresh-btn:hover { background: rgba(42, 36, 29, 0.05); }
.app-notif-refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Toast ────────────────────────────────────────────────────── */
.app-notif-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 320px;
    width: calc(100vw - 48px);
    background: #fffbf0;
    border: 1px solid #e0a840;
    border-left: 4px solid #e0a840;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(42, 36, 29, 0.18);
    padding: 14px 14px 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    z-index: 300;
    font-family: Manrope, sans-serif;
    animation: toastIn 0.3s ease;
}

.app-notif-toast-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(12px); }
}

.app-notif-toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.app-notif-toast-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-notif-toast-text strong {
    font-size: 0.87rem;
    color: #2a241d;
}

.app-notif-toast-text span {
    font-size: 0.8rem;
    color: #665f55;
}

.app-notif-toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #8a7a6a;
    font-size: 1.1rem;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color 0.12s;
}

.app-notif-toast-close:hover { color: #2a241d; }

/* ── Progress bar on toast ────────────────────────────────────── */
.app-notif-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #e0a840;
    border-radius: 0 0 12px 12px;
    animation: toastProgress 6s linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to   { width: 0%; }
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 720px) {
    .app-notif-bell {
        left: 12px;
        top: 128px;
        width: 48px;
        height: 48px;
    }

    .app-notif-bell svg {
        width: 20px;
        height: 20px;
    }

    .app-notif-panel {
        left: 12px;
        top: auto;
        bottom: 80px;
        width: calc(100vw - 24px);
        max-width: 360px;
    }

    .app-notif-toast {
        bottom: 16px;
        right: 12px;
        width: calc(100vw - 24px);
    }
}
