/* Order form ([uzsakymo_forma]). Site palette: teal #008c8e, red #ba1a41 / #d51544, gold #f6c75d, Nunito. */

.kd-order {
    --kd-teal: #008c8e;
    --kd-teal-dark: #006f71;
    --kd-teal-soft: #e6f4f4;
    --kd-red: #d51544;
    --kd-red-dark: #b0103a;
    --kd-gold: #f6c75d;
    --kd-ink: #1f2d3d;
    --kd-muted: #5f6b7a;
    --kd-line: #dfe5ea;
    --kd-error: #c0152f;
    --kd-radius: 16px;

    max-width: 1120px;
    margin: 0 auto;
    color: var(--kd-ink);
    font-family: Nunito, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
}

/* Page title above the form (order page builder column, see scripts/order-page-layout.php) */
.kd-order-title {
    margin: 0 0 8px;
    color: #f6c75d;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.15;
    text-align: center;
}

.kd-order-lead {
    margin: 0 0 32px;
    color: #fff;
    font-size: 18px;
    text-align: center;
}

.kd-order *,
.kd-order *::before,
.kd-order *::after {
    box-sizing: border-box;
}

.kd-order [hidden] {
    display: none !important;
}

.kd-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Layout: form left, sticky summary right */

.kd-order__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: start;
}

/* minmax(0, …): a long locker name must not stretch the column past the screen */
.kd-order__steps {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.kd-order__summary {
    position: sticky;
    top: 90px;
}

/* Cards */

.kd-step,
.kd-summary {
    padding: 28px;
    border-radius: var(--kd-radius);
    background: #fff;
    box-shadow: 0 12px 32px rgba(60, 0, 15, .18);
}

.kd-step__head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.kd-step__num {
    flex: none;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--kd-teal);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
}

.kd-order .kd-step__title {
    margin: 0;
    color: var(--kd-ink);
    font-family: inherit;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
}

.kd-order .kd-step__hint {
    margin: 2px 0 0;
    color: var(--kd-muted);
    font-size: 15px;
}

.kd-order .kd-subtitle {
    margin: 26px 0 4px;
    padding-top: 22px;
    border-top: 1px solid var(--kd-line);
    color: var(--kd-ink);
    font-family: inherit;
    font-size: 18px;
    font-weight: 800;
}

.kd-order .kd-subtitle + .kd-step__hint {
    margin-bottom: 14px;
}

/* Fields */

.kd-order .kd-field {
    margin: 0 0 16px;
    padding: 0;
    border: 0;
    min-width: 0;
}

.kd-order .kd-label {
    display: block;
    margin: 0 0 6px;
    padding: 0;
    color: var(--kd-ink);
    font-size: 15px;
    font-weight: 700;
}

.kd-order .kd-input,
.kd-order .kd-select {
    display: block;
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0 14px;
    border: 1.5px solid var(--kd-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
    color: var(--kd-ink);
    font: inherit;
    font-size: 16px; /* 16px keeps iOS from zooming in on focus */
    transition: border-color .15s, box-shadow .15s;
}

.kd-order .kd-input::placeholder {
    color: #9aa5b1;
}

/* BeTheme gives focused inputs white text (made for the contact form on red) */
.kd-order .kd-input:focus,
.kd-order .kd-select:focus {
    background: #fff;
    color: var(--kd-ink);
    border-color: var(--kd-teal);
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 140, 142, .15);
}

.kd-order [aria-invalid="true"],
.kd-order [aria-invalid="true"] + .select2 .select2-selection {
    border-color: var(--kd-error) !important;
}

.kd-field__error {
    margin: 6px 0 0;
    color: var(--kd-error);
    font-size: 14px;
    font-weight: 700;
}

.kd-field__hint {
    margin: 6px 0 0;
    color: var(--kd-muted);
    font-size: 14px;
}

.kd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.kd-grid--city {
    grid-template-columns: 1fr 160px;
}

/* Number of children */

