/* ================================================
   ACTIVE ORDER WIDGET — Premium Expandable Popup
   ================================================ */

/* --- Container --- */
#active-order-widget-container {
    position: fixed;
    bottom: 80px;
    left: 0;
    width: 100%;
    z-index: 999;
    padding: 0 12px;
    pointer-events: none;
    font-family: 'Poppins', sans-serif;
}

@media (min-width: 768px) {
    #active-order-widget-container {
        bottom: 28px;
        right: 28px;
        left: auto;
        width: 400px;
        padding: 0;
    }
}

/* --- Mini Widget Bar (collapsed state) --- */
.active-order-widget {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(108, 92, 231, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    border: 1px solid rgba(108, 92, 231, 0.08);
    pointer-events: auto;
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity 0.4s ease,
                box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.active-order-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(108, 92, 231, 0.04), transparent);
    animation: widget-shimmer 3s infinite;
}

@keyframes widget-shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

.active-order-widget:hover {
    box-shadow: 0 12px 40px rgba(108, 92, 231, 0.2), 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px) !important;
}

.active-order-widget.show {
    transform: translateY(0);
    opacity: 1;
}

.active-order-widget .widget-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    position: relative;
}

/* Pulsing ring around icon */
.active-order-widget .widget-icon::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 16px;
    border: 2px solid currentColor;
    opacity: 0;
    animation: icon-ring-pulse 2s infinite ease-out;
}

@keyframes icon-ring-pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.25); opacity: 0; }
}

.active-order-widget:hover .widget-icon {
    transform: scale(1.1);
}

.active-order-widget .widget-details {
    flex-grow: 1;
    overflow: hidden;
}

.active-order-widget .widget-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
    font-family: 'Plus Jakarta Sans', 'Poppins', sans-serif;
}

.active-order-widget .widget-status {
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.active-order-widget .widget-action {
    display: flex;
    align-items: center;
    gap: 2px;
    color: #bbb;
    font-size: 0.82rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.active-order-widget .widget-action-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: #aaa;
    display: none;
}

@media (min-width: 768px) {
    .active-order-widget .widget-action-label {
        display: inline;
    }
}

.active-order-widget:hover .widget-action {
    transform: translateX(3px);
    color: #6c5ce7;
}

/* Pulsing dot animation on the icon */
@keyframes widget-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.active-order-widget.show .widget-icon i {
    animation: widget-pulse 2s infinite ease-in-out;
}


/* ======================================
   EXPANDED POPUP OVERLAY
   ====================================== */

.order-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.order-popup-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

@media (min-width: 768px) {
    .order-popup-overlay {
        align-items: center;
    }
}

/* --- Popup Card --- */
.order-popup-card {
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    max-height: 88vh;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.15);
}

@media (min-width: 768px) {
    .order-popup-card {
        border-radius: 24px;
        transform: translateY(40px) scale(0.95);
        transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
        opacity: 0;
        box-shadow: 0 25px 80px rgba(0, 0, 0, 0.18);
    }
}

.order-popup-overlay.visible .order-popup-card {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .order-popup-overlay.visible .order-popup-card {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* --- Popup Header --- */
.order-popup-header {
    padding: 20px 22px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f5;
    position: relative;
}

.order-popup-header::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: #e0e0e5;
    border-radius: 4px;
}

@media (min-width: 768px) {
    .order-popup-header::before {
        display: none;
    }
}

.order-popup-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.order-popup-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.order-popup-header-text h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    font-family: 'Plus Jakarta Sans', 'Poppins', sans-serif;
    margin: 0;
    line-height: 1.3;
}

.order-popup-header-text p {
    font-size: 0.75rem;
    color: #888;
    margin: 2px 0 0;
    font-weight: 500;
}

.order-popup-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f5f5f8;
    color: #666;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.order-popup-close:hover {
    background: #eee;
    color: #333;
    transform: rotate(90deg);
}

/* --- Popup Body (scrollable) --- */
.order-popup-body {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1;
}

/* --- Status Badge --- */
.order-popup-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 22px;
    letter-spacing: 0.3px;
}

.order-popup-status-badge i {
    font-size: 0.75rem;
}

/* --- Progress Tracker --- */
.order-progress-tracker {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 26px;
    position: relative;
    padding: 0 4px;
}

