.quick-order-page {
    max-width: @wrapper_width_narrow;
    margin: 0 auto;
    padding: (@header_height + 24px) @wrapper_padding @content_padding_bottom;

    @media @flyout {
        padding-top: (@header_height + 16px);
    }

    h1 {
        margin: 0 0 8px;
    }
}

.quick-order-page__header {
    margin: 0 0 24px;
}

.quick-order-page__intro {
    margin: 0;
    .rems(15);
    color: var(--text_color);
    opacity: 0.8;
}

.quick-order-search {
    margin: 0 0 16px;
}

.quick-order-search__label {
    display: block;
    .rems(13);
    font-weight: 600;
    margin: 0 0 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--text_color);
}

.quick-order-search__field {
    position: relative;
}

.quick-order-search__input {
    width: 100%;
    padding: 14px 44px 14px 16px;
    .rems(16);
    border: 1px solid var(--border_color);
    border-radius: @border_radius;
    outline: none;
    transition: border-color 200ms ease, box-shadow 200ms ease;

    &:focus {
        border-color: var(--highlight_color, @primary_color);
        box-shadow: 0 0 0 3px fade(@primary_color, 15%);
    }

    // Remove native search cancel (we render our own)
    &::-webkit-search-cancel-button {
        display: none;
    }
}

.quick-order-search__clear {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    .rems(20);
    line-height: 1;
    color: var(--text_color);
    opacity: 0.55;
    cursor: pointer;
    border-radius: 50%;

    &:hover,
    &:focus {
        opacity: 1;
        background-color: var(--light_color);
        outline: none;
    }
}

.quick-order-search__help {
    margin: 6px 0 0;
    .rems(13);
    color: var(--text_color);
    opacity: 0.7;
}

.quick-order-status {
    min-height: 20px;
    margin: 0 0 8px;
    .rems(13);
    color: var(--text_color);
    opacity: 0.75;
}

.quick-order-loading {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.quick-order-results__header {
    display: none;

    @media all and (min-width: @medium_width) {
        display: grid;
        grid-template-columns: 60px 1fr 120px 180px 100px 160px;
        gap: 16px;
        align-items: center;
        padding: 10px 16px;
        border-bottom: 2px solid var(--border_color);
        background-color: var(--background_color);
        .rems(12);
        font-weight: 600;
        letter-spacing: 0.4px;
        text-transform: uppercase;
        color: var(--text_color);
        position: sticky;
        top: @header_height;
        z-index: 2;
    }
}

.quick-order-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border_color);
    transition: background-color 150ms ease;

    &:hover {
        background-color: var(--light_color);
    }

    &--out-of-stock {
        opacity: 0.6;
    }

    &--just-added {
        background-color: fade(@success_color, 8%);
        transition: background-color 400ms ease;
    }

    @media all and (min-width: @medium_width) {
        display: grid;
        grid-template-columns: 60px 1fr 120px 180px 100px 160px;
        gap: 16px;
        flex-wrap: nowrap;
    }
}

.quick-order-row__image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;

    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: @border_radius;
    }
}

.quick-order-row__info {
    flex: 1 1 auto;
    min-width: 0;

    @media all and (max-width: @medium_width) {
        flex: 1 1 calc(100% - 80px);
    }
}

.quick-order-row__name {
    display: block;
    font-weight: 500;
    color: inherit;
    text-decoration: none;
    .rems(15);

    &:hover {
        color: var(--highlight_color, @primary_color);
    }
}

.quick-order-row__badge {
    display: inline-block;
    padding: 2px 8px;
    margin-top: 4px;
    .rems(11);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    background-color: var(--highlight_color, @primary_color);
    color: var(--text_color_light);
}

.quick-order-row__price {
    .rems(15);
    font-weight: 600;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;

    @media all and (max-width: @medium_width) {
        width: 100%;
    }
}

.quick-order-row__price-label {
    .rems(11);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    opacity: 0.7;
    margin-right: 2px;
}

.quick-order-row__price--original {
    text-decoration: line-through;
    color: var(--border_color_dark);
    font-weight: 400;
    .rems(13);
}

.quick-order-row__price--current {
    color: inherit;
    white-space: nowrap;
}

.quick-order-row__size {
    @media all and (max-width: @medium_width) {
        width: 100%;
    }

    .productSizes {
        padding: 0;
    }
}

.quick-order-row__quantity {
    @media all and (max-width: @medium_width) {
        width: 120px;
    }
}

.quick-order-row__action {
    text-align: right;

    @media all and (min-width: @medium_width) {
        grid-column: 6;
    }

    @media all and (max-width: @medium_width) {
        flex: 1;
    }

    .quick-order-row--assessment & {
        @media all and (min-width: @medium_width) {
            grid-column: 5 / 7;
        }
    }
}

.quick-order-row__btn {
    width: 100%;
    transition: background-color 200ms ease, color 200ms ease;

    &.is-loading {
        opacity: 0.6;
        pointer-events: none;
    }

    &.is-added {
        background-color: var(--success_color);
        border-color: var(--success_color);
        color: var(--text_color_light);
    }
}

.quick-order-row__out-of-stock {
    .rems(14);
    font-weight: 500;
    color: var(--border_color_dark);
}

.quick-order-row__message {
    margin-top: 6px;
    .rems(13);

    &--success {
        color: var(--success_color);
    }

    &--error {
        color: var(--alert_color);
    }
}

.quick-order-empty {
    text-align: center;
    padding: 48px 16px;
    border: 1px dashed var(--border_color);
    border-radius: @border_radius;
    margin-top: 8px;
}

.quick-order-empty__headline {
    margin: 0 0 6px;
    .rems(16);
    font-weight: 600;
    color: var(--text_color);
}

.quick-order-empty__hint {
    margin: 0;
    .rems(14);
    color: var(--text_color);
    opacity: 0.75;
}

.quick-order-intro {
    display: grid;
    gap: 24px;
    margin-top: 8px;

    @media all and (min-width: @medium_width) {
        grid-template-columns: 2fr 1fr;
        align-items: start;
    }
}

.quick-order-intro__tips {
    background-color: var(--light_color);
    border-radius: @border_radius;
    padding: 24px 28px;
}

.quick-order-intro__title {
    margin: 0 0 12px;
    .rems(16);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.quick-order-intro__list {
    margin: 0;
    padding-left: 20px;
    .rems(15);
    line-height: 1.7;

    li + li {
        margin-top: 4px;
    }
}

.quick-order-intro__note {
    background-color: var(--background_color);
    border: 1px solid var(--border_color);
    border-left: 3px solid var(--highlight_color, @primary_color);
    border-radius: @border_radius;
    padding: 20px 22px;
    .rems(14);
    line-height: 1.5;

    p {
        margin: 0;
    }
}

// Modal
.quick-order-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
}

.quick-order-modal__dialog {
    background: var(--background_color);
    border-radius: @border_radius;
    max-width: 480px;
    width: 90%;
    padding: 32px;
    text-align: center;
}

.quick-order-modal__title {
    margin: 0 0 16px;
    .rems(22);
}

.quick-order-modal__text {
    margin: 0 0 12px;
    .rems(15);
    color: var(--text_color);
    line-height: 1.5;
}

.quick-order-modal__actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.quick-order-modal__continue {
    display: inline-block;
    width: 100%;
    text-align: center;
    text-decoration: none;
}

.quick-order-modal__cancel {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text_color);
    .rems(14);
    padding: 4px 8px;

    &:hover {
        color: var(--text_color);
    }
}
