@media (max-width: 767.98px) {
    .mobile-quantity-input {
        min-height: 46px !important;
        font-size: 16px !important;
        font-weight: 700;
        cursor: pointer;
        caret-color: transparent;
        background-color: #ffffff !important;
    }

    .mobile-quantity-control.input-group .btn,
    .mobile-quantity-control.input-group .input-group-text,
    .mobile-quantity-control.input-group .form-select {
        min-height: 46px;
        font-size: 16px;
    }

    .mobile-quantity-control.input-group .btn {
        min-width: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-quantity-control.input-group .btn i {
        font-size: 1.1rem;
        line-height: 1;
    }

    .mobile-quantity-control.input-group .form-select,
    .mobile-quantity-control.input-group .input-group-text {
        font-weight: 700;
        white-space: nowrap;
    }

    .unit-switcher.mobile-quantity-unit-control,
    .detail-unit-switcher.mobile-quantity-unit-control {
        max-width: 112px !important;
        padding-left: 0.75rem;
        padding-right: 1.9rem;
    }

    .search-product-actions .quantity-input.mobile-quantity-control {
        min-height: 46px;
        border-radius: 12px;
    }

    .search-product-actions .quantity-input.mobile-quantity-control .qty-btn {
        width: 48px;
        min-width: 48px;
        height: 46px;
    }

    .search-product-actions .quantity-input.mobile-quantity-control .qty-btn i {
        font-size: 1.05rem;
    }

    .search-product-actions .quantity-input.mobile-quantity-control .qty-value {
        min-height: 46px;
        width: 66px;
        font-size: 16px !important;
        font-weight: 800;
    }

    .search-product-actions .quantity-input.mobile-quantity-control .quantity-unit-label {
        font-size: 14px;
        font-weight: 800;
        padding-inline: 10px;
    }
}

.mobile-quantity-editor {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    z-index: 1095;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

.mobile-quantity-editor[hidden] {
    display: none !important;
}

.mobile-quantity-editor__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(2px);
}

.mobile-quantity-editor__sheet {
    position: relative;
    box-sizing: border-box;
    width: min(100vw, 520px);
    max-width: 100vw;
    max-height: calc(100dvh - 24px);
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 24px 24px 0 0;
    background: #ffffff;
    box-shadow: 0 -18px 44px rgba(15, 23, 42, 0.28);
    overflow: auto;
}

.mobile-quantity-editor__sheet *,
.mobile-quantity-editor__sheet *::before,
.mobile-quantity-editor__sheet *::after {
    box-sizing: border-box;
}

@media (max-width: 767.98px) {
    .mobile-quantity-editor__sheet {
        width: 100vw;
        max-width: 100vw;
        margin-inline: 0;
        border-radius: 22px 22px 0 0;
    }
}

.mobile-quantity-editor__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.mobile-quantity-editor__eyebrow {
    margin: 0 0 2px;
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mobile-quantity-editor__title {
    margin: 0;
    color: #172033;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.25;
}

.mobile-quantity-editor__pricing {
    display: grid;
    grid-template-columns: 1fr 0.6fr;
    gap: 8px;
    margin-top: 10px;
}

.mobile-quantity-editor__pricing[hidden] {
    display: none !important;
}

.mobile-quantity-editor__pricing > div {
    padding: 10px 12px;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    background: #f8fafc;
}

.mobile-quantity-editor__pricing span {
    display: block;
    margin-bottom: 3px;
    color: #6c757d;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mobile-quantity-editor__pricing strong {
    display: block;
    color: #dc3545;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.15;
}

.mobile-quantity-editor__pricing [data-mobile-quantity-discount] {
    color: #6c757d;
}

.mobile-quantity-editor__pricing [data-mobile-quantity-discount].is-active {
    color: #198754;
}

.mobile-quantity-editor__pricing.is-loading strong {
    color: #6c757d;
}

.mobile-quantity-editor__close {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
    color: #172033;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-quantity-editor__controls {
    display: grid;
    grid-template-columns: minmax(48px, 58px) minmax(0, 1fr) minmax(48px, 58px);
    gap: 10px;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-bottom: 14px;
}

.mobile-quantity-editor__step {
    min-width: 0;
    width: 100%;
    min-height: 58px;
    border: 1px solid #d8dee8;
    border-radius: 18px;
    background: #f8fafc;
    color: #172033;
    font-size: 1.3rem;
    font-weight: 900;
}

.mobile-quantity-editor__input {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    min-height: 58px;
    border: 2px solid #dc3545;
    border-radius: 18px;
    color: #172033;
    font-size: 1.45rem;
    font-weight: 900;
    text-align: center;
    -moz-appearance: textfield;
    caret-color: transparent;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.mobile-quantity-editor__input::-webkit-outer-spin-button,
.mobile-quantity-editor__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.mobile-quantity-editor__unit {
    margin-bottom: 12px;
}

.mobile-quantity-editor__keypad {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: 100%;
    margin: 0 0 14px;
}

.mobile-quantity-editor__keypad button {
    min-width: 0;
    min-height: 48px;
    border: 1px solid #d8dee8;
    border-radius: 16px;
    background: #f8fafc;
    color: #172033;
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1;
    touch-action: manipulation;
}

.mobile-quantity-editor__keypad button:active {
    background: #e9eef6;
    transform: translateY(1px);
}

.mobile-quantity-editor__keypad button:disabled,
.mobile-quantity-editor__keypad button.is-disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.mobile-quantity-editor__keypad-clear {
    grid-column: 1 / -1;
    min-height: 42px !important;
    color: #dc3545 !important;
    background: #fff5f5 !important;
    border-color: #ffd0d5 !important;
    font-size: 0.95rem !important;
}

.mobile-quantity-editor__unit[hidden] {
    display: none !important;
}

.mobile-quantity-editor__unit label {
    display: block;
    margin-bottom: 6px;
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 700;
}

.mobile-quantity-editor__unit select {
    min-height: 52px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 800;
}

.mobile-quantity-editor__meta {
    min-height: 22px;
    margin-bottom: 16px;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.mobile-quantity-editor__actions {
    display: grid;
    grid-template-columns: 1fr;
}

.mobile-quantity-editor__actions .btn {
    min-height: 52px;
    border-radius: 16px;
    font-weight: 800;
}

html.mobile-quantity-editor-open,
body.mobile-quantity-editor-open {
    overscroll-behavior: none;
}

html.mobile-quantity-viewport-locked,
body.mobile-quantity-viewport-locked {
    overscroll-behavior: none;
}
