/* Fancy alerts — admin + storefront */
.fancy-alert-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.fancy-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 1.1rem;
    border-radius: 14px;
    border: 1px solid transparent;
    box-shadow: 0 8px 24px rgba(26, 15, 20, 0.08);
    position: relative;
    overflow: hidden;
    animation: fancy-alert-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.fancy-alert::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 14px 0 0 14px;
}

.fancy-alert-icon {
    flex-shrink: 0;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.fancy-alert-body {
    flex: 1;
    min-width: 0;
    padding-top: 0.1rem;
}

.fancy-alert-title {
    display: block;
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    margin-bottom: 0.15rem;
}

.fancy-alert-text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    opacity: 0.95;
}

.fancy-alert-text ul {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
}

.fancy-alert-close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    opacity: 0.55;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s, background 0.15s;
}

.fancy-alert-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
}

.fancy-alert--success {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 45%, #d1fae5 100%);
    border-color: rgba(16, 185, 129, 0.25);
    color: #065f46;
}

.fancy-alert--success::before {
    background: linear-gradient(180deg, #34d399, #059669);
}

.fancy-alert--success .fancy-alert-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.fancy-alert--danger {
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 50%, #fee2e2 100%);
    border-color: rgba(220, 38, 38, 0.2);
    color: #991b1b;
}

.fancy-alert--danger::before {
    background: linear-gradient(180deg, #f87171, #dc2626);
}

.fancy-alert--danger .fancy-alert-icon {
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
}

.fancy-alert--warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 55%, #fde68a 100%);
    border-color: rgba(217, 119, 6, 0.25);
    color: #92400e;
}

.fancy-alert--warning::before {
    background: linear-gradient(180deg, #fbbf24, #d97706);
}

.fancy-alert--warning .fancy-alert-icon {
    background: rgba(217, 119, 6, 0.15);
    color: #b45309;
}

.fancy-alert--info {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    border-color: rgba(100, 116, 139, 0.25);
    color: #334155;
}

.fancy-alert--info::before {
    background: linear-gradient(180deg, #94a3b8, #64748b);
}

.fancy-alert--info .fancy-alert-icon {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.fancy-alert--hide {
    animation: fancy-alert-out 0.35s ease forwards;
}

@keyframes fancy-alert-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fancy-alert-out {
    to {
        opacity: 0;
        transform: translateY(-6px);
        max-height: 0;
        margin: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* Fixed toast stack (optional) */
.fancy-toast-region {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1080;
    width: min(420px, calc(100vw - 2rem));
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    pointer-events: none;
}

.fancy-toast-region .fancy-alert {
    pointer-events: auto;
}

/* —— Fancy confirm modal (sharp popup — no backdrop blur on dialog) —— */
.fancy-confirm {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    visibility: hidden;
    pointer-events: none;
    isolation: isolate;
}

.fancy-confirm[hidden] {
    display: flex !important;
}

.fancy-confirm.fancy-confirm--open {
    visibility: visible;
    pointer-events: auto;
}

.fancy-confirm-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(22, 12, 14, 0.72);
    opacity: 0;
    transition: opacity 0.22s ease;
    /* Solid dim only — blur made the popup look soft on some browsers */
}

.fancy-confirm.fancy-confirm--open .fancy-confirm-backdrop {
    opacity: 1;
}

.fancy-confirm-dialog {
    position: relative;
    z-index: 1;
    width: min(440px, calc(100% - 2rem));
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 2rem 2rem 1.65rem;
    text-align: center;
    box-shadow: 0 24px 48px rgba(26, 15, 20, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    transform: translate3d(0, 10px, 0) scale(0.97);
    opacity: 0;
    filter: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    backface-visibility: hidden;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

.fancy-confirm.fancy-confirm--open .fancy-confirm-dialog {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
}

.fancy-confirm-icon-wrap {
    width: 4.25rem;
    height: 4.25rem;
    margin: 0 auto 1.15rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #b45309;
    box-shadow: 0 10px 24px rgba(217, 119, 6, 0.22);
}

.fancy-confirm.fancy-confirm--danger .fancy-confirm-icon-wrap {
    background: linear-gradient(145deg, #fde8e8 0%, #fecaca 100%);
    color: #b91c1c;
    box-shadow: 0 10px 28px rgba(185, 28, 28, 0.22);
}

.fancy-confirm.fancy-confirm--danger .fancy-confirm-icon-wrap .bi {
    font-size: 1.75rem;
}

.fancy-confirm-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a0f14;
    margin: 0 0 0.65rem;
    line-height: 1.3;
    letter-spacing: 0.01em;
}

.fancy-confirm-message {
    font-size: 1rem;
    color: #475569;
    line-height: 1.55;
    margin: 0 auto 1.5rem;
    max-width: 22rem;
}

.fancy-confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.fancy-confirm-btn-cancel {
    flex: 1 1 8.5rem;
    min-width: 7.5rem;
    max-width: 11rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.72rem 1.25rem;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    color: #334155;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.fancy-confirm-btn-cancel:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #1e293b;
}

.fancy-confirm-btn-ok {
    flex: 1 1 8.5rem;
    min-width: 7.5rem;
    max-width: 11rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9375rem;
    padding: 0.72rem 1.25rem;
    border: none;
    color: #fff;
    background: linear-gradient(180deg, #9b1b3f 0%, #7a1532 100%);
    box-shadow: 0 6px 18px rgba(155, 27, 63, 0.38);
}

.fancy-confirm-btn-ok:hover {
    color: #fff;
    filter: brightness(1.06);
    box-shadow: 0 8px 22px rgba(155, 27, 63, 0.42);
}

.fancy-confirm.fancy-confirm--danger .fancy-confirm-btn-ok {
    background: linear-gradient(180deg, #7b2f26 0%, #5e231c 100%);
    box-shadow: 0 6px 18px rgba(123, 47, 38, 0.4);
}

.fancy-confirm.fancy-confirm--danger .fancy-confirm-btn-ok:hover {
    box-shadow: 0 8px 22px rgba(123, 47, 38, 0.48);
}

.fancy-confirm-btn-cancel:focus-visible,
.fancy-confirm-btn-ok:focus-visible {
    outline: 2px solid #64748b;
    outline-offset: 2px;
}

body.fancy-confirm-open {
    overflow: hidden;
}