.order-progress-tracker::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 24px;
    right: 24px;
    height: 3px;
    background: #eee;
    border-radius: 3px;
    z-index: 0;
}

.order-progress-bar-fill {
    position: absolute;
    top: 20px;
    left: 24px;
    height: 3px;
    border-radius: 3px;
    z-index: 1;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.order-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
    flex: 1;
    max-width: 70px;
}

.order-progress-step .step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f0f5;
    border: 3px solid #e0e0e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #bbb;
    transition: all 0.4s ease;
    position: relative;
}

.order-progress-step.completed .step-circle {
    background: linear-gradient(135deg, #00b894, #00cec9);
    border-color: #00b894;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 184, 148, 0.35);
}

.order-progress-step.active .step-circle {
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
    animation: step-bounce 1.5s infinite ease-in-out;
}

@keyframes step-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.order-progress-step.active .step-circle::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
    animation: step-ring 2s infinite ease-out;
}

@keyframes step-ring {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(1.4); opacity: 0; }
}

.order-progress-step .step-label {
    font-size: 0.62rem;
    font-weight: 600;
    color: #bbb;
    text-align: center;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.order-progress-step.completed .step-label,
.order-progress-step.active .step-label {
    color: #333;
    font-weight: 700;
}

/* --- Info Cards --- */
.order-popup-info-section {
    margin-bottom: 18px;
}

.order-popup-info-section .section-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.order-popup-info-card {
    background: #f9f9fc;
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid #f0f0f5;
}

.order-popup-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.order-popup-info-row:not(:last-child) {
    border-bottom: 1px solid #f0f0f5;
    padding-bottom: 10px;
    margin-bottom: 4px;
}

.order-popup-info-row .info-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.order-popup-info-row .info-content {
    flex: 1;
    min-width: 0;
}

.order-popup-info-row .info-content .info-label {
    font-size: 0.68rem;
    color: #aaa;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.order-popup-info-row .info-content .info-value {
    font-size: 0.85rem;
    color: #333;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Order Items List --- */
.order-popup-items {
    margin-bottom: 18px;
}

.order-popup-items .section-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.order-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    gap: 10px;
}

.order-item-row:not(:last-child) {
    border-bottom: 1px solid #f5f5f8;
}

.order-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.order-item-qty-badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.order-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-item-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1a1a2e;
    flex-shrink: 0;
}

/* --- Total Row --- */
.order-popup-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f8f7ff 0%, #f0eeff 100%);
    border-radius: 14px;
    border: 1px solid rgba(108, 92, 231, 0.1);
    margin-bottom: 18px;
}

.order-popup-total .total-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
}

.order-popup-total .total-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1a1a2e;
    font-family: 'Plus Jakarta Sans', 'Poppins', sans-serif;
}

/* --- Popup Footer Actions --- */
.order-popup-footer {
    padding: 16px 22px 20px;
    border-top: 1px solid #f0f0f5;
    display: flex;
    gap: 10px;
}

.order-popup-btn {
    flex: 1;
    padding: 13px 16px;
    border-radius: 14px;
    border: none;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.25s ease;
    text-decoration: none;
}

.order-popup-btn-primary {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff;
    box-shadow: 0 4px 18px rgba(108, 92, 231, 0.3);
}

.order-popup-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(108, 92, 231, 0.4);
}

.order-popup-btn-secondary {
    background: #f5f5f8;
    color: #555;
    border: 1px solid #e8e8ed;
}

.order-popup-btn-secondary:hover {
    background: #eee;
    color: #333;
}

/* --- ETA Highlight --- */
.order-popup-eta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
    border-radius: 14px;
    border: 1px solid rgba(255, 193, 7, 0.2);
    margin-bottom: 18px;
}

.order-popup-eta .eta-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 152, 0, 0.12);
    color: #f57c00;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.order-popup-eta .eta-text {
    flex: 1;
}

.order-popup-eta .eta-text .eta-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #b07800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.order-popup-eta .eta-text .eta-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: #e65100;
    font-family: 'Plus Jakarta Sans', 'Poppins', sans-serif;
}


/* ======================================
   DARK MODE SUPPORT
   ====================================== */