.kd-pills {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: 10px;
}

.kd-pill {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.kd-pill input,
.kd-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.kd-pill span {
    display: grid;
    place-items: center;
    height: 54px;
    border: 1.5px solid var(--kd-line);
    border-radius: 12px;
    color: var(--kd-ink);
    font-size: 20px;
    font-weight: 800;
    transition: all .15s;
}

.kd-pill:hover span {
    border-color: var(--kd-teal);
}

.kd-pill input:checked + span {
    border-color: var(--kd-teal);
    background: var(--kd-teal);
    color: #fff;
}

.kd-pill input:focus-visible + span,
.kd-option input:focus-visible + .kd-option__body {
    box-shadow: 0 0 0 4px rgba(0, 140, 142, .25);
}

.kd-kid__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

/* Option cards (letter type, delivery) */

.kd-options {
    display: grid;
    gap: 12px;
}

.kd-options--2 {
    grid-template-columns: 1fr 1fr;
}

.kd-option {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.kd-option__body {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px 16px 16px 48px;
    border: 1.5px solid var(--kd-line);
    border-radius: 12px;
    transition: border-color .15s, background-color .15s;
}

.kd-option__body::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 16px;
    width: 20px;
    height: 20px;
    border: 2px solid #b8c2cc;
    border-radius: 50%;
    background: #fff;
    transition: all .15s;
}

.kd-option:hover .kd-option__body {
    border-color: var(--kd-teal);
}

.kd-option input:checked + .kd-option__body {
    border-color: var(--kd-teal);
    background: var(--kd-teal-soft);
}

.kd-option input:checked + .kd-option__body::before {
    border-color: var(--kd-teal);
    box-shadow: inset 0 0 0 4px #fff;
    background: var(--kd-teal);
}

.kd-option__title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.3;
}

.kd-option__text {
    margin-top: 2px;
    color: var(--kd-muted);
    font-size: 14px;
    line-height: 1.4;
}

.kd-option__price {
    margin-top: auto;
    padding-top: 8px;
    color: var(--kd-teal-dark);
    font-size: 16px;
    font-weight: 800;
}

/* Checkboxes */

.kd-order .kd-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0 0 16px;
    color: var(--kd-ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
}

.kd-order .kd-check input {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    accent-color: var(--kd-teal);
}

.kd-order .kd-check a {
    color: var(--kd-red);
    text-decoration: underline;
}

.kd-order .kd-check--inline {
    margin: 0 0 6px;
    font-size: 14px;
    white-space: nowrap;
}

.kd-order .kd-check--inline input {
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.kd-check small {
    color: var(--kd-muted);
    font-size: 13px;
    font-weight: 600;
}

/* Summary */

.kd-envelope {
    margin: 0 0 20px;
}

.kd-envelope__paper {
    position: relative;
    aspect-ratio: 229 / 162;
    border-radius: 8px;
    background: #fff center / cover no-repeat;
    box-shadow: 0 6px 18px rgba(31, 45, 61, .18);
    transform: rotate(-1.5deg);
    container-type: inline-size; /* the address text scales with the envelope (cqw) */
}

/* Same place and font as the printed envelope (kd-letters-2: x 125mm, y 75mm of 229 x 162mm) */
.kd-envelope__address {
    position: absolute;
    top: 45.5%;
    left: 54.6%;
    right: 4%;
    display: flex;
    flex-direction: column;
    font-family: Grandstander, Nunito, sans-serif;
    font-size: clamp(9px, 3.6cqw, 14px);
    font-weight: 600;
    line-height: 1.55;
    color: #1d1d1b;
}

/* Long names wrap here; the PDF prints them on one line, shifted left (see order-form.js) */
.kd-envelope__address span {
    overflow-wrap: anywhere;
}

.kd-envelope__address[data-long="1"] {
    left: 52.4%;
}

.kd-envelope__address[data-long="2"] {
    left: 50.2%;
}

.kd-envelope__address .is-placeholder {
    color: #a3adb7;
}

.kd-envelope__caption {
    margin-top: 12px;
    color: var(--kd-muted);
    font-size: 14px;
    text-align: center;
}

.kd-order .kd-summary__lines {
    margin: 0 0 16px;
    padding: 0;
}

.kd-summary__lines > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--kd-line);
    font-size: 15px;
}

