/* ==========================================================================
   QRİO — menu-order.css
   Публичное меню: корзина, выбор варианта и количества, оформление заказа
   ========================================================================== */

body.has-cart .m-body {
    padding-bottom: 72px;
}

/* ---------- Панель корзины ---------- */
.m-cartbar {
    position: fixed;
    left: 50%;
    bottom: calc(76px + env(safe-area-inset-bottom));
    z-index: 45;
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc(100% - 24px);
    max-width: 536px;
    height: 56px;
    padding: 0 18px 0 10px;
    border: 0;
    border-radius: 18px;
    background: var(--accent);
    color: var(--accent-ink);
    font: inherit;
    font-weight: 700;
    box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.45);
    transform: translateX(-50%);
    cursor: pointer;
    animation: m-cart-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.m-cartbar[hidden] {
    display: none;
}

@keyframes m-cart-in {
    from { opacity: 0; transform: translate(-50%, 16px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.m-cartbar__count {
    display: grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
}

.m-cartbar__label {
    flex: 1;
    text-align: left;
}

/* ---------- Выбор в карточке блюда ---------- */
.m-add {
    display: grid;
    gap: 14px;
    margin-top: 6px;
    padding-top: 16px;
    border-top: 1px solid var(--m-line);
}

.m-add[hidden] {
    display: none;
}

.m-add__variants {
    display: grid;
    gap: 6px;
}

.m-add__title {
    color: var(--m-muted);
    font-size: 0.8125rem;
    font-weight: 700;
}

.m-opt {
    cursor: pointer;
}

.m-opt__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.m-opt__box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1.5px solid var(--m-line);
    background: var(--m-soft);
    color: var(--m-text);
    font-size: 0.9375rem;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.m-opt__input:checked + .m-opt__box {
    border-color: var(--accent);
    background: var(--m-surface);
}

.m-opt__input:focus-visible + .m-opt__box {
    box-shadow: 0 0 0 3px var(--m-soft);
}

.m-opt.is-off {
    opacity: 0.45;
    cursor: not-allowed;
}

.m-add__row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.m-add__btn {
    flex: 1;
}

.m-add__btn:disabled {
    opacity: 0.5;
}

.m-qty {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--m-soft);
}

.m-qty__btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--m-text);
    font: inherit;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
}

.m-qty__num {
    min-width: 22px;
    text-align: center;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.m-qty--lg .m-qty__btn {
    width: 44px;
    height: 46px;
}

/* ---------- Корзина ---------- */
.m-cart__lines {
    display: grid;
    gap: 8px;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.m-cart__line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--m-line);
}

.m-cart__name {
    color: var(--m-text);
    font-size: 0.9375rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.m-cart__lsum {
    min-width: 70px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.m-cart__sum {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    margin: 6px 0 0;
    color: var(--m-muted);
    font-size: 0.9375rem;
}

.m-cart__sum dd {
    margin: 0;
    color: var(--m-text);
    font-weight: 700;
    text-align: right;
}

.m-cart__sum [hidden] {
    display: none;
}

.m-cart__total {
    padding-top: 6px;
    color: var(--m-text);
    font-size: 1.125rem;
    font-weight: 800;
}

.m-cart__hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--m-soft);
    color: var(--m-text);
    font-size: 0.8125rem;
}

.m-cart__hint[hidden] {
    display: none;
}

.m-cart__hint .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--accent);
}

.m-cart__form {
    display: grid;
    gap: 12px;
    margin-top: 8px;
}

.m-cart__form [hidden] {
    display: none;
}

.m-cart__types {
    display: flex;
    gap: 6px;
}

.m-type {
    flex: 1;
    cursor: pointer;
}

.m-type__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.m-type__box {
    display: grid;
    place-items: center;
    height: 44px;
    padding: 0 8px;
    border-radius: 12px;
    border: 1.5px solid var(--m-line);
    color: var(--m-text);
    font-size: 0.875rem;
    font-weight: 700;
    text-align: center;
}

.m-type__input:checked + .m-type__box {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-ink);
}

.m-cart__send {
    height: 52px;
}

.m-cart__send:disabled {
    opacity: 0.5;
}
