/* Ühe lehe tellimine (/telli/) */
.jk-co-page .entry-header,
.jk-co-page .storefront-breadcrumb {
    display: none;
}

.jk-co-page .hentry {
    margin-bottom: 0;
}

/* Teema overflow-x: hidden teeb #page'ist kerimiskonteineri ja kokkuvõte ei püsiks ekraanil (sticky). */
body.jk-co-page,
.jk-co-page #page {
    overflow-x: clip;
    overflow-y: visible;
}

.jk-co {
    --jk-green: #2eb44a;
    --jk-green-dark: #23913a;
    --jk-green-soft: #eaf7ed;
    --jk-ink: #1d2320;
    --jk-muted: #66706a;
    --jk-line: #dfe5e1;
    --jk-bg: #f6f8f6;
    --jk-red: #c0392b;
    --jk-radius: 14px;

    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 32px;
    align-items: start;
    color: var(--jk-ink);
    padding-bottom: 40px;
}

.jk-co__head {
    margin-bottom: 8px;
}

.jk-co .jk-co__title {
    font-size: 2.2em;
    line-height: 1.1;
    margin: 0 0 6px;
    letter-spacing: -.02em;
}

.jk-co__lead {
    color: var(--jk-muted);
    margin: 0;
}

.jk-co__lead a,
.jk-co a {
    color: var(--jk-green-dark);
}

/* Sektsioonid */
.jk-co__section {
    background: #fff;
    border: 1px solid var(--jk-line);
    border-radius: 18px;
    padding: 22px 24px;
    margin-top: 18px;
    scroll-margin-top: 20px;
    transition: border-color .2s;
}

.jk-co__section.is-invalid {
    border-color: var(--jk-red);
}

.jk-co .jk-co__h {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2em;
    font-weight: 700;
    margin: 0 0 16px;
}

.jk-co .jk-co__h--plain {
    margin-bottom: 12px;
}

.jk-co .jk-co__sub {
    font-size: 1em;
    margin: 20px 0 10px;
}

.jk-co__error {
    margin: 12px 0 0;
    color: var(--jk-red);
    font-weight: 600;
    font-size: .9em;
}

/* Vahelehed kuusk / nulg */
.jk-co__tabs {
    display: inline-flex;
    padding: 4px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: var(--jk-bg);
}

.jk-co .jk-co__tab {
    padding: 6px 18px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--jk-muted);
    font-weight: 600;
    cursor: pointer;
}

.jk-co .jk-co__tab.is-active {
    background: #fff;
    color: var(--jk-ink);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}

/* Väljad */
.jk-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
}

.jk-field {
    position: relative;
    margin-bottom: 12px;
}

.jk-fields .jk-field {
    margin-bottom: 0;
}

.jk-co .jk-field label {
    display: block;
    font-weight: 600;
    font-size: .9em;
    margin-bottom: 4px;
}

.jk-co .jk-field input,
.jk-co .jk-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--jk-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
    font-size: 1em;
    transition: border-color .15s, box-shadow .15s;
}

.jk-co .jk-field input:focus,
.jk-co .jk-field textarea:focus {
    border-color: var(--jk-green);
    box-shadow: 0 0 0 3px rgba(46, 180, 74, .15);
    outline: none;
}

.jk-field small {
    display: block;
    margin-top: 4px;
    color: var(--jk-muted);
}

.jk-optional {
    font-weight: 400;
    color: var(--jk-muted);
}

.jk-co .jk-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 10px;
    cursor: pointer;
}

.jk-co .jk-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--jk-green);
}

.jk-co .jk-ads {
    top: 100%;
}

/* Aadressi tulemus */
.jk-quote {
    margin-top: 4px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--jk-bg);
    color: var(--jk-muted);
    font-size: .9em;
    line-height: 1.45;
}

.jk-quote--ok {
    background: var(--jk-green-soft);
    color: var(--jk-ink);
}

.jk-quote--error {
    background: #fff6e5;
    color: #7a5200;
}

.jk-quote__spin {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    vertical-align: -1px;
    border: 2px solid #b9d9c1;
    border-top-color: var(--jk-green);
    border-radius: 50%;
    animation: jk-spin .7s linear infinite;
}

.jk-co__manual {
    margin-top: 14px;
}

.jk-co__manual p {
    font-weight: 600;
    margin: 0 0 8px;
}

/* Kalender ja ajad */
.jk-cal {
    max-width: 380px;
}

.jk-cal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    text-transform: capitalize;
}

.jk-co .jk-cal__nav {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--jk-line);
    border-radius: 50%;
    background: #fff;
    color: var(--jk-ink);
    font-size: 1.2em;
    line-height: 1;
    cursor: pointer;
}

.jk-co .jk-cal__nav:disabled {
    opacity: .35;
    cursor: default;
}

.jk-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.jk-cal__dow {
    text-align: center;
    font-size: .75em;
    font-weight: 600;
    color: var(--jk-muted);
    padding: 4px 0;
}

.jk-co .jk-cal__day {
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: var(--jk-bg);
    color: var(--jk-ink);
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s;
}

.jk-co .jk-cal__day:hover:not(:disabled) {
    background: var(--jk-green-soft);
}

.jk-co .jk-cal__day:disabled {
    background: transparent;
    color: #c3cac5;
    cursor: default;
}

.jk-co .jk-cal__day.is-today {
    box-shadow: inset 0 0 0 1px var(--jk-green);
}

.jk-co .jk-cal__day.is-selected {
    background: var(--jk-green);
    color: #fff;
}