.kd-order .kd-summary__lines dt {
    margin: 0;
    color: var(--kd-ink);
    font-weight: 600;
}

.kd-order .kd-summary__lines dd {
    margin: 0;
    color: var(--kd-muted);
    font-weight: 700;
    white-space: nowrap;
}

.kd-summary__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
    font-size: 17px;
    font-weight: 700;
}

.kd-summary__total strong {
    color: var(--kd-ink);
    font-size: 28px;
    font-weight: 800;
}

.kd-order .kd-pay {
    display: block;
    width: 100%;
    margin: 0;
    padding: 16px 20px;
    border: 0;
    border-radius: 999px;
    background: var(--kd-red);
    box-shadow: 0 8px 20px rgba(213, 21, 68, .35);
    color: #fff;
    font: inherit;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, transform .15s;
}

.kd-order .kd-pay:hover,
.kd-order .kd-pay:focus-visible {
    background: var(--kd-red-dark);
    color: #fff;
}

.kd-order .kd-pay:active {
    transform: translateY(1px);
}

.kd-order .kd-pay[disabled] {
    opacity: .7;
    cursor: wait;
}

.kd-summary__note {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin: 14px 0 0;
    color: var(--kd-muted);
    font-size: 13px;
    text-align: center;
}

.kd-alert__debug {
    display: block;
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #fff;
    color: #8a1024;
    font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.kd-alert {
    margin-bottom: 20px;
    padding: 16px 20px;
    border-radius: 12px;
    background: #fff4f5;
    border-left: 5px solid var(--kd-error);
    color: var(--kd-ink);
}

/* Repeat-payment page */

.kd-order--narrow {
    max-width: 480px;
}

.kd-repeat .kd-step__title {
    margin-bottom: 6px;
}

.kd-repeat .kd-summary__lines,
.kd-repeat .kd-pay {
    margin-top: 18px;
}

/* select2 (parcel locker and country search) */

.kd-order .select2-container {
    width: 100% !important;
}

.kd-order .select2-container .select2-selection--single {
    height: 50px;
    border: 1.5px solid var(--kd-line);
    border-radius: 10px;
}

.kd-order .select2-container .select2-selection--single .select2-selection__rendered {
    padding: 0 40px 0 14px;
    color: var(--kd-ink);
    line-height: 47px;
}

.kd-order .select2-container .select2-selection__placeholder {
    color: #9aa5b1;
}

.kd-order .select2-container .select2-selection--single .select2-selection__arrow {
    top: 11px;
    right: 10px;
}

/* BeTheme styles select2 for dark sections (white text, red borders): override with higher specificity */
.kd-order .select2-container--default.select2-container--open .select2-selection--single,
.kd-order .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--kd-teal);
    background: #fff;
}

.select2-dropdown.kd-select2 {
    border: 1.5px solid var(--kd-teal);
    border-radius: 10px;
    overflow: hidden;
    font-family: Nunito, sans-serif;
}

.select2-container--default .select2-dropdown.kd-select2 .select2-search--dropdown .select2-search__field,
.select2-container--default .select2-dropdown.kd-select2 .select2-search--dropdown .select2-search__field:focus {
    border: 1.5px solid #dfe5ea;
    background: #fff;
    color: #1f2d3d;
    height: 42px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 16px;
}

.select2-container--default .select2-dropdown.kd-select2 .select2-results__option {
    padding: 10px 12px;
    color: #1f2d3d;
    font-size: 15px;
    line-height: 1.35;
}

.select2-container--default .select2-dropdown.kd-select2 .select2-results__option--highlighted {
    background: #008c8e;
    color: #fff;
}

