dialog.order-item {
    border: none;
    background: none;
    max-width: 800px;
    min-width: 600px;

    @media screen and (max-width: 800px) {
        & {
            min-width: 90vw;
        }
    }


    &::backdrop {
        background-color: rgba(0, 0, 0, .8);
    }

    >.close button {
        position: absolute;
        opacity: 1;
        cursor: pointer;
        user-select: none;
        top: 5px;
        right: 5px;
        z-index: 2000;
        width: 30px;
        height: 30px;
        border: 1px solid var(--color-black);
        border-radius: 100%;
        background: #000 url(../img/icons/close_w.svg) no-repeat center center;
        background-size: 35% auto;
    }

    section>* {
        opacity: 1;
        transition: opacity 0.2s ease-out;
    }

    &.loading>section>* {
        opacity: 0;
        pointer-events: none;
    }

    &.loading>section:after {
        position: absolute;
        content: ' ';
        top: 50%;
        left: 50%;
        margin-left: -24px;
        margin-top: -24px;
        width: 48px;
        height: 48px;
        border: 4px solid var(--color-black);
        border-bottom-color: var(--secondary-color);
        border-radius: 50%;
        display: inline-block;
        box-sizing: border-box;
        animation: rotation 1s linear infinite;
    }

}


form {

    label,
    legend {
        display: block;
        font-size: 1rem;
        font-family: inherit;
        font-weight: bold;
        color: var(--text-color);
        margin-bottom: 5px;

        &.font-normal {
            font-weight: normal;
        }

        img.icon {
            margin-right: 5px;
            height: 16px;
            width: auto;
            vertical-align: middle;
            margin-top: -4px;
        }
    }

    div.input-wrap {

        &:not(.error) {
            div.error {
                display: none;
            }
        }

        &.error {

            div.error {
                color: var(--color-error);
                font-size: 0.75rem;
                font-weight: 500;
                margin-bottom: 5px;
            }

            input,
            select,
            textarea {
                background-color: var(--color-error-bg);
            }

        }

        input,
        select,
        textarea {
            font-family: inherit;
            padding: .5rem .5rem;
            font-size: 1rem;
            width: 100%;
            border: 1px solid var(--border-color);
            background: none;
            color: var(--color-black);
            box-sizing: border-box;
        }

        select {
            appearance: none;
            background: url('./../img/icons/dropdown.svg') no-repeat right 10px center;
            padding-right: 40px;

            &:invalid {
                color: #959595;
                font-weight: normal !important;
            }

        }

        &.inline {
            display: flex;
            align-items: center;
            gap: 10px;

            label {
                margin: 0;
                ;
            }

            input,
            select,
            textarea {
                flex: 0 0 auto;
                width: auto;
            }
        }

    }

    fieldset.input-group,
    fieldset.input-subgroup {

        &:not(.error) {
            div.error {
                display: none;
            }
        }

        &.error {

            div.error {
                color: var(--color-error);
                font-size: 0.875rem;
                font-weight: 500;
                margin-bottom: 5px;
            }

            input:invalid,
            select:invalid {
                background-color: var(--color-error-bg) !important;
                color: var(--color-black) !important;

                &::placeholder {
                    color: var(--color-black) !important;
                }
            }

        }

        &.rows {

            margin-top: 5px;
            width: 100%;

            >div {
                display: flex;
                gap: 10px;
                flex-direction: column;
                width: 100%;

                .input-wrap {

                    flex: 1 1 auto;
                }
            }

        }

        &.columns {

            margin-top: 5px;

            >div {
                display: grid;
                grid-template-columns: repeat(2, 1fr);
                align-items: center;
                gap: 10px 21px;
                width: 100%;

                .input-wrap {

                    flex: 1 1 auto;
                }
            }

        }

        &.input-subgroup {

            label,
            legend {
                font-size: 0.875rem;
                margin-left: 20px;
            }

            >div {
                gap: 5px;
            }
        }

        @media screen and (max-width: 800px) {
            &.input-group.columns {
                >div {
                    grid-template-columns: 1fr;
                }
            }
        }

    }
}

