/* Jõulukuused tellimisvorm */
.jk-order {
    --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;

    color: var(--jk-ink);
    background: #fff;
    border: 1px solid var(--jk-line);
    border-radius: 20px;
    box-shadow: 0 10px 30px -18px rgba(20, 60, 30, .35);
    padding: 28px;
    margin: 0 0 40px;
    scroll-margin-top: 20px;
}

.jk-order__head {
    margin-bottom: 22px;
}

.jk-order .jk-order__title {
    font-size: 1.6em;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 6px;
    letter-spacing: -.01em;
}

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

/* Sammud */
.jk-order .jk-step {
    border: 0;
    background: none;
    margin: 0 0 24px;
    padding: 0;
    min-width: 0;
}

.jk-order .jk-step__label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05em;
    padding: 0;
    margin: 0 0 12px;
    background: none;
}

.jk-step__num {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--jk-green-soft);
    color: var(--jk-green-dark);
    font-size: .8em;
    flex: none;
}

.jk-step__hint {
    font-size: .875em;
    color: var(--jk-muted);
    margin: 10px 0 0;
}

.jk-step.is-invalid .jk-tile__body {
    border-color: var(--jk-red);
    animation: jk-shake .35s;
}

/* Valikukaardid */
.jk-grid {
    display: grid;
    gap: 10px;
}

.jk-grid--sizes {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.jk-grid--two {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.jk-order .jk-tile {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.jk-tile input,
.jk-extra input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.jk-tile__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: 100%;
    padding: 14px 16px;
    border: 2px solid var(--jk-line);
    border-radius: var(--jk-radius);
    background: #fff;
    transition: border-color .15s, background-color .15s, box-shadow .15s, transform .15s;
}

.jk-tile:hover .jk-tile__body {
    border-color: #b9d9c1;
}

.jk-tile input:checked + .jk-tile__body {
    border-color: var(--jk-green);
    background: var(--jk-green-soft);
    box-shadow: 0 0 0 3px rgba(46, 180, 74, .15);
}

.jk-tile input:checked + .jk-tile__body::after {
    content: "";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--jk-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.jk-tile input:focus-visible + .jk-tile__body,
.jk-extra input:focus-visible ~ .jk-switch {
    outline: 3px solid rgba(46, 180, 74, .45);
    outline-offset: 2px;
}

.jk-tile__title {
    font-weight: 700;
    font-size: 1.05em;
    padding-right: 20px;
    white-space: nowrap;
}

.jk-tile__price {
    color: var(--jk-green-dark);
    font-weight: 600;
}

.jk-tile__sub {
    font-size: .8em;
    color: var(--jk-muted);
    line-height: 1.35;
    margin-top: 4px;
}

/* Lisateenused */
.jk-extras {
    display: grid;
    gap: 8px;
}

.jk-order .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-extra:hover {
    border-color: #b9d9c1;
}

.jk-extra:has(input:checked) {
    border-color: var(--jk-green);
    background: var(--jk-green-soft);
}

.jk-switch {
    position: relative;
    flex: none;
    width: 38px;
    height: 22px;
    border-radius: 11px;
    background: #cfd6d1;
    transition: background-color .2s;
}

.jk-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
    transition: transform .2s;
}

.jk-extra input:checked ~ .jk-switch {
    background: var(--jk-green);
}

.jk-extra input:checked ~ .jk-switch::after {
    transform: translateX(16px);
}

.jk-extra__title {
    flex: 1;
    line-height: 1.3;
}

.jk-extra__price {
    font-weight: 600;
    color: var(--jk-green-dark);
    white-space: nowrap;
}

/* Kokkuvõte */
.jk-summary {
    background: var(--jk-bg);
    border-radius: var(--jk-radius);
    padding: 18px 20px 20px;
}

.jk-order .jk-summary__lines {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    font-size: .9em;
    color: var(--jk-muted);
}

.jk-summary__lines li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 3px 0;
    animation: jk-fade .2s ease-out;
}

.jk-summary__lines li span:last-child {
    white-space: nowrap;
}

.jk-summary__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-top: 1px solid var(--jk-line);
    padding-top: 10px;
    font-weight: 600;
}