.select2-dropdown.kd-select2 {
    box-shadow: 0 12px 28px rgba(31, 45, 61, .2);
}

/* Mobile pay bar: only on narrow screens, hidden while the summary is on screen */

.kd-paybar {
    display: none;
}

@media (max-width: 900px) {
    .kd-order {
        padding: 0 12px;
    }

    .kd-order__layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .kd-order__summary {
        position: static;
    }

    .kd-envelope__paper {
        max-width: 420px;
        margin: 0 auto;
    }

    .kd-paybar {
        position: fixed;
        z-index: 9000;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        gap: 14px;
        align-items: center;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: #fff;
        box-shadow: 0 -6px 20px rgba(31, 45, 61, .15);
        transition: transform .2s;
    }

    .kd-paybar.is-hidden {
        transform: translateY(110%);
    }

    .kd-paybar__total {
        display: flex;
        flex-direction: column;
        line-height: 1.2;
    }

    .kd-paybar__total span {
        color: var(--kd-muted);
        font-size: 13px;
    }

    .kd-paybar__total strong {
        font-size: 22px;
        font-weight: 800;
    }

    .kd-order .kd-pay--bar {
        flex: 1;
        padding: 14px 16px;
        font-size: 17px;
        box-shadow: none;
    }

    /* Room for the bar under the page, and keep reCAPTCHA's badge above it */
    body.kd-has-paybar {
        padding-bottom: 80px;
    }

    body.kd-has-paybar .grecaptcha-badge {
        bottom: 90px !important;
    }

    body.kd-has-paybar #back_to_top {
        bottom: 96px !important;
    }
}

@media (max-width: 600px) {

    .kd-step,
    .kd-summary {
        padding: 22px 18px;
        border-radius: 14px;
    }

    .kd-order .kd-step__title {
        font-size: 21px;
    }

    .kd-grid,
    .kd-grid--city,
    .kd-options--2 {
        grid-template-columns: 1fr;
    }

    .kd-kid__head {
        flex-direction: column;
        gap: 0;
    }

    .kd-order .kd-check--inline {
        order: 2;
        margin: 8px 0 0;
    }

    .kd-kid {
        display: flex;
        flex-direction: column;
    }

    .kd-kid__head {
        display: contents;
    }

    .kd-kid .kd-label {
        order: 0;
    }

    .kd-kid .kd-input {
        order: 1;
    }

    .kd-kid .kd-field__error {
        order: 3;
    }
}

.select2-container--default .select2-dropdown.kd-select2 .select2-results__options {
    margin: 0;
    padding: 0;
}

/* ---------- toy set "Meduolinė pasaka": add-on card in the letter form, main card in the set form ---------- */

.kd-addon {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1.5px dashed var(--kd-gold);
    border-radius: 12px;
    background: #fffaf0;
}

.kd-addon--main {
    border-style: solid;
    border-color: var(--kd-line);
    background: #fff;
}

.kd-addon__body {
    display: flex;
    flex: 1;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.kd-addon__body > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.kd-addon__icon {
    flex: none;
    font-size: 34px;
    line-height: 1;
}

.kd-addon__image {
    flex: none;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
}

.kd-addon__title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.3;
}

.kd-addon__text {
    margin-top: 2px;
    color: var(--kd-muted);
    font-size: 14px;
    line-height: 1.4;
}

.kd-addon__text a {
    color: var(--kd-teal-dark);
    text-decoration: underline;
}

.kd-addon__price {
    margin-top: 6px;
    color: var(--kd-teal-dark);
    font-size: 15px;
    font-weight: 800;
}

.kd-addon .kd-field__error {
    flex-basis: 100%;
}

.kd-qty {
    display: inline-flex;
    flex: none;
    align-items: center;
    border: 1.5px solid var(--kd-line);
    border-radius: 999px;
    background: #fff;
}