/* form alt inputs */
form.alt {

    label:has(strong),
    legend:has(strong) {
        font-weight: normal;
        font-size: 1.125rem;
    }

    div.input-wrap {

        input,
        select,
        textarea {
            background-color: var(--color-offwhite);
            border-radius: 10px;
            font-weight: bold;
            font-size: 1rem;

            &::placeholder {
                font-weight: normal;
            }

            &:disabled {
                background-color: var(--color-yellow);
            }
        }

        select {
            appearance: none;
            background-image: url('./../img/icons/dropdown-b.svg');

            &[data-readonly] {
                pointer-events: none;
                user-select: none;
                background-image: none;
            }

            &:disabled {
                background-image: none;
                opacity: 1;
            }
        }

    }
}

.input-confirm {

    label {
        padding: 0;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 15px;

        input[type="checkbox"] {
            appearance: none;
            display: block;
            flex: 0 0 auto;
            width: 25px;
            height: 25px;
            border: 1px solid var(--border-color);
            background: none;
            cursor: pointer;

            &:checked {
                background: url('./../img/icons/checkbox.svg') no-repeat right 10px center;
                background-position: center;
            }
        }

        a {
            font-weight: bold;
        }
    }

    label:not(.error)+div.error {
        display: none;
    }

    >div.error {
        color: var(--color-error);
        font-size: 0.875rem;
        margin-left: 45px;
        font-weight: 500;
        margin-bottom: 5px;
        margin-top: 5px;
    }

}

/* order item */
section.order-item {
    display: flex;
    flex-direction: column;
    gap: 0px;
    background-color: var(--color-beige);
    border-radius: 20px;
    border: 1px solid var(--color-black);
    max-height: 90dvh;
    overflow: hidden;

    &.loading>section>* {
        opacity: 0;
        pointer-events: none;
    }

    &.loading>section:after {
        position: absolute;
        content: ' ';
        top: 50%;
        left: 50%;
        margin-left: -24px;
        margin-top: -24px;
        width: 48px;
        height: 48px;
        border: 4px solid var(--color-black);
        border-bottom-color: var(--secondary-color);
        border-radius: 50%;
        display: inline-block;
        box-sizing: border-box;
        animation: rotation 1s linear infinite;
    }

    section.group {
        padding: 20px;
        font-size: 1rem;
        margin-bottom: 10px;
        max-width: 600px;

        h1 {
            font-size: 1.5rem;
            padding: 0;
            margin: 0;
            margin-bottom: 20px;
            text-align: center;
        }

        p {
            margin-top: 0;
        }

        button {
            margin-top: 15px;
        }

        @media screen and (max-width: 800px) {
            & {
                font-size: 14px;
                ;
            }
        }
    }

    &:not(.group)>section.group {
        display: none;
    }

    section.invalid-message {
        display: none;
    }

    &.invalid {

        >*:not(.invalid-message) {
            opacity: 0;
            pointer-events: none;
        }

        >.invalid-message {
            position: absolute;
            display: block;
            top: 50%;
            left: 50%;
            width: 100%;
            max-width: 600px;
            margin: 0 auto;
            text-align: center;
            font-size: 1.125rem;
            padding: 20px;
            transform: translate(-50%, -50%);
            font-weight: bold;
        }

    }

    hr {
        margin: 0;
    }

    p:first-child {
        margin-top: 0;
    }

    p:last-child {
        margin-bottom: 0;
    }

    section.package {
        display: flex;
        flex-direction: column;
        gap: 0px;
        background-color: var(--color-beige);
        border-radius: 20px;
        overflow: hidden;

        aside {
            background-color: var(--color-offwhite);
            padding: 25px;
            text-align: center;
            font-size: 1rem;
            font-weight: 600;
            flex: 0 0 auto;
            margin-bottom: 20px;

            &:empty {
                display: none;
            }

            @media screen and (max-width: 800px) {
                & {
                    padding: 16px;
                    font-size: 14px;
                }
            }
        }

        >div {
            padding: 25px;
            display: flex;
            flex-direction: column;
            gap: 20px;
            overscroll-behavior: contain;
            scrollbar-color: black #00000000;
            scrollbar-width: thin;
            height: 100%;
            overflow: auto;
            flex: 1 1 auto;

            @media screen and (max-width: 800px) {
                & {
                    padding: 16px;
                }
            }

            mark {
                background-color: var(--color-half-yellow);
                padding: 10px;
                display: flex;
                justify-content: center;
                gap: 10px;
                font-size: 16px;
                font-weight: 600;

                @media screen and (max-width: 800px) {
                    & {
                        padding: 5px;
                        font-size: 14px;
                    }
                }
            }

            .header {
                text-align: center;
                font-size: 1rem;
                margin-bottom: 10px;

                h1 {
                    font-size: 1.5rem;
                    padding: 0;
                    margin: 0;
                    margin-bottom: 8px;
                }

                &:not(:has(p)) h1 {
                    font-size: 1.875rem;
                    margin-bottom: -8px;
                }

                p {
                    margin-top: 0;
                }

                @media screen and (max-width: 800px) {
                    & {
                        font-size: 14px;
                        ;
                    }
                }

            }

            form {
                display: flex;
                flex-direction: column;
                gap: 20px;

                @media screen and (max-width: 480px) {

                    label,
                    legend {
                        font-size: 1rem;
                    }
                }
            }

            .overview {

                .breakdown {
                    display: flex;
                    justify-content: space-between;
                    align-items: center;

                    strong {
                        margin-left: 10px;
                    }

                    select[data-readonly] {
                        border: none;
                        background: none;
                    }

                    &.compact {
                        strong {
                            display: block;
                            margin-left: 0;
                        }

                        label {
                            display: none;
                        }

                       

                    }
                }

                @media screen and (max-width: 800px) {
                    .breakdown:not(.compact) {
                        margin-top: 10px;
                        flex-wrap: wrap;
                        gap: 5px;



                        >div:first-child {
                            flex: 0 0 auto;
                            width: 100%;
                        }
                    }
                }

            }

            .footer {
                display: flex;
                align-items: center;
                justify-content: space-between;
                gap: 12px;

                .note {
                    flex: 1 1 auto;
                    font-size: 0.8125rem
                }

                >div:last-child {
                    flex: 0 0 auto;
                }

                &:not(:has(>div.note)) {
                    justify-content: center;
                }

                @media screen and (max-width: 800px) {
                    & {
                        flex-direction: column-reverse;
                        gap: 20px;
                    }
                }

            }

        }

        &:has(aside:not(:empty)) section {
            padding-top: 7px;
        }

    }

    &.group section.package {
        display: none;
    }

}

