/* =========================================
   ORDER MODAL
========================================= */

.order-modal {
    position: fixed;
    inset: 0;
    z-index: 100;

    display: flex;
    justify-content: flex-end;
    align-items: stretch;

    visibility: hidden;
    opacity: 0;
    pointer-events: none;

    transition: opacity .3s ease, visibility .3s ease;
}

.order-modal.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.order-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(5, 5, 5, .55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.order-panel {
    position: relative;
    z-index: 2;

    width: min(560px, 100%);
    height: 100%;

    background: var(--black);
    border-left: 1px solid rgba(216, 255, 56, .14);

    overflow-y: auto;

    padding: 48px 48px 40px;
    box-sizing: border-box;

    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.2,.8,.2,1);
}

.order-modal.is-open .order-panel {
    transform: translateX(0);
}

.order-close {
    position: absolute;
    top: 24px;
    right: 28px;

    width: 42px;
    height: 42px;

    border: 1px solid rgba(245, 244, 239, .18);
    border-radius: 50%;

    background: transparent;
    color: var(--white);

    font-size: 15px;
    line-height: 1;

    cursor: pointer;

    transition: border-color .2s ease, color .2s ease, transform .2s ease;
}

.order-close:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: rotate(90deg);
}

.order-kicker {
    margin-bottom: 18px;

    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.order-title {
    margin-bottom: 42px;

    font-size: clamp(44px, 5vw, 66px);
    line-height: .88;
    letter-spacing: -3px;
    font-weight: 800;
    text-transform: uppercase;
}

/* ---------- FORM ---------- */

.order-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.order-field {
    display: flex;
    flex-direction: column;
}

.order-field label {
    margin-bottom: 9px;

    color: var(--gray);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.order-field label span {
    color: var(--accent);
}

.order-field input,
.order-field select {
    width: 100%;
    padding: 15px 16px;

    border: 1px solid rgba(245, 244, 239, .16);
    border-radius: 0;
    outline: none;

    background: #111;
    color: var(--white);

    font-family: "Manrope", sans-serif;
    font-size: 15px;
    line-height: 1.4;

    transition: border-color .2s ease, background .2s ease;
}

.order-field select {
    appearance: none;
    -webkit-appearance: none;

    background-image:
        linear-gradient(45deg, transparent 50%, var(--accent) 50%),
        linear-gradient(135deg, var(--accent) 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(50% - 4px),
        calc(100% - 15px) calc(50% - 4px);
    background-size:
        5px 5px,
        5px 5px;
    background-repeat: no-repeat;
}

.order-field input::placeholder {
    color: rgba(245, 244, 239, .32);
}

.order-field input:focus,
.order-field select:focus {
    border-color: var(--accent);
    background-color: #151515;
}

.order-field.has-error input,
.order-field.has-error select {
    border-color: #ff5c5c;
}

.order-error {
    min-height: 16px;
    margin-top: 6px;

    color: #ff8787;
    font-size: 12px;
    line-height: 1.3;
}

.order-error:empty {
    margin-top: 0;
}

.order-form-error {
    color: #ff8787;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
}

.order-form-error:empty {
    display: none;
}

.order-submit {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;

    width: 100%;
    margin-top: 8px;
    padding: 17px 22px;

    border: 0;
    border-radius: 100px;

    background: var(--accent);
    color: var(--black);

    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
    line-height: 1;

    cursor: pointer;

    transition: opacity .2s ease, transform .2s ease;
}

.order-submit:hover {
    opacity: .9;
    transform: translateY(-2px);
}

.order-submit:disabled {
    opacity: .55;
    cursor: wait;
    transform: none;
}

.order-submit-loader {
    display: none;

    width: 16px;
    height: 16px;

    border-radius: 50%;
    border: 2px solid rgba(11, 11, 11, .28);
    border-top-color: var(--black);

    animation: order-spin .7s linear infinite;
}

.order-submit.is-loading .order-submit-label {
    opacity: .65;
}

.order-submit.is-loading .order-submit-loader {
    display: inline-block;
}

@keyframes order-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- SUCCESS ---------- */

.order-view--success:not([hidden]) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
    text-align: left;
}

.order-success-text {
    max-width: 370px;
    margin: -15px 0 34px;

    color: var(--gray);
    font-size: 17px;
    line-height: 1.7;
}

/* ---------- MOBILE ---------- */

@media (max-width: 800px) {

    .order-modal {
        justify-content: center;
        align-items: flex-end;
    }

    .order-panel {
        width: 100%;
        height: 88vh;

        border-left: 0;
        border-radius: 22px 22px 0 0;

        padding: 28px 20px 24px;

        transform: translateY(100%);
        transition: transform .35s cubic-bezier(.2,.8,.2,1);
    }

    .order-modal.is-open .order-panel {
        transform: translateY(0);
    }

    .order-kicker {
        margin-bottom: 12px;
        font-size: 11px;
    }

    .order-title {
        margin-bottom: 22px;
        font-size: 38px;
        letter-spacing: -2px;
    }

    .order-form {
        gap: 14px;
    }

    .order-field label {
        margin-bottom: 6px;
        font-size: 10px;
    }

    .order-field input,
    .order-field select {
        padding: 12px 14px;
        font-size: 16px;
    }

    .order-error {
        min-height: 14px;
        margin-top: 4px;
        font-size: 11px;
    }

    .order-submit {
        margin-top: 6px;
        padding: 15px 20px;
        font-size: 12px;
    }

    .order-close {
        top: 18px;
        right: 16px;

        width: 44px;
        height: 44px;

        font-size: 16px;
        font-weight: 700;

        border: 2px solid rgba(245, 244, 239, .3);

        z-index: 10;
    }

}
