/* Food Butik Notifications v2.0 - Modern Design System */

/* ===== Base Notification ===== */
.fb-notif {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 12px 0;
    padding: 16px 20px;
    border-radius: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    border: 1px solid transparent;
    overflow: hidden;
    animation: fb-notif-slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Dismiss animation */
.fb-notif.is-dismissing {
    animation: fb-notif-slideOut 0.35s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes fb-notif-slideIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fb-notif-slideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
        max-height: 200px;
        margin: 12px 0;
        padding: 16px 20px;
    }
    to {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
        max-height: 0;
        margin: 0;
        padding: 0 20px;
    }
}

/* ===== Notification Types ===== */

/* Info */
.fb-notif--info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* Warning */
.fb-notif--warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

/* Error */
.fb-notif--error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

/* Success */
.fb-notif--success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

/* ===== Icon ===== */
.fb-notif__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.fb-notif__icon svg {
    width: 20px;
    height: 20px;
}

.fb-notif--info .fb-notif__icon {
    background: #dbeafe;
}
.fb-notif--info .fb-notif__icon svg {
    color: #2563eb;
}

.fb-notif--warning .fb-notif__icon {
    background: #fef3c7;
}
.fb-notif--warning .fb-notif__icon svg {
    color: #d97706;
}

.fb-notif--error .fb-notif__icon {
    background: #fee2e2;
}
.fb-notif--error .fb-notif__icon svg {
    color: #dc2626;
}

.fb-notif--success .fb-notif__icon {
    background: #dcfce7;
}
.fb-notif--success .fb-notif__icon svg {
    color: #16a34a;
}

/* ===== Content Body ===== */
.fb-notif__body {
    flex: 1;
    min-width: 0;
}

.fb-notif__title {
    font-weight: 650;
    font-size: 14.5px;
    margin: 0 0 3px 0;
    line-height: 1.35;
    color: inherit;
}

.fb-notif__msg {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    opacity: 0.85;
}

.fb-notif__msg p {
    margin: 0;
}

.fb-notif__msg p + p {
    margin-top: 6px;
}

/* ===== Close Button ===== */
.fb-notif__close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.45;
    transition: all 0.2s ease;
    margin: -2px -4px 0 0;
    padding: 0;
    color: currentColor;
}

.fb-notif__close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
}

.fb-notif__close:active {
    transform: scale(0.9);
}

.fb-notif__close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    opacity: 1;
}

.fb-notif__close svg {
    width: 16px;
    height: 16px;
}

/* ===== Auto-dismiss Progress Bar ===== */
.fb-notif__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 14px 14px;
    animation: fb-notif-progress 15s linear forwards;
}

.fb-notif--info .fb-notif__progress {
    background: #3b82f6;
}
.fb-notif--warning .fb-notif__progress {
    background: #f59e0b;
}
.fb-notif--error .fb-notif__progress {
    background: #ef4444;
}
.fb-notif--success .fb-notif__progress {
    background: #22c55e;
}

@keyframes fb-notif-progress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Pause progress on hover */
.fb-notif:hover .fb-notif__progress {
    animation-play-state: paused;
}

/* ===== Banner Variant (after_header / site-wide) ===== */
.fb-notif--banner {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    margin: 0;
    padding: 12px 24px;
    justify-content: center;
    text-align: center;
}

.fb-notif--banner .fb-notif__icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.fb-notif--banner .fb-notif__icon svg {
    width: 16px;
    height: 16px;
}

.fb-notif--banner .fb-notif__body {
    flex: unset;
}

.fb-notif--banner .fb-notif__title {
    font-size: 13.5px;
}

.fb-notif--banner .fb-notif__msg {
    font-size: 13px;
}

.fb-notif--banner .fb-notif__progress {
    border-radius: 0;
}

/* ===== Compact Variant (cart / checkout) ===== */
.fb-notif--compact {
    padding: 12px 16px;
    gap: 10px;
    border-radius: 10px;
}

.fb-notif--compact .fb-notif__icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.fb-notif--compact .fb-notif__icon svg {
    width: 16px;
    height: 16px;
}

.fb-notif--compact .fb-notif__title {
    font-size: 13.5px;
}

.fb-notif--compact .fb-notif__msg {
    font-size: 12.5px;
}

.fb-notif--compact .fb-notif__progress {
    border-radius: 0 0 10px 10px;
}

/* ===== Location-specific Overrides ===== */
.fb-notif.location-checkout,
.fb-notif.location-cart {
    border-radius: 10px;
}

/* ===== Shortcode Wrapper ===== */
.food-butik-notifications-shortcode {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .fb-notif {
        margin: 8px 0;
        padding: 14px 16px;
        gap: 12px;
        border-radius: 12px;
    }

    .fb-notif__icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .fb-notif__icon svg {
        width: 18px;
        height: 18px;
    }

    .fb-notif__title {
        font-size: 14px;
    }

    .fb-notif__msg {
        font-size: 13px;
    }

    .fb-notif__close {
        width: 32px;
        height: 32px;
    }

    .fb-notif--banner {
        padding: 10px 16px;
        gap: 10px;
        border-radius: 0;
    }

    .fb-notif--compact {
        padding: 10px 14px;
        gap: 8px;
    }

    .fb-notif__progress {
        height: 2px;
    }
}

/* ===== Dark Mode ===== */
@media (prefers-color-scheme: dark) {
    .fb-notif--info {
        background: #172554;
        border-color: #1e3a5f;
        color: #bfdbfe;
    }
    .fb-notif--info .fb-notif__icon {
        background: #1e3a8a;
    }
    .fb-notif--info .fb-notif__icon svg {
        color: #60a5fa;
    }

    .fb-notif--warning {
        background: #451a03;
        border-color: #5c3a0e;
        color: #fde68a;
    }
    .fb-notif--warning .fb-notif__icon {
        background: #78350f;
    }
    .fb-notif--warning .fb-notif__icon svg {
        color: #fbbf24;
    }

    .fb-notif--error {
        background: #450a0a;
        border-color: #5c1414;
        color: #fecaca;
    }
    .fb-notif--error .fb-notif__icon {
        background: #7f1d1d;
    }
    .fb-notif--error .fb-notif__icon svg {
        color: #f87171;
    }

    .fb-notif--success {
        background: #052e16;
        border-color: #14532d;
        color: #bbf7d0;
    }
    .fb-notif--success .fb-notif__icon {
        background: #14532d;
    }
    .fb-notif--success .fb-notif__icon svg {
        color: #4ade80;
    }

    .fb-notif__close:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* ===== Accessibility ===== */
.fb-notif:focus-within {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ===== Print ===== */
@media print {
    .fb-notif {
        box-shadow: none;
        border: 1px solid #e5e7eb;
        break-inside: avoid;
        animation: none;
    }

    .fb-notif__close,
    .fb-notif__progress {
        display: none;
    }
}

/* ===== Legacy class support (backward compat) ===== */
.food-butik-notification {
    display: none;
}