.jk-slots {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.jk-slots__empty {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--jk-muted);
    font-size: .9em;
}

.jk-co .jk-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 6px;
    border: 2px solid var(--jk-line);
    border-radius: 12px;
    background: #fff;
    color: var(--jk-ink);
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}

.jk-slot span {
    font-size: .75em;
    color: var(--jk-muted);
}

.jk-co .jk-slot:hover:not(:disabled) {
    border-color: #b9d9c1;
}

.jk-co .jk-slot.is-selected {
    border-color: var(--jk-green);
    background: var(--jk-green-soft);
}

.jk-co .jk-slot:disabled {
    opacity: .45;
    cursor: default;
}

/* Makseviisid */
.jk-pays {
    display: grid;
    gap: 8px;
}

.jk-pay {
    border: 1px solid var(--jk-line);
    border-radius: var(--jk-radius);
    transition: border-color .15s, background-color .15s;
}

.jk-pay.is-active {
    border-color: var(--jk-green);
    background: #fbfdfb;
}

.jk-co .jk-pay__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 14px 16px;
    cursor: pointer;
}

.jk-pay__head input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.jk-pay__radio {
    flex: none;
    width: 20px;
    height: 20px;
    border: 2px solid #b8c1bb;
    border-radius: 50%;
    transition: border-color .15s, box-shadow .15s;
}

.jk-pay.is-active .jk-pay__radio {
    border-color: var(--jk-green);
    box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 10px var(--jk-green);
}

.jk-pay__head input:focus-visible ~ .jk-pay__radio {
    outline: 3px solid rgba(46, 180, 74, .45);
    outline-offset: 2px;
}

.jk-pay__title {
    flex: 1;
    font-weight: 600;
}

.jk-pay__icon img {
    max-height: 22px;
    width: auto;
    display: inline-block;
    margin: 0 0 0 4px;
}

.jk-pay__box {
    padding: 0 16px 14px 48px;
    font-size: .9em;
    color: var(--jk-muted);
}

.jk-pay__box p:last-child {
    margin-bottom: 0;
}

/* Kokkuvõte */
.jk-co__side {
    position: sticky;
    top: 20px;
    margin-top: 76px;
}

.jk-co__summary {
    background: #fff;
    border: 1px solid var(--jk-line);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 14px 34px -22px rgba(20, 60, 30, .45);
}

.jk-co .jk-co__lines {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.jk-co__lines li {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--jk-line);
    font-size: .92em;
}

.jk-co__lines li span:last-child {
    white-space: nowrap;
    font-weight: 600;
}

.jk-co__lines li.is-muted {
    color: var(--jk-muted);
}

.jk-co__lines li.is-muted span:last-child {
    font-weight: 400;
}

.jk-co__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-weight: 600;
}

.jk-co__total strong {
    font-size: 1.8em;
}

.jk-co__when {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--jk-green-soft);
    font-size: .9em;
    font-weight: 600;
}

.jk-co .jk-check--terms {
    font-size: .9em;
    margin-top: 16px;
}

.jk-co__messages {
    margin-top: 12px;
}

.jk-co__messages .woocommerce-error {
    margin: 0;
    border-radius: 10px;
    font-size: .9em;
}

.jk-co .jk-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 14px;
    padding: 16px 20px;
    border: 0;
    border-radius: 12px;
    background: var(--jk-green);
    color: #fff;
    font-size: 1.05em;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    box-shadow: 0 8px 20px -10px rgba(46, 180, 74, .9);
    transition: background-color .2s, transform .1s;
}

.jk-co .jk-submit:hover {
    background: var(--jk-green-dark);
}

.jk-co .jk-submit:active {
    transform: translateY(1px);
}

.jk-co .jk-submit:disabled {
    cursor: wait;
    opacity: .8;
}

.jk-co.is-busy .jk-spinner {
    display: inline-block;
}

.jk-co__gift {
    margin: 14px 0 0;
    font-size: .8em;
    color: var(--jk-muted);
    text-align: center;
}

/* Mobiili alumine riba */
.jk-co__bar {
    display: none;
}

@media (max-width: 900px) {
    .jk-co {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding-bottom: 90px;
    }

    .jk-co__side {
        position: static;
        margin-top: 18px;
    }

    .jk-co__bar {
        position: fixed;
        z-index: 100;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: #fff;
        border-top: 1px solid var(--jk-line);
        box-shadow: 0 -8px 24px -16px rgba(0, 0, 0, .3);
    }

    .jk-co__bar > div span {
        display: block;
        font-size: .75em;
        color: var(--jk-muted);
    }

    .jk-co__bar > div strong {
        font-size: 1.3em;
    }

    .jk-co .jk-co__bar .jk-submit {
        width: auto;
        margin: 0;
        padding: 12px 24px;
    }
}

@media (max-width: 600px) {
    .jk-co .jk-co__title {
        font-size: 1.7em;
    }

    .jk-co__section {
        padding: 18px 16px;
        border-radius: 16px;
    }

    .jk-fields {
        grid-template-columns: 1fr;
    }

    .jk-slots {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .jk-cal {
        max-width: none;
    }

    .jk-pay__box {
        padding-left: 16px;
    }
}

/* Valikukaartide põhireeglid (order-form.css kehtivad .jk-order sees) */
.jk-co .jk-tile {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.jk-co .jk-extra {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 12px 16px;
    border: 1px solid var(--jk-line);
    border-radius: var(--jk-radius);
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}

.jk-co .jk-tile__sub {
    display: block;
}