[data-theme="dark"] .active-order-widget {
    background: linear-gradient(135deg, #1e1e2e 0%, #252540 100%);
    border-color: rgba(108, 92, 231, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(108, 92, 231, 0.1);
}

[data-theme="dark"] .active-order-widget::before {
    background: linear-gradient(90deg, transparent, rgba(108, 92, 231, 0.06), transparent);
}

[data-theme="dark"] .active-order-widget:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(108, 92, 231, 0.2);
}

[data-theme="dark"] .active-order-widget .widget-title {
    color: #f0f0f5;
}

[data-theme="dark"] .active-order-widget .widget-action {
    color: #666;
}

[data-theme="dark"] .active-order-widget:hover .widget-action {
    color: #a29bfe;
}

/* Dark mode — Popup */
[data-theme="dark"] .order-popup-card {
    background: #1a1a2e;
    box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .order-popup-header {
    border-bottom-color: #2a2a40;
}

[data-theme="dark"] .order-popup-header::before {
    background: #333;
}

[data-theme="dark"] .order-popup-header-text h3 {
    color: #f0f0f5;
}

[data-theme="dark"] .order-popup-header-text p {
    color: #777;
}

[data-theme="dark"] .order-popup-close {
    background: #2a2a40;
    color: #aaa;
}

[data-theme="dark"] .order-popup-close:hover {
    background: #333;
    color: #fff;
}

[data-theme="dark"] .order-popup-status-badge {
    opacity: 0.95;
}

[data-theme="dark"] .order-progress-tracker::before {
    background: #2a2a40;
}

[data-theme="dark"] .order-progress-step .step-circle {
    background: #252540;
    border-color: #333;
    color: #666;
}

[data-theme="dark"] .order-progress-step .step-label {
    color: #666;
}

[data-theme="dark"] .order-progress-step.completed .step-label,
[data-theme="dark"] .order-progress-step.active .step-label {
    color: #ccc;
}

[data-theme="dark"] .order-popup-info-card {
    background: #222240;
    border-color: #2a2a45;
}

[data-theme="dark"] .order-popup-info-row:not(:last-child) {
    border-bottom-color: #2a2a45;
}

[data-theme="dark"] .order-popup-info-row .info-content .info-label {
    color: #777;
}

[data-theme="dark"] .order-popup-info-row .info-content .info-value {
    color: #ddd;
}

[data-theme="dark"] .order-item-row:not(:last-child) {
    border-bottom-color: #2a2a40;
}

[data-theme="dark"] .order-item-name {
    color: #ddd;
}

[data-theme="dark"] .order-item-price {
    color: #f0f0f5;
}

[data-theme="dark"] .order-popup-total {
    background: linear-gradient(135deg, #252545 0%, #222240 100%);
    border-color: rgba(108, 92, 231, 0.15);
}

[data-theme="dark"] .order-popup-total .total-label {
    color: #888;
}

[data-theme="dark"] .order-popup-total .total-value {
    color: #f0f0f5;
}

[data-theme="dark"] .order-popup-footer {
    border-top-color: #2a2a40;
}

[data-theme="dark"] .order-popup-btn-secondary {
    background: #252540;
    color: #bbb;
    border-color: #333;
}

[data-theme="dark"] .order-popup-btn-secondary:hover {
    background: #2a2a45;
    color: #fff;
}

[data-theme="dark"] .order-popup-eta {
    background: linear-gradient(135deg, #2a2518 0%, #332a14 100%);
    border-color: rgba(255, 152, 0, 0.15);
}

[data-theme="dark"] .order-popup-eta .eta-icon {
    background: rgba(255, 152, 0, 0.15);
}

[data-theme="dark"] .order-popup-eta .eta-text .eta-label {
    color: #b89940;
}

[data-theme="dark"] .order-popup-eta .eta-text .eta-value {
    color: #ffb74d;
}

[data-theme="dark"] .order-popup-info-section .section-label,
[data-theme="dark"] .order-popup-items .section-label {
    color: #666;
}

/* ======================================
   MULTIPLE ORDERS INDICATOR
   ====================================== */

.widget-multi-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #ff6f61, #ff4757);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
    z-index: 5;
}

[data-theme="dark"] .widget-multi-badge {
    border-color: #1e1e2e;
}