.jk-summary__amount {
    font-size: 1.6em;
    color: var(--jk-ink);
}

.jk-summary__note {
    font-size: .8em;
    color: var(--jk-muted);
    margin: 2px 0 0;
    text-align: right;
}

.jk-error {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fdecea;
    color: var(--jk-red);
    font-size: .9em;
    font-weight: 600;
}

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

.jk-order.is-ready .jk-submit {
    background: var(--jk-green);
    box-shadow: 0 8px 20px -10px rgba(46, 180, 74, .9);
}

.jk-order.is-ready .jk-submit:hover {
    background: var(--jk-green-dark);
}

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

.jk-order .jk-submit:disabled {
    cursor: wait;
}

.jk-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: jk-spin .7s linear infinite;
}

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

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

.jk-order a {
    color: var(--jk-green-dark);
}

/* Külgribas kitsam */
.widget-area .jk-order {
    padding: 20px 16px;
    box-shadow: none;
}

.widget-area .jk-order .jk-order__title {
    font-size: 1.25em;
}

.widget-area .jk-grid--sizes,
.widget-area .jk-grid--two {
    grid-template-columns: 1fr;
}

@media (max-width: 600px) {
    .jk-order {
        padding: 20px 16px;
        border-radius: 16px;
    }

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

    .jk-grid--sizes .jk-tile__body {
        padding: 12px;
    }

    .jk-grid--sizes .jk-tile__title {
        white-space: normal;
        padding-right: 18px;
    }
}

/* Kingitud Elu kaart külgribas */
.jk-gift {
    display: block;
    border-radius: 16px;
    overflow: hidden;
    background: #b24a33;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 10px 30px -18px rgba(120, 30, 10, .6);
    transition: transform .2s, box-shadow .2s;
}

.widget-area .widget a.jk-gift,
.widget-area .widget a.jk-gift:hover {
    color: #fff;
    text-decoration: none;
}

.jk-gift:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px -18px rgba(120, 30, 10, .7);
}

.jk-gift__img {
    display: block;
    width: 100%;
    height: auto;
}

.jk-gift__text {
    display: block;
    padding: 16px 18px 18px;
    line-height: 1.45;
}

.jk-gift__more {
    display: block;
    margin-top: 8px;
    font-size: .85em;
    opacity: .85;
}

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

@keyframes jk-fade {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }
}

@keyframes jk-shake {
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
    .jk-order *, .jk-gift {
        animation: none !important;
        transition: none !important;
    }
}

/* Kassa aadressi soovitused (In-ADS) */
.jk-ads {
    position: absolute;
    z-index: 50;
    left: 0;
    right: 0;
    margin: 4px 0 0;
    padding: 4px;
    list-style: none;
    background: #fff;
    border: 1px solid #dfe5e1;
    border-radius: 12px;
    box-shadow: 0 12px 30px -12px rgba(20, 40, 30, .35);
    max-height: 320px;
    overflow-y: auto;
}

.jk-ads li {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 0;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    line-height: 1.3;
}

.jk-ads li span {
    font-size: .85em;
    color: #66706a;
}

.jk-ads li.is-active {
    background: #eaf7ed;
}

/* Kassas muudetav tellimus */
.jk-order--checkout {
    padding: 18px;
    margin: 0 0 20px;
    box-shadow: none;
    border-radius: 16px;
}

.jk-order--checkout .jk-step {
    margin-bottom: 16px;
}

.jk-order--checkout .jk-step:last-child {
    margin-bottom: 0;
}

.jk-order--checkout .jk-step__label {
    font-size: .95em;
    margin-bottom: 8px;
}

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

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

.jk-order--checkout .jk-tile__body {
    padding: 10px 12px;
}

.jk-order--checkout .jk-tile__title {
    font-size: .95em;
    white-space: normal;
}

.jk-order--checkout .jk-extra {
    padding: 9px 12px;
    font-size: .95em;
}

.processing .jk-order--checkout {
    opacity: .6;
    pointer-events: none;
}

.jk-order--checkout .woocommerce-info {
    margin: 0 0 14px;
    font-size: .9em;
    border-radius: 10px;
}