.kd-qty__btn {
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--kd-teal-dark);
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.kd-qty__btn:hover {
    background: var(--kd-teal-soft);
}

.kd-qty__btn:focus-visible {
    outline: 3px solid var(--kd-gold);
    outline-offset: 1px;
}

.kd-order .kd-qty__input {
    width: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--kd-ink);
    font-size: 18px;
    font-weight: 800;
    text-align: center;
    box-shadow: none;
    -moz-appearance: textfield;
}

.kd-qty__input::-webkit-outer-spin-button,
.kd-qty__input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.kd-product {
    margin: 0 0 16px;
}

.kd-product img {
    display: block;
    width: 100%;
    border-radius: 12px;
}

@media (max-width: 600px) {
    /* Text on its own row, the stepper under it on the right */
    .kd-addon {
        flex-wrap: wrap;
    }

    .kd-addon__body {
        flex-basis: 100%;
    }

    .kd-addon .kd-qty {
        margin-left: auto;
    }
}

/* ---------- the set's own page (scripts/sets-page.php): red patterned bands like the letter page ---------- */

body:has(.kd-sets-page) {
    overflow-x: hidden;
}

.kd-sets-page {
    --kd-sets-red: #ba1a41;
    color: #1f2d3d;
    font-size: 17px;
    line-height: 1.6;
}

.kd-sets-band {
    position: relative;
    isolation: isolate;
    padding: 56px 0 64px;
}

/* Full-width background behind a content-width band */
.kd-sets-band::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: calc(50% - 50vw);
    right: calc(50% - 50vw);
    background: var(--kd-sets-red) url("/wp-content/uploads/2019/11/christmas-sectionbg1-1.png") center top;
}

/* The theme's content wrapper has 30px top padding: the hero starts right under the header */
.kd-sets-hero {
    margin-top: -30px;
    text-align: center;
}

.kd-sets-hero .kd-order-lead strong {
    color: #f6c75d;
}

.kd-sets-button {
    display: inline-block;
    padding: 14px 34px;
    border-radius: 999px;
    background: #f6c75d;
    color: #1f2d3d !important;
    font-weight: 800;
    font-size: 17px;
    text-decoration: none !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    transition: transform .15s;
}

.kd-sets-button:hover {
    transform: translateY(-1px);
}

.kd-sets-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    max-width: 960px;
    margin: 36px auto 0;
}

/* One photo: not stretched over the whole width (it is a tall picture) */
.kd-sets-gallery:has(> img:only-child) {
    grid-template-columns: 1fr;
    max-width: 440px;
}

.kd-sets-gallery img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

.kd-sets-text {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 0;
}

.kd-sets-page .kd-sets-text h2 {
    margin: 32px 0 12px;
    color: #008c8e;
    font-size: 28px;
    line-height: 1.25;
}

.kd-sets-page .kd-sets-text p {
    margin: 0 0 14px;
    color: #1f2d3d;
}

.kd-sets-text a {
    color: #ba1a41;
    font-weight: 700;
}

.kd-sets-page .kd-sets-list {
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.kd-sets-page .kd-sets-list li {
    position: relative;
    margin: 0 0 10px;
    padding-left: 30px;
    color: #1f2d3d;
}

.kd-sets-list li::before {
    content: "★";
    position: absolute;
    left: 0;
    top: 0;
    color: #f6c75d;
    font-size: 18px;
}

.kd-sets-text--small {
    font-size: 15px;
}

.kd-sets-page .kd-sets-text--small h2 {
    font-size: 22px;
}

.kd-muted-note {
    color: #5f6b7a !important;
    font-style: italic;
}

.kd-sets-order {
    scroll-margin-top: 80px;
}

@media (max-width: 600px) {
    .kd-sets-band {
        padding: 36px 0 44px;
    }

    /* The theme's content column is inset 36px on phones: let the form cards use more of the width */
    .kd-sets-order .kd-order {
        margin: 0 -24px;
    }

    .kd-sets-text {
        padding: 32px 0;
    }
}
