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

.foodord-mobile-cart__item-quantity {
    position: relative;
    cursor: default;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    transition: none;
    user-select: none;
    min-width: 0;
    height: auto;
    font-size: inherit;
    text-align: inherit;
    display: block;
    flex-shrink: 0;
    z-index: 1150;
    align-self: flex-start;
    overflow: visible;
}

.foodord-mobile-cart__item-quantity:hover {
    border-color: transparent;
    transform: none;
    box-shadow: none;
}

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

.foodord-mobile-cart__item-quantity.active {
    border-color: transparent;
    box-shadow: none;
}

/* Persistent inline controls */
.mobile-popover {
    position: static;
    right: auto;
    top: auto;
    transform: none;
    background: var(--foodord-quantity-popover-bg, #f7f8fa);
    border: 1px solid var(--foodord-quantity-popover-border, #d9dde4);
    border-radius: 999px;
    padding: 2px 3px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 1200;
    opacity: 1;
    visibility: visible;
    transition: none;
    backdrop-filter: none;
    transform-origin: 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: none;
}

.mobile-popover::before {
    display: none;
}

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

.mobile-popover.closing {
    animation: none;
}

/* Button animations */
.mobile-popover button {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    position: relative;
    font-size: 22px;
    font-weight: 400;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    color: var(--foodord-quantity-popover-btn-color, #323232);
}

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

.mobile-popover button.plus::before {
    content: "";
    width: 14px;
    height: 14px;
    display: block;
    background:
        linear-gradient(currentColor, currentColor) center / 14px 2px no-repeat,
        linear-gradient(currentColor, currentColor) center / 2px 14px no-repeat;
}

.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: transparent;
    transform: none;
    box-shadow: none;
}

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

.mobile-popover button:active {
    transform: none;
    box-shadow: none;
}

.mobile-popover button.minus.trash:hover {
    background: var(--foodord-quantity-popover-trash-hover-bg, #f7f8fa);
    border-color: transparent;
    color: var(--foodord-quantity-popover-trash-hover-color, #ea004b);
}

.mobile-popover button.plus {
    background: transparent;
    border-color: transparent;
    color: var(--foodord-quantity-popover-btn-color);
}

.mobile-popover button.plus:hover {
    border-color: transparent;
    color: var(--foodord-quantity-popover-btn-hover-color, #ea004b);
    box-shadow: none;
}

/* 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: 20px;
    text-align: center;
    font-weight: 600;
    color: var(--foodord-quantity-popover-value-color, #323232);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    font-size: 15px;
}
