.mgbar {
    position: fixed;
    z-index: 99990;
    right: 82px;
    bottom: max(10px, calc(env(safe-area-inset-bottom) + 10px));
    left: 10px;
    display: flex;
    justify-content: flex-start;
    pointer-events: none;
    transition: transform 0.18s ease, opacity 0.18s ease, visibility 0.18s ease;
}

.mgbar--hidden {
    visibility: hidden;
    opacity: 0;
    transform: translateY(140%);
}

.mgbar__inner {
    display: flex;
    gap: 8px;
    align-items: center;
    width: min(100%, 520px);
    padding: 6px;
    border: 1px solid #cbd9e8;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 14px 34px rgba(18, 36, 58, 0.22);
    backdrop-filter: blur(10px);
    pointer-events: auto;
}

.mgbar__btn {
    display: inline-flex !important;
    flex: 1;
    gap: 8px;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 10px 14px;
    border-radius: 11px;
    font: 800 0.88rem/1.1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    text-decoration: none;
    touch-action: manipulation;
}

#mgbar-regatear,
.mgbar__btn--offer {
    border: 1px solid #0b5cad !important;
    background: #0b5cad !important;
    color: #fff !important;
    cursor: pointer !important;
    box-shadow: 0 8px 18px rgba(11, 92, 173, 0.24);
    pointer-events: auto !important;
}

#mgbar-regatear:hover,
#mgbar-regatear:focus-visible,
#mgbar-regatear:active,
.mgbar__btn--offer:hover,
.mgbar__btn--offer:focus-visible,
.mgbar__btn--offer:active {
    border-color: #084785 !important;
    background: #084785 !important;
    color: #fff !important;
}

.mgbar__cart {
    position: relative;
    display: grid;
    flex: 0 0 50px;
    place-items: center;
    width: 50px;
    height: 50px;
    border: 1px solid #cbd9e8;
    border-radius: 11px;
    background: #eef6ff;
    color: #084785;
    text-decoration: none;
    pointer-events: auto;
}

.mgbar__cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    display: grid;
    min-width: 19px;
    height: 19px;
    padding: 0 4px;
    place-items: center;
    border-radius: 999px;
    background: #087f5b;
    color: #fff;
    font: 800 0.68rem/1 system-ui, sans-serif;
}

.mgbar__btn--hidden {
    display: none !important;
}

@media (min-width: 768px) {
    .mgbar {
        display: none;
    }
}

@media (max-width: 350px) {
    .mgbar {
        right: 74px;
        left: 6px;
    }

    .mgbar__btn {
        padding-inline: 8px;
        font-size: 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mgbar {
        transition: none;
    }
}
