/* ==================== FLOATING CART BAR ==================== */
/* Swiggy/Zomato style bottom cart bar - shows on all pages */

.floating-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.floating-cart-bar.visible {
    transform: translateY(0);
    pointer-events: all;
}

.floating-cart-inner {
    max-width: 720px;
    margin: 0 auto 12px;
    padding: 0 16px;
}

.floating-cart-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--primary-green-dark, #1b5e20), var(--primary-green, #2e7d32));
    color: var(--white, #ffffff);
    padding: 14px 20px;
    border-radius: 16px;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.2),
                0 8px 32px rgba(46, 125, 50, 0.25);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible; /* ✅ FIX: was hidden — clipped the badge */
}

.floating-cart-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 50%);
    pointer-events: none;
    border-radius: inherit;
}

.floating-cart-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 -2px 24px rgba(0, 0, 0, 0.25),
                0 12px 40px rgba(46, 125, 50, 0.35);
}

.floating-cart-content:active {
    transform: scale(0.98);
}

/* ── Left side: icon + info ── */
.floating-cart-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.floating-cart-icon-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.floating-cart-content:hover .floating-cart-icon-wrap {
    background: rgba(255, 255, 255, 0.22);
}

.floating-cart-icon-wrap i {
    font-size: 1.25rem;
    color: var(--white, #fff);
}

.floating-cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    background: var(--accent-red, #e53935);
    color: var(--white, #fff);
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid var(--primary-green-dark, #1b5e20);
    animation: cartBadgePop 0.3s ease;
    font-family: 'Poppins', sans-serif;
    line-height: 1;
}

@keyframes cartBadgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.floating-cart-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.floating-cart-items-text {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.floating-cart-total {
    font-size: 0.75rem;
    opacity: 0.8;
    white-space: nowrap;
    font-weight: 500;
}

/* ── Right side: view cart button ── */
.floating-cart-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.floating-cart-view-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--secondary-orange, #ff9800), var(--secondary-orange-light, #ffb74d));
    border: none;
    border-radius: 12px;
    color: var(--white, #fff);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.floating-cart-view-btn:hover {
    background: linear-gradient(135deg, #f57c00, var(--secondary-orange, #ff9800));
    transform: scale(1.03);
    box-shadow: 0 4px 14px rgba(255, 152, 0, 0.4);
}

.floating-cart-view-btn:active {
    transform: scale(0.97);
}

.floating-cart-view-btn i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.floating-cart-view-btn:hover i {
    transform: translateX(3px);
}

/* ==================== ORDER TRACKING POPUP ==================== */

.order-tracking-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.order-tracking-popup.visible {
    transform: translateY(0);
    pointer-events: all;
}

.order-tracking-popup.with-cart {
    bottom: 80px;
}

.order-popup-inner {
    max-width: 720px;
    margin: 0 auto 12px;
    padding: 0 16px;
}

.order-popup-content {
    background: var(--white, #fff);
    border-radius: 16px;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.12),
                0 8px 32px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e8f5e9;
}

/* ── Popup Header ── */
.order-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 10px;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border-bottom: 1px solid #c8e6c9;
    cursor: pointer;
    transition: background 0.2s ease;
}

.order-popup-header:hover {
    background: linear-gradient(135deg, #dcedc8, #e8f5e9);
}

.order-popup-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.order-popup-live-dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    background: var(--primary-green-light, #4caf50);
    border-radius: 50%;
    flex-shrink: 0;
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.order-popup-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-green-dark, #1b5e20);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-popup-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.order-popup-eta {
    font-size: 0.75rem;
    color: var(--primary-green, #2e7d32);
    font-weight: 600;
    background: var(--white, #fff);
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.order-popup-close {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #888;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.order-popup-close:hover {
    background: var(--accent-red, #e53935);
    color: var(--white, #fff);
}

/* ── Popup Body ── */
.order-popup-body {
    padding: 14px 18px 16px;
}

/* ── Mini Progress Bar ── */
.order-popup-progress {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 14px;
    position: relative;
}

.order-popup-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 2;
}

.order-popup-step-dot {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: var(--light-gray, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    position: relative;
}

.order-popup-step-dot i {
    font-size: 0.65rem;
    color: var(--medium-gray, #9e9e9e);
    transition: all 0.4s ease;
}

.order-popup-step.completed .order-popup-step-dot {
    background: var(--primary-green-light, #4caf50);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.order-popup-step.completed .order-popup-step-dot i {
    color: var(--white, #fff);
}

.order-popup-step.active .order-popup-step-dot {
    background: var(--secondary-orange, #ff9800);
    box-shadow: 0 2px 12px rgba(255, 152, 0, 0.4);
    animation: activeStepPulse 2s ease-in-out infinite;
}

@keyframes activeStepPulse {
    0%, 100% { box-shadow: 0 2px 12px rgba(255, 152, 0, 0.4); }
    50% { box-shadow: 0 2px 20px rgba(255, 152, 0, 0.6); }
}

.order-popup-step.active .order-popup-step-dot i {
    color: var(--white, #fff);
}

.order-popup-step-label {
    font-size: 0.62rem;
    color: var(--medium-gray, #999);
    margin-top: 5px;
    white-space: nowrap;
    font-weight: 500;
    transition: all 0.3s ease;
}

.order-popup-step.completed .order-popup-step-label {
    color: var(--primary-green-light, #4caf50);
    font-weight: 600;
}

.order-popup-step.active .order-popup-step-label {
    color: var(--secondary-orange, #ff9800);
    font-weight: 600;
}

/* ── Progress Connector Lines ── */
.order-popup-connector {
    flex: 1;
    height: 3px;
    background: var(--light-gray, #e0e0e0);
    position: relative;
    top: 12px; /* half of step-dot height (28/2 - 3/2) */
    z-index: 1;
    border-radius: 2px;
    overflow: hidden;
}

.order-popup-connector-fill {
    height: 100%;
    background: var(--primary-green-light, #4caf50);
    width: 0%;
    transition: width 0.6s ease;
    border-radius: 2px;
}

.order-popup-connector.filled .order-popup-connector-fill {
    width: 100%;
}

.order-popup-connector.half .order-popup-connector-fill {
    width: 50%;
    background: linear-gradient(90deg, var(--primary-green-light, #4caf50), var(--secondary-orange, #ff9800));
}

/* ── Status Message ── */
.order-popup-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #f8fdf8;
    border-radius: 12px;
    border: 1px solid #e8f5e9;
}

.order-popup-status-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.05rem;
}

.order-popup-status-icon.confirmed {
    background: #e3f2fd;
    color: var(--accent-blue, #1976d2);
}

.order-popup-status-icon.packed {
    background: #fff3e0;
    color: #f57c00;
}

.order-popup-status-icon.shipped {
    background: #e8f5e9;
    color: var(--primary-green, #2e7d32);
}

.order-popup-status-icon.delivered {
    background: #e8f5e9;
    color: var(--primary-green-dark, #1b5e20);
}

.order-popup-status-text {
    flex: 1;
    min-width: 0;
}

.order-popup-status-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--black, #212121);
    margin-bottom: 2px;
}

.order-popup-status-desc {
    font-size: 0.72rem;
    color: var(--medium-gray, #888);
}

.order-popup-track-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary-green, #2e7d32), var(--primary-green-light, #4caf50));
    border: none;
    border-radius: 8px;
    color: var(--white, #fff);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(46, 125, 50, 0.2);
}

.order-popup-track-btn:hover {
    background: linear-gradient(135deg, var(--primary-green-dark, #1b5e20), var(--primary-green, #2e7d32));
    transform: scale(1.03);
    box-shadow: 0 3px 10px rgba(46, 125, 50, 0.3);
}

.order-popup-track-btn:active {
    transform: scale(0.97);
}

.order-popup-track-btn i {
    font-size: 0.65rem;
}

/* ── Multiple Orders Indicator ── */
.order-popup-multi {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 0;
    border-top: 1px solid #f0f0f0;
    margin-top: 12px;
}

.order-popup-multi-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--light-gray, #e0e0e0);
    transition: all 0.3s ease;
    cursor: pointer;
}

.order-popup-multi-dot:hover {
    background: #bdbdbd;
}

.order-popup-multi-dot.active {
    background: var(--primary-green-light, #4caf50);
    width: 22px;
    border-radius: 4px;
}

/* ── Minimized State ── */
.order-popup-minimized {
    display: none;
}

.order-tracking-popup.minimized .order-popup-body {
    display: none;
}

.order-tracking-popup.minimized .order-popup-content {
    border-radius: 16px;
}

/* ==================== RESPONSIVE — 768px ==================== */
@media (max-width: 768px) {
    .floating-cart-inner {
        margin: 0 auto 8px;
        padding: 0 12px;
    }

    .floating-cart-content {
        padding: 12px 16px;
        border-radius: 14px;
    }

    .floating-cart-icon-wrap {
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 10px;
    }

    .floating-cart-icon-wrap i {
        font-size: 1.15rem;
    }

    .floating-cart-badge {
        min-width: 20px;
        height: 20px;
        font-size: 0.65rem;
        top: -5px;
        right: -5px;
        border-width: 2px;
    }

    .floating-cart-items-text {
        font-size: 0.82rem;
    }

    .floating-cart-total {
        font-size: 0.7rem;
    }

    .floating-cart-view-btn {
        padding: 9px 18px;
        font-size: 0.82rem;
        border-radius: 10px;
    }

    /* Order popup */
    .order-popup-inner {
        margin: 0 auto 8px;
        padding: 0 12px;
    }

    .order-popup-header {
        padding: 12px 14px 8px;
    }

    .order-popup-title {
        font-size: 0.82rem;
    }

    .order-popup-eta {
        font-size: 0.72rem;
        padding: 3px 10px;
    }

    .order-popup-body {
        padding: 12px 14px 14px;
    }

    .order-popup-step-dot {
        width: 26px;
        height: 26px;
        min-width: 26px;
    }

    .order-popup-step-dot i {
        font-size: 0.58rem;
    }

    .order-popup-step-label {
        font-size: 0.58rem;
    }

    .order-popup-connector {
        top: 11px;
    }

    .order-tracking-popup.with-cart {
        bottom: 70px;
    }

    .order-popup-status {
        gap: 10px;
        padding: 10px 12px;
    }

    .order-popup-status-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 0.92rem;
    }

    .order-popup-status-title {
        font-size: 0.8rem;
    }

    .order-popup-status-desc {
        font-size: 0.68rem;
    }

    .order-popup-track-btn {
        padding: 7px 14px;
        font-size: 0.72rem;
    }
}

/* ==================== RESPONSIVE — 480px ==================== */
@media (max-width: 480px) {
    .floating-cart-inner {
        margin: 0 auto 6px;
        padding: 0 8px;
    }

    .floating-cart-content {
        padding: 10px 14px;
        border-radius: 12px;
    }

    .floating-cart-left {
        gap: 10px;
    }

    .floating-cart-icon-wrap {
        width: 36px;
        height: 36px;
        min-width: 36px;
        border-radius: 9px;
    }

    .floating-cart-icon-wrap i {
        font-size: 1.05rem;
    }

    .floating-cart-badge {
        min-width: 18px;
        height: 18px;
        font-size: 0.6rem;
        top: -4px;
        right: -4px;
        border-width: 2px;
    }

    .floating-cart-items-text {
        font-size: 0.75rem;
    }

    .floating-cart-total {
        font-size: 0.65rem;
    }

    .floating-cart-view-btn {
        padding: 8px 14px;
        font-size: 0.78rem;
        gap: 5px;
        border-radius: 9px;
    }

    .floating-cart-view-btn i {
        font-size: 0.72rem;
    }

    /* Order popup */
    .order-popup-inner {
        padding: 0 8px;
        margin: 0 auto 6px;
    }

    .order-popup-header {
        padding: 10px 12px 7px;
    }

    .order-popup-title {
        font-size: 0.78rem;
    }

    .order-popup-eta {
        font-size: 0.68rem;
        padding: 3px 8px;
    }

    .order-popup-close {
        width: 26px;
        height: 26px;
        min-width: 26px;
        font-size: 0.68rem;
    }

    .order-popup-body {
        padding: 10px 12px 12px;
    }

    .order-popup-step-dot {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }

    .order-popup-step-dot i {
        font-size: 0.5rem;
    }

    .order-popup-step-label {
        font-size: 0.52rem;
    }

    .order-popup-connector {
        height: 2px;
        top: 9px;
    }

    .order-popup-status {
        padding: 8px 10px;
        gap: 8px;
        border-radius: 10px;
    }

    .order-popup-status-icon {
        width: 30px;
        height: 30px;
        min-width: 30px;
        border-radius: 8px;
        font-size: 0.85rem;
    }

    .order-popup-status-title {
        font-size: 0.75rem;
    }

    .order-popup-status-desc {
        font-size: 0.65rem;
    }

    .order-popup-track-btn {
        padding: 6px 12px;
        font-size: 0.68rem;
        border-radius: 7px;
    }

    .order-tracking-popup.with-cart {
        bottom: 60px;
    }

    .order-popup-multi-dot {
        width: 6px;
        height: 6px;
    }

    .order-popup-multi-dot.active {
        width: 18px;
    }
}

/* ==================== RESPONSIVE — 360px ==================== */
@media (max-width: 360px) {
    .floating-cart-inner {
        padding: 0 6px;
        margin: 0 auto 4px;
    }

    .floating-cart-content {
        padding: 8px 10px;
        border-radius: 10px;
    }

    .floating-cart-left {
        gap: 8px;
    }

    .floating-cart-icon-wrap {
        width: 32px;
        height: 32px;
        min-width: 32px;
        border-radius: 8px;
    }

    .floating-cart-icon-wrap i {
        font-size: 0.95rem;
    }

    .floating-cart-badge {
        min-width: 16px;
        height: 16px;
        font-size: 0.55rem;
        top: -3px;
        right: -3px;
        border-width: 1.5px;
        padding: 0 3px;
    }

    .floating-cart-items-text {
        font-size: 0.68rem;
    }

    .floating-cart-total {
        font-size: 0.6rem;
    }

    /* ✅ Only hide text label at extreme small — keep arrow icon */
    .floating-cart-view-btn .btn-label {
        display: none;
    }

    .floating-cart-view-btn {
        padding: 7px 12px;
        font-size: 0.72rem;
        border-radius: 8px;
        gap: 0;
    }

    .floating-cart-view-btn i {
        font-size: 0.8rem;
    }

    /* Order popup */
    .order-popup-inner {
        padding: 0 6px;
    }

    .order-popup-header {
        padding: 8px 10px 6px;
        gap: 6px;
    }

    .order-popup-title {
        font-size: 0.72rem;
    }

    .order-popup-live-dot {
        width: 8px;
        height: 8px;
        min-width: 8px;
    }

    .order-popup-eta {
        font-size: 0.62rem;
        padding: 2px 7px;
    }

    .order-popup-close {
        width: 24px;
        height: 24px;
        min-width: 24px;
        font-size: 0.62rem;
    }

    .order-popup-body {
        padding: 8px 10px 10px;
    }

    .order-popup-step-dot {
        width: 20px;
        height: 20px;
        min-width: 20px;
    }

    .order-popup-step-dot i {
        font-size: 0.45rem;
    }

    .order-popup-step-label {
        font-size: 0.48rem;
    }

    .order-popup-connector {
        top: 8px;
    }

    .order-popup-status {
        padding: 7px 8px;
        border-radius: 8px;
        gap: 6px;
    }

    .order-popup-status-icon {
        width: 26px;
        height: 26px;
        min-width: 26px;
        font-size: 0.78rem;
        border-radius: 7px;
    }

    .order-popup-status-title {
        font-size: 0.7rem;
    }

    .order-popup-status-desc {
        font-size: 0.6rem;
    }

    .order-popup-track-btn {
        padding: 5px 10px;
        font-size: 0.65rem;
        border-radius: 6px;
    }

    .order-tracking-popup.with-cart {
        bottom: 50px;
    }

    .order-popup-multi-dot {
        width: 5px;
        height: 5px;
    }

    .order-popup-multi-dot.active {
        width: 14px;
    }
}

/* ==================== BODY PADDING ==================== */
body.has-floating-cart {
    padding-bottom: 82px;
}

body.has-floating-cart.has-order-popup {
    padding-bottom: 200px;
}

body.has-order-popup:not(.has-floating-cart) {
    padding-bottom: 140px;
}

@media (max-width: 480px) {
    body.has-floating-cart {
        padding-bottom: 68px;
    }

    body.has-floating-cart.has-order-popup {
        padding-bottom: 175px;
    }

    body.has-order-popup:not(.has-floating-cart) {
        padding-bottom: 120px;
    }
}

@media (max-width: 360px) {
    body.has-floating-cart {
        padding-bottom: 56px;
    }

    body.has-floating-cart.has-order-popup {
        padding-bottom: 155px;
    }

    body.has-order-popup:not(.has-floating-cart) {
        padding-bottom: 105px;
    }
}

/* ── Hide on cart page ── */
body.page-cart .floating-cart-bar {
    display: none !important;
}



/* ==================== MULTI-ORDER POPUP CONTAINER ==================== */
.order-tracking-popup-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99998;
    display: none;
    flex-direction: column;
    gap: 10px;
    max-width: 95%;
    width: 420px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 5px;
    scrollbar-width: none;
}

.order-tracking-popup-container::-webkit-scrollbar {
    display: none;
}

.order-tracking-popup-container.visible {
    display: flex;
}

.order-tracking-popup-container.with-cart {
    bottom: 85px;
}

/* ✅ Delivered card styling */
.order-tracking-popup.delivered-card {
    opacity: 0.7;
    pointer-events: auto;
}

.order-tracking-popup.delivered-card .order-popup-live-dot {
    background: #4caf50 !important;
    animation: none !important;
}

.order-tracking-popup.delivered-card .order-popup-inner {
    border: 2px solid #4caf50;
}

/* ✅ Minimized card */
.order-tracking-popup.minimized .order-popup-body {
    display: none;
}

.order-tracking-popup.minimized .order-popup-inner {
    border-radius: 16px;
}

/* ✅ Live dot for delivered */
.order-popup-live-dot.delivered {
    background: #4caf50 !important;
    animation: none !important;
}

/* ✅ Multiple cards stacking */
.order-tracking-popup-container .order-tracking-popup {
    width: 100%;
    transition: all 0.3s ease;
}

.order-tracking-popup-container .order-tracking-popup:hover {
    transform: scale(1.01);
}

/* ✅ Mobile responsive */
@media (max-width: 480px) {
    .order-tracking-popup-container {
        width: 95%;
        bottom: 15px;
    }

    .order-tracking-popup-container.with-cart {
        bottom: 80px;
    }
}