/* ============================================
   ORDER SUCCESS SCREEN OVERLAY
   Full-screen success animation (mobile-first design)
   ============================================ */
.order-success-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fdf8 0%, #e8f5e9 100%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    padding: 1.5rem;
    text-align: center;
}

.order-success-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Success Icon Container */
.order-success-icon-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    margin-bottom: 2rem;
}

.order-success-circle {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, #4ade80 0%, #22c55e 50%, #16a34a 100%);
    box-shadow:
        0 20px 60px rgba(34, 197, 94, 0.35),
        0 8px 24px rgba(34, 197, 94, 0.25),
        inset 0 -4px 12px rgba(0, 0, 0, 0.1);
    transform: scale(0);
    animation: successCirclePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
}

.order-success-checkmark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-success-checkmark svg {
    width: 70px;
    height: 70px;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.order-success-checkmark svg .checkmark-path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: checkmarkDraw 0.5s ease-out 0.5s forwards;
}

/* Confetti-like particles */
.order-success-particles {
    position: absolute;
    inset: -20px;
    pointer-events: none;
}

.order-success-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0;
}

.order-success-particle:nth-child(1) { background: #fbbf24; top: 50%; left: 0; animation: particleBurst 0.8s ease-out 0.4s forwards; --tx: -30px; --ty: -20px; }
.order-success-particle:nth-child(2) { background: #60a5fa; top: 20%; left: 20%; animation: particleBurst 0.8s ease-out 0.45s forwards; --tx: -20px; --ty: -35px; }
.order-success-particle:nth-child(3) { background: #f472b6; top: 10%; left: 50%; animation: particleBurst 0.8s ease-out 0.5s forwards; --tx: 0; --ty: -40px; }
.order-success-particle:nth-child(4) { background: #a78bfa; top: 20%; right: 20%; animation: particleBurst 0.8s ease-out 0.55s forwards; --tx: 20px; --ty: -35px; }
.order-success-particle:nth-child(5) { background: #34d399; top: 50%; right: 0; animation: particleBurst 0.8s ease-out 0.6s forwards; --tx: 30px; --ty: -20px; }
.order-success-particle:nth-child(6) { background: #fb923c; bottom: 20%; right: 20%; animation: particleBurst 0.8s ease-out 0.65s forwards; --tx: 20px; --ty: 35px; }
.order-success-particle:nth-child(7) { background: #38bdf8; bottom: 10%; left: 50%; animation: particleBurst 0.8s ease-out 0.7s forwards; --tx: 0; --ty: 40px; }
.order-success-particle:nth-child(8) { background: #e879f9; bottom: 20%; left: 20%; animation: particleBurst 0.8s ease-out 0.75s forwards; --tx: -20px; --ty: 35px; }

/* Success Content */
.order-success-content {
    opacity: 0;
    transform: translateY(20px);
    animation: successContentFadeIn 0.5s ease-out 0.7s forwards;
}

.order-success-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #166534;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.order-success-message {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 2rem;
    max-width: 320px;
    line-height: 1.6;
}

/* Success Actions */
.order-success-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 320px;
    opacity: 0;
    transform: translateY(20px);
    animation: successContentFadeIn 0.5s ease-out 0.9s forwards;
}

.order-success-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.order-success-btn-primary {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

.order-success-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45);
    color: white;
}

.order-success-btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.order-success-btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

/* Close button */
.order-success-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    animation: successContentFadeIn 0.3s ease-out 1.1s forwards;
    transition: background 0.2s;
}

.order-success-close:hover {
    background: rgba(255, 255, 255, 1);
}

.order-success-close svg {
    width: 20px;
    height: 20px;
    stroke: #6b7280;
    stroke-width: 2;
}

/* Animations */
@keyframes successCirclePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes checkmarkDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

@keyframes successContentFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide animation for closing */
.order-success-overlay.hiding {
    animation: successOverlayHide 0.3s ease-in forwards;
}

@keyframes successOverlayHide {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* ============================================
   DARK MODE - Success Screen
   ============================================ */
[data-bs-theme="dark"] .order-success-overlay {
    background: linear-gradient(135deg, #0f1f0f 0%, #14241a 100%);
}

[data-bs-theme="dark"] .order-success-title {
    color: #86efac;
}

[data-bs-theme="dark"] .order-success-message {
    color: #9ca3af;
}

[data-bs-theme="dark"] .order-success-btn-secondary {
    background: #1f2937;
    color: #e5e7eb;
    border-color: #374151;
}

[data-bs-theme="dark"] .order-success-btn-secondary:hover {
    background: #374151;
    color: #f3f4f6;
}

[data-bs-theme="dark"] .order-success-close {
    background: rgba(31, 41, 55, 0.8);
}

[data-bs-theme="dark"] .order-success-close:hover {
    background: rgba(55, 65, 81, 1);
}

[data-bs-theme="dark"] .order-success-close svg {
    stroke: #9ca3af;
}

/* ============================================
   MOBILE RESPONSIVE - Success Screen
   ============================================ */
@media (max-width: 576px) {
    .order-success-icon-wrap {
        width: 120px;
        height: 120px;
        margin-bottom: 1.5rem;
    }

    .order-success-checkmark svg {
        width: 60px;
        height: 60px;
    }

    .order-success-title {
        font-size: 1.5rem;
    }

    .order-success-message {
        font-size: 0.9375rem;
    }

    .order-success-btn {
        padding: 0.875rem 1.25rem;
    }
}

/* Large screens */
@media (min-width: 768px) {
    .order-success-icon-wrap {
        width: 160px;
        height: 160px;
    }

    .order-success-checkmark svg {
        width: 80px;
        height: 80px;
    }

    .order-success-title {
        font-size: 2rem;
    }

    .order-success-actions {
        flex-direction: row;
        max-width: 400px;
    }

    .order-success-btn {
        flex: 1;
    }
}