/* order review */
section.order-review {

    display: flex;
    flex-direction: column;
    gap: 20px;

    h1 {
        margin-bottom: 0 !important;
    }

    @media screen and (min-width: 800px) {

        & {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 20px clamp(1.25rem, calc(-3.75rem + 10vw), 2.5rem);
        }

        >section {
            grid-column: 1;
        }

        h1 {
            align-content: center;
        }

        section.order-countdown {
            grid-column: 1 / 3;
        }

        section.order-summary {
            grid-column: 2;
            grid-row: 3 / span 10;
        }

    }

    @media screen and (min-width: 1000px) {

        & {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 20px clamp(1.25rem, calc(-3.75rem + 10vw), 2.5rem);
        }

        >section {
            grid-column: 1;
        }

        h1 {
            align-content: center;
        }

        section.order-countdown {
            grid-column: 2;
        }

        section.order-summary {
            grid-column: 2;
            grid-row: 2 / span 4;
        }

    }

    >section {

        border: 1px solid var(--border-color);
        border-radius: var(--border-radius-small);
        padding: 20px;

        &.error {
            background-color: var(--color-error-bg);

            ol,
            ul,
            p {
                color: var(--color-error);
            }
        }

        h2 {
            font-size: 1.25rem;
            margin-bottom: 20px;
        }

        h2+p {
            margin-top: -15px;
        }

        h3 {
            font-weight: 600;
            font-size: 1rem;
            display: flex;
            gap: 5px;
            align-items: center;
        }

        p {
            font-size: 1rem;
        }

        ol,
        ul {
            list-style: none;
            padding: 0;
        }

        p:last-child,
        ol:last-child,
        ul:last-child {
            margin-bottom: 0;
        }

        form {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            align-items: end;
            gap: 20px;
            flex-wrap: wrap;

            >div.input-wrap.full {
                grid-column: span 2;
            }

            @media screen and (max-width: 430px) {
                & {
                    gap: 10px;
                }
            }

        }

        @media screen and (max-width: 430px) {

            & {
                padding: 15px;
            }

        }
    }
}

/* order countdown */
section.order-countdown {
    border: none !important;
    padding-block: 10px;
    background-color: var(--color-green);
    font-size: 1rem;
    text-align: center;

    @media screen and (max-width: 800px) {
        position: sticky;
        top: 0px;
        font-size: 0.875rem;
        padding-block: 5px;
    }

}

/* order summary */
section.order-summary {

    >br,
    hr {
        display: block;
        width: 100%;
        margin: 20px 0;
    }

    h2.toggle {
        margin-bottom: 0px;

        button {
            text-decoration: none;
            width: 100%;
            display: flex;
            font-size: inherit;
            font-weight: bold;
            align-items: center;

            &::after {
                flex: 0 0 auto;
                margin-left: auto;
                margin-right: 0px;
                content: ' ';
                width: 1.625rem;
                height: 1.625rem;
                background: url(../img/icons/plus_b.svg) no-repeat center;
                border: 1px solid var(--border-color);
                border-radius: 100%;
                display: inline-block;
            }

        }
    }

    h2.toggle:has(+ section.details.expand) {
        margin-bottom: 20px;

        button {
            &::after {
                background-image: url(../img/icons/minus_b.svg);
            }

        }
    }

    h2.toggle+section.details:not(.expand) {
        display: none;
    }

    div.note {
        display: flex;
        align-items: center;
        gap: 3px;
        font-size: 0.75rem;
        font-weight: normal;
        color: var(--color-gray);

        &.alt {
            font-size: 0.75rem;
            color: var(--color-black);
        }

        img.icon {
            width: 14px;
            height: 14px;
        }
    }

    section.item {

        .overview {
            display: grid;
            grid-template-columns: 150px 1fr;
            gap: 10px;
            margin-bottom: 15px;

            .img {
                width: 150px;
                height: 100%;

                img {
                    position: absolute;
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                    border-radius: 10px;
                }
            }

            div:not(.img) {

                h2 {
                    font-size: 0.75rem;
                    font-weight: normal;
                    margin: 0;
                }

                h1 {
                    font-size: 1.125rem;
                    margin-bottom: 10px;
                    padding: 0;
                }

            }

        }

        ul {
            list-style: none;
            padding: 0;
            margin: 0;

            li {
                font-size: 0.875rem;
                margin-bottom: 2px;
                ;
            }
        }

        .price {
            font-size: 0.875rem;
            font-weight: bold;
        }

        .details {
            &:not(.expand) {
                display: none;
            }

            margin-block: 20px;
        }

        button {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 0.75rem;
            text-decoration: none;
            margin-right: 25px;

            >div {
                display: inline-flex;
                align-items: center;
                gap: 5px;
                font-size: 0.75rem;
                text-decoration: none;

                &:first-child {
                    display: none;
                }

                pointer-events: none;
            }

            img.icon {
                pointer-events: none;
                width: 7px;
                height: 7px;
            }

            &:hover {
                text-decoration: underline;
            }
        }

        .details.expand+button div:first-child {
            display: inline-flex;
        }

        .details.expand+button div:last-child {
            display: none;
        }


        @media screen and (max-width: 430px) {
            .overview {
                grid-template-columns: 100px 1fr;

                .img {
                    width: 100px;
                }
            }
        }

    }

    section.details {

        ol {
            display: grid;
            list-style: none;
            padding: 0;
            margin: 0;
            gap: 13px;
            width: 100%;
            grid-template-columns: repeat(2, 1fr);
            font-size: 1rem;
            ;

            li:nth-child(2n) {
                text-align: right;
            }

            li.note {
                font-size: 1rem;
                font-weight: bold;
                color: var(--color-gray);
            }
        }

    }

    section.promocode {
        padding-block: 10px;

        >u {
            font-size: 0.875rem;
            color: var(--color-gray);
        }

        form {
            display: flex;
            margin-top: 10px;
            width: 100%;
            flex-direction: column;
            gap: 10px;
            align-items: start;

            div.input-wrap {
                width: 100%;
                
                input[disabled] {
                    opacity: .5;
                    pointer-events: none;
                    user-select: none;
                }
            }

            button {
                display: flex;
                align-items: center;
                font-size: 0.75rem;
                gap: 5px;

                img.icon {
                    width: 12px;
                    height: 12px;
                }
            }

        }
    }

}

/* order complete */
section.order-complete {
    p {
        margin-bottom: 0px;
    }

    button.btn {
        font-size: 1.125rem !important;
        font-weight: bold;
    }
}