/*
SHARNIR-STUB — реестр sharnir-shop-checkout.md.
RU / DELIVERY: текущая форма для русского тестового магазина и самовывоза.
Цены, остатки и ID ресурсов в CSS не храним.
Базовые цвета и кнопки — sharnir.css; секции — shop.css.
*/
.shop-checkout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 370px);
    align-items: start;
    gap: clamp(28px, 4vw, 64px);
}
.shop-checkout__fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.shop-checkout__legend { margin-bottom: 18px; padding: 0; font-size: clamp(24px, 2.5vw, 32px); font-weight: 600; }
.shop-checkout__intro { max-width: 650px; margin: 0 0 30px; color: var(--color-muted, #68716d); line-height: 1.7; }
.shop-checkout__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.shop-field { min-width: 0; margin-bottom: 24px; }
.shop-field label { display: block; margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.shop-field input, .shop-field select, .shop-field textarea {
    box-sizing: border-box; width: 100%; min-height: 50px;
    padding: 13px 15px; border: 1px solid #c9d0cb; border-radius: 0;
    background: #fff; color: var(--color-text, #282d2b); font: inherit;
}
.shop-field textarea { resize: vertical; min-height: 130px; }
.shop-field input:focus, .shop-field select:focus, .shop-field textarea:focus {
    outline: 2px solid var(--color-green, #164b3b); outline-offset: 2px;
}
.shop-field [aria-invalid="true"] { border-color: #a92525; }
.shop-field__help, .shop-field__error { margin: 8px 0 0; font-size: 13px; line-height: 1.6; }
.shop-field__help { color: var(--color-muted, #68716d); }
.shop-field__error { color: #a92525; }
.shop-field__error:empty { display: none; }
.shop-checkout__fields:disabled { opacity: .7; }
.shop-checkout__summary { padding: clamp(24px, 3vw, 36px); background: var(--color-green, #164b3b); color: #fff; }
.shop-checkout__summary .section-eyebrow { color: #fff; opacity: .75; }
.shop-checkout__summary h3 { margin: 14px 0 26px; font-size: clamp(24px, 2.5vw, 32px); line-height: 1.2; }
.shop-checkout__totals, .shop-order-result__totals { margin: 0; }
.shop-checkout__totals > div, .shop-order-result__totals > div { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; }
.shop-checkout__totals dd, .shop-order-result__totals dd { margin: 0; text-align: right; font-weight: 600; white-space: nowrap; }
.shop-checkout__total { margin-top: 12px; padding-top: 22px !important; border-top: 1px solid rgb(255 255 255 / .25); font-size: 20px; }
.shop-checkout__back { display: inline-block; margin: 20px 0 4px; color: #fff; text-underline-offset: 4px; text-decoration: underline; }
.shop-checkout__note { margin: 18px 0 24px; font-size: 14px; line-height: 1.65; color: rgb(255 255 255 / .8); }
.shop-checkout__summary .button { width: 100%; text-align: center; justify-content: center; }
.shop-checkout__summary .button:disabled { cursor: wait; opacity: .6; }
.shop-checkout__message { margin: 18px 0 0; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.shop-checkout__message:empty { display: none; }
.shop-checkout__message.is-error { padding-top: 15px; border-top: 2px solid #ffc49c; color: #fff; }
.shop-checkout__message:focus { outline: 2px solid #ffc49c; outline-offset: 6px; }
.shop-order-result { max-width: 900px; }
.shop-order-result__intro { max-width: 640px; margin-bottom: 32px; }
.shop-order-result__intro h3 { margin: 0 0 14px; font-size: 28px; }
.shop-order-result__intro p { margin: 0; color: var(--color-muted, #68716d); line-height: 1.7; }
.shop-order-result__items { list-style: none; margin: 0 0 24px; padding: 0; border-top: 1px solid #c9d0cb; }
.shop-order-result__items li { display: flex; justify-content: space-between; gap: 24px; padding: 24px 0; border-bottom: 1px solid #c9d0cb; }
.shop-order-result__items strong { font-size: 18px; overflow-wrap: anywhere; }
.shop-order-result__items p { margin: 8px 0 0; color: var(--color-muted, #68716d); }
.shop-order-result__items > li > span { white-space: nowrap; font-weight: 600; }
.shop-order-result__totals { max-width: 440px; margin-left: auto; margin-bottom: 32px; }
.shop-order-result__totals > div:last-child { margin-top: 10px; border-top: 1px solid #c9d0cb; font-size: 22px; }
@media (max-width: 980px) { .shop-checkout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
    .shop-checkout__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .shop-order-result__items li { flex-direction: column; gap: 12px; }
    .shop-checkout__total, .shop-order-result__totals > div:last-child { font-size: 18px; }
}

#shop-delivery,
#shop-payment {
    --shop-select-green: var(--color-green, #164b3b);
    --shop-select-orange: var(--color-orange, #f96900);
    --shop-select-border: #b9cac0;

    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 60px;
    padding: 16px 54px 16px 18px;
    border: 1px solid var(--shop-select-border);
    border-left: 3px solid var(--shop-select-green);
    border-radius: 0;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='m2 2 6 6 6-6' fill='none' stroke='%23164b3b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 16px 10px;
    color: var(--shop-select-green);
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.45;
    cursor: pointer;
    outline: 2px solid transparent;
    outline-offset: 3px;
    transition: border-color .2s ease, background-color .2s ease,
                box-shadow .2s ease, outline-color .2s ease;
}

@media (hover: hover) {
    #shop-delivery:hover:not(:disabled),
    #shop-payment:hover:not(:disabled) {
        border-color: var(--shop-select-green);
        background-color: #f6f9f6;
    }
}

#shop-delivery:focus,
#shop-payment:focus {
    border-color: var(--shop-select-green);
    outline-color: var(--shop-select-orange);
    box-shadow: 0 5px 18px rgb(22 75 59 / .08);
}

#shop-delivery[aria-invalid="true"],
#shop-payment[aria-invalid="true"] {
    border-color: var(--shop-select-orange);
    background-color: #fff7f1;
}

#shop-delivery:disabled,
#shop-payment:disabled {
    cursor: not-allowed;
    box-shadow: none;
}

/* Оформление раскрытого меню. */
@supports (appearance: base-select) and selector(::picker(select)) {
    #shop-delivery,
    #shop-payment {
        appearance: base-select;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    #shop-delivery::picker-icon,
    #shop-payment::picker-icon {
        display: none;
    }

    #shop-delivery:open,
    #shop-payment:open {
        border-color: var(--shop-select-green);
        background-color: #f6f9f6;
    }

    #shop-delivery::picker(select),
    #shop-payment::picker(select) {
        appearance: base-select;
        box-sizing: border-box;
        min-inline-size: anchor-size(width);
        max-inline-size: calc(100vw - 32px);
        max-block-size: min(320px, 60vh);
        margin-block-start: 8px;
        padding: 6px;
        overflow-y: auto;
        border: 1px solid var(--shop-select-border);
        border-top: 3px solid var(--shop-select-orange);
        border-radius: 0;
        background: #fff;
        color: var(--shop-select-green);
        box-shadow: 0 16px 40px rgb(22 75 59 / .16);
        font: inherit;
    }

    #shop-delivery option,
    #shop-payment option {
        display: flex;
        align-items: center;
        gap: 14px;
        min-block-size: 48px;
        padding: 12px 16px;
        border: 0;
        border-radius: 0;
        background: #fff;
        color: var(--shop-select-green);
        white-space: normal;
        overflow-wrap: anywhere;
        cursor: pointer;
    }

    #shop-delivery option:hover:not(:disabled):not(:checked),
    #shop-payment option:hover:not(:disabled):not(:checked) {
        background: #edf3ee;
    }

    #shop-delivery option:checked,
    #shop-payment option:checked {
        background: var(--shop-select-green);
        color: #fff;
        box-shadow: inset 3px 0 var(--shop-select-orange);
    }

    #shop-delivery option:focus-visible,
    #shop-payment option:focus-visible {
        outline: 2px solid var(--shop-select-orange);
        outline-offset: -2px;
    }

    #shop-delivery option::checkmark,
    #shop-payment option::checkmark {
        order: 1;
        margin-inline-start: auto;
        color: var(--shop-select-orange);
    }

    #shop-delivery option:disabled,
    #shop-payment option:disabled {
        opacity: .5;
        cursor: not-allowed;
    }
}

@media (prefers-reduced-motion: reduce) {
    #shop-delivery,
    #shop-payment {
        transition: none;
    }
}

@media (forced-colors: active) {
    #shop-delivery,
    #shop-payment {
        -webkit-appearance: auto;
        appearance: auto;
        background-image: none;
        border-color: ButtonText;
        color: ButtonText;
        box-shadow: none;
    }

    #shop-delivery:focus,
    #shop-payment:focus {
        outline-color: Highlight;
    }

    #shop-delivery::picker(select),
    #shop-payment::picker(select) {
        appearance: auto;
    }

    #shop-delivery::picker-icon,
    #shop-payment::picker-icon {
        display: revert;
    }
}
