/* Mobile Cart Popover - Enhanced Styles with Modern Animations */
:root {
    --background-color: #f7f7f7;
    --primary-color: #c9386f;
    --primary-hover: #b92a61;
    --text-color: #323232;
    --text-hover: #313131;
    --secondary-text: #6b6b6b;
    --button-bg: #c9386f;
    --button-text-color: #ffffff;
    --button-on-hover: #b92a61;
    --header-bg: #ffffff;
    --footer-bg: #ffffff;
    --footer-bottom-bg: #ffffff;
    --border-color: #f4f4f4;
}

.foodord-mobile-cart__item-quantity {
    position: relative;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #ededed;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    min-width: 20px;
    height: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1150;
    align-self: flex-start;
    overflow: visible;
}

.foodord-mobile-cart__item-quantity:hover {
    border-color: #c9386f;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(201, 56, 111, 0.1);
}

.foodord-mobile-cart__item-quantity:active {
    transform: scale(0.98);
}

.foodord-mobile-cart__item-quantity.active {
    border-color: #c9386f;
    box-shadow: 0 0 0 3px rgba(201, 56, 111, 0.1);
}

/* Popover styles with enhanced animations - slides out to left */
.mobile-popover {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) scale(0.8) translateX(20px);
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(8px);
    transform-origin: right center;
}

/* Enhanced entrance animation */
@keyframes slideMobileFromLeft {
    0% {
        transform: translateY(-50%) scale(0.6) translateX(30px);
        opacity: 0;
    }

    100% {
        transform: translateY(-50%) scale(1) translateX(12px);
        opacity: 1;
    }
}

@keyframes fadeMobileOutToRight {
    0% {
        transform: translateY(-50%) scale(1) translateX(12px);
        opacity: 1;
    }

    100% {
        transform: translateY(-50%) scale(0.6) translateX(30px);
        opacity: 0;
    }
}

.mobile-popover.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1) translateX(12px);
}

.mobile-popover::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-left: 1px solid #e5e7eb;
    border-top: 1px solid #e5e7eb;
    border-right: none;
    border-bottom: none;
    opacity: 0;
    transition: all 0.3s ease 0.15s;
    margin-left: -6px;
}

.mobile-popover.active::before {
    opacity: 1;
}

.mobile-popover.closing {
    animation: fadeMobileOutToRight 0.2s ease-in forwards;
}

/* Button animations */
.mobile-popover button {
    width: 24px;
    height: 24px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-size: 18px;
    font-weight: 400;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    color: #323232;
}

.mobile-popover button.minus:not(.trash)::before {
    content: "−";
    position: relative;
    top: -1px;
}

.mobile-popover button.plus::before {
    content: "+";
    position: relative;
    top: -1px;
}

.mobile-popover button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.mobile-popover button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(201, 56, 111, 0.05));
    opacity: 0;
    transition: all 0.3s ease;
    z-index: -1;
}

.mobile-popover button:hover {
    border-color: #c9386f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 56, 111, 0.15);
}

.mobile-popover button:hover::after {
    opacity: 1;
}

.mobile-popover button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(201, 56, 111, 0.2);
}

.mobile-popover button.minus.trash:hover {
    background: #fef2f2;
    border-color: #c9386f;
    color: #c9386f;
}

.mobile-popover button.plus {
    background: #ffffff;
    border-color: #e5e7eb;
    color: #323232;
}

.mobile-popover button.plus:hover {
    border-color: #c9386f;
    color: #c9386f;
    box-shadow: 0 4px 12px rgba(201, 56, 111, 0.15);
}

/* No animations on active state to prevent re-triggering on click */

@keyframes buttonBounceIn {
    0% {
        transform: scale(0) rotate(-90deg);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    60% {
        transform: scale(1.2);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.mobile-popover span {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    color: #323232;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    font-size: 15px;
}