/* =================================================================
   UX Checkout - stepper layout (Dane -> Dostawa -> Platnosc)
   Loaded after checkout-style.css; scoped to .ux-kfd
   ================================================================= */

.ux-kfd {
    --kfd-green: 142, 206, 96;
    --kfd-link: 1, 78, 255;
    --kfd-text: #242424;
    --kfd-muted: #777;
    --kfd-line: #e5e7e8;
    --kfd-radius: 8px;
    --ux-border-radius: 8px; /* one radius everywhere (overrides the 2px of checkout-style.css) */
}

.ux-kfd-hidden { display: none !important; }

/* until the script has distributed the fields, don't show the half-built page */
.ux-kfd--pending .ux-kfd__layout { visibility: hidden; }
.ux-kfd.ux-kfd-ready .ux-kfd__pool { display: none; }

/* WooCommerce's own "returning customer / coupon" toggles are replaced by links inside the cards */
body.ux-kfd-page .woocommerce-form-login-toggle,
body.ux-kfd-page .woocommerce-form-coupon-toggle { display: none; }

/* ------------------------------------------------------------ layout */

.ux-kfd .ux-checkout__form { display: block; }

.ux-kfd__layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media screen and (min-width: 768px) {
    .ux-kfd__layout { flex-direction: row; align-items: flex-start; gap: 32px; }
    .ux-kfd__main { flex: 1 1 62%; min-width: 0; }
    .ux-kfd__sidebar { flex: 0 1 38%; min-width: 280px; position: sticky; top: 20px; }
}

.ux-kfd .ux-checkout__customer-wrapper { flex: initial; }
.ux-kfd .ux-kfd__main { display: block; }

/* ------------------------------------------------------------- cards */

.ux-kfd__card {
    background: #fff;
    border: 1px solid var(--kfd-line);
    border-radius: var(--kfd-radius);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
    margin-bottom: 14px;
}

.ux-kfd__card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 16px 22px;
}

.ux-kfd__card-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 600;
    color: var(--kfd-text);
}

.ux-kfd__chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; min-width: 0; }

.ux-kfd__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 6px 12px;
    background: #f1f2f3;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--kfd-text);
    cursor: default;
    overflow-wrap: anywhere;
    text-align: left;
}
.ux-kfd__chip[data-edit] { cursor: pointer; }
.ux-kfd__chip-edit { font-size: 12px; color: var(--kfd-muted); }

.ux-kfd__status { margin-left: auto; }
.ux-kfd__card.is-done .ux-kfd__status,
.ux-kfd__card.is-static .ux-kfd__status {
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(var(--kfd-green), .18);
    color: #2c7a1f;
    font-size: 13px;
    font-weight: 700;
}
.ux-kfd__card.is-done .ux-kfd__status::after,
.ux-kfd__card.is-static .ux-kfd__status::after { content: "Gotowe \2713"; }

.ux-kfd__card-body { padding: 0 22px 22px; border-top: 1px solid var(--kfd-line); }
.ux-kfd__card.is-done .ux-kfd__card-body,
.ux-kfd__card.is-static .ux-kfd__card-body { display: none; }
.ux-kfd__card.is-done .ux-kfd__card-head { cursor: pointer; }
.ux-kfd__card.is-static .ux-kfd__card-head { cursor: default; }

.ux-kfd__card.is-locked .ux-kfd__locked-content { display: none; }
.ux-kfd__card.is-locked .ux-kfd__card-title { color: var(--kfd-muted); }
.ux-kfd__hint { margin: 14px 0 12px; font-size: 13px; color: var(--kfd-muted); }
.ux-kfd__card:not(.is-locked) .ux-kfd__hint--locked { display: none; }
.ux-kfd__card.is-locked .ux-kfd__card-body { border-top: 0; padding-bottom: 6px; }
.ux-kfd__card.is-locked .ux-kfd__hint--locked { margin-top: 0; }

/* payment card has no "next" button - it ends with the order button in the sidebar */
.ux-kfd__card[data-card="payment"] .ux-kfd__card-body { padding-top: 6px; }

/* ----------------------------------------------------- fields in slots */

.ux-kfd__slot { display: flex; flex-wrap: wrap; gap: 14px 10px; margin-top: 14px; }
.ux-kfd__slot:empty { display: none; }
.ux-kfd__slot > .form-row { margin: 0; }
.ux-kfd__slot > .woocommerce-account-fields,
.ux-kfd__slot > .woocommerce-shipping-fields,
.ux-kfd__slot > .woocommerce-additional-fields { width: 100%; margin: 0; border: 0; padding: 0; background: none; }
.ux-kfd__slot > .woocommerce-additional-fields h3 { display: none; }
.ux-kfd__slot .woocommerce-account-fields p.create-account { display: none; }
.ux-kfd__slot #billing_faktura_field,
.ux-kfd__slot #custom_billing_faktura_field { width: 100%; }

.ux-kfd .ux-checkout__section-title { display: none; }
.ux-kfd .ux-checkout__section-title::before { content: none; }
.ux-kfd .ux-checkout__section--delivery,
.ux-kfd .ux-checkout__section--payment { padding: 0; border: 0; margin: 14px 0 0; }
.ux-kfd .shipping-methods,
.ux-kfd .payment-methods { margin: 0; }

/* ----------------------------------------------------------- buttons */

.ux-kfd__actions { margin-top: 18px; display: flex; justify-content: flex-end; }

.ux-kfd__btn {
    appearance: none;
    border: 0;
    border-radius: var(--kfd-radius);
    background: rgb(var(--kfd-green));
    color: #fff;
    padding: 13px 26px;
    font: inherit;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    cursor: pointer;
}
.ux-kfd__btn:hover { filter: brightness(.95); }

.ux-kfd__linkbtn {
    appearance: none;
    background: none;
    border: 0;
    padding: 8px 0;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: rgb(var(--kfd-link));
    cursor: pointer;
}

.ux-kfd__account-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 18px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--kfd-line);
    font-size: 14px;
    color: var(--kfd-muted);
}
.ux-kfd__account-links a { color: rgb(var(--kfd-link)); font-weight: 600; text-decoration: none; }
.ux-kfd__account-text, .ux-kfd__account-act { margin: 0; }

.ux-kfd__notice {
    margin: 12px 0 0;
    padding: 12px 14px;
    background: #fff7e6;
    border: 1px solid #f0d9a8;
    border-radius: 6px;
    font-size: 14px;
    color: #6b5316;
}

.ux-kfd__email-delivery { padding: 12px 0 0; font-weight: 600; }

/* --------------------------------------------------- shipping / payment lists */

.ux-kfd #shipping_method,
.ux-kfd .payment_methods { list-style: none; margin: 8px 0 0; padding: 0; }

.ux-kfd #shipping_method > li.ux-kfd__heading,
.ux-kfd #shipping_method > li.ux-kfd__more,
.ux-kfd .payment_methods > li.ux-kfd__more {
    border: 0;
    background: none;
    box-shadow: none;
    padding: 4px 0;
}
.ux-kfd #shipping_method > li.ux-kfd__heading {
    margin-top: 14px;
    font-size: 16px;
    font-weight: 700;
    color: var(--kfd-text);
}
.ux-kfd #shipping_method > li.ux-kfd__more,
.ux-kfd .payment_methods > li.ux-kfd__more { text-align: right; }

/* ------------------------------------------------------------ summary */

.ux-kfd__sidebar #order_details {
    background: #fff;
    border: 1px solid var(--kfd-line);
    border-radius: var(--kfd-radius);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
    padding: 20px 22px;
}

.ux-kfd .ux-checkout__order-title { margin: 0 0 8px; font-size: 18px; font-weight: 700; }

.ux-kfd__products-toggle {
    appearance: none;
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--kfd-line);
    padding: 8px 0 12px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: rgb(var(--kfd-link));
    cursor: pointer;
}
.ux-kfd__products-count { color: var(--kfd-muted); font-weight: 400; }

.ux-kfd:not(.ux-products-open) .ux-order-review__body,
.ux-kfd:not(.ux-products-open) .ux-order-review__header { display: none; }

/* order button + consents only once the customer reaches "Platnosc" */
.ux-kfd:not([data-step="payment"]) #payment { display: none; }

/* 5% bonus: two marketing consents behind one header checkbox */
.ux-kfd__bonus { margin: 14px 0 6px; padding: 12px 14px; border: 1px dashed rgba(var(--kfd-green), 1); border-radius: 6px; background: rgba(var(--kfd-green), .08); }
.ux-kfd__bonus-head { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 700; cursor: pointer; }
.ux-kfd__bonus-body { display: none; margin-top: 10px; }
.ux-kfd__bonus.is-open .ux-kfd__bonus-body { display: block; }

/* ------------------------------------------------------------- mobile */

.ux-kfd__mobilebar { display: none; }

@media screen and (max-width: 767px) {
    .ux-kfd { padding-bottom: 72px; }
    .ux-kfd__card-head { padding: 14px 16px; }
    .ux-kfd__card-title { font-size: 20px; }
    .ux-kfd__card-body { padding: 0 16px 18px; }
    .ux-kfd__card.is-done .ux-kfd__status::after,
    .ux-kfd__card.is-static .ux-kfd__status::after { content: "\2713"; }
    .ux-kfd__card.is-done .ux-kfd__status,
    .ux-kfd__card.is-static .ux-kfd__status { padding: 4px 10px; }
    .ux-kfd__actions { justify-content: stretch; }
    .ux-kfd__btn { width: 100%; }
    .ux-kfd__slot > .form-row { width: 100% !important; }

    .ux-kfd__mobilebar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999;
        justify-content: space-between;
        align-items: center;
        padding: 14px 18px;
        background: #fff;
        border-top: 1px solid var(--kfd-line);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, .08);
        font-size: 17px;
    }
}

/* ------------------------------------------------ specificity / theme overrides */

.ux-checkout.ux-kfd.ux-kfd-ready #customer_details.ux-kfd__pool { display: none !important; }

.ux-kfd .ux-kfd__btn,
.ux-kfd button.ux-kfd__btn {
    background: rgb(var(--kfd-green)) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: none;
}
.ux-kfd .ux-kfd__linkbtn,
.ux-kfd .ux-kfd__account-links a { color: rgb(var(--kfd-link)) !important; text-transform: none; }
.ux-kfd .ux-kfd__account-links .ux-kfd__account-text { color: var(--kfd-muted) !important; }
.ux-kfd .ux-kfd__chip { text-transform: none; background: #f1f2f3 !important; color: var(--kfd-text) !important; }
.ux-kfd .ux-kfd__products-toggle { text-transform: none; color: rgb(var(--kfd-link)) !important; background: none !important; }
.ux-kfd .ux-kfd__card-title { text-transform: none; }

/* two columns inside cards: email | phone, imie | nazwisko */
.ux-kfd__slot > #billing_email_field,
.ux-kfd__slot > #billing_phone_field,
.ux-kfd__slot > #billing_first_name_field,
.ux-kfd__slot > #billing_last_name_field,
.ux-kfd__slot > #billing_postcode_field,
.ux-kfd__slot > #billing_city_field {
    flex: 1 1 calc(50% - 10px);
    width: auto !important;
    max-width: none;
    float: none;
    min-width: 0;
}
.ux-kfd__slot > #billing_address_1_field,
.ux-kfd__slot > #billing_country_field,
.ux-kfd__slot > #billing_company_field,
.ux-kfd__slot > #billing_nip_field {
    flex: 1 1 100%;
    width: 100% !important;
    float: none;
}
.ux-kfd__slot .form-row input.input-text,
.ux-kfd__slot .form-row select { width: 100%; }

/* only one invoice checkbox is shown (the other one is kept in sync by JS) */
.ux-kfd #custom_billing_faktura_field { display: none !important; }

/* tighter rhythm between cards (the older stylesheet puts a flex gap on #customer-wrapper) */
.ux-kfd #customer-wrapper.ux-kfd__main { display: block; gap: 0; }
@media screen and (min-width: 768px) {
    .ux-kfd #customer-wrapper.ux-kfd__main { flex: 1 1 62%; }
}
.ux-kfd .ux-kfd__linkbtn { background: none !important; box-shadow: none; border: 0 !important; padding: 8px 0 !important; min-height: 0; }
.ux-kfd .ux-kfd__more { text-align: right; }

.ux-kfd #shipping_method > li.ux-kfd__locker { border: 0; background: none; box-shadow: none; padding: 0; margin: 0; }
.ux-kfd #shipping_method > li.ux-kfd__locker .paczkomat_id_wrapper { display: block; margin-top: 6px; }

/* summary column: don't let the older flex rules stretch it on mobile */
.ux-kfd .ux-checkout__order-details-wrapper.ux-kfd__sidebar { flex: 0 0 auto; height: auto; min-height: 0; margin: 0; padding: 0; }
@media screen and (min-width: 768px) {
    .ux-kfd .ux-checkout__order-details-wrapper.ux-kfd__sidebar { flex: 0 1 38%; }
}

/* mobile card header: title + status on one line, chips below */
@media screen and (max-width: 767px) {
    .ux-kfd__card-head { align-items: center; }
    .ux-kfd__card-title { order: 1; }
    .ux-kfd__status { order: 2; margin-left: auto; }
    .ux-kfd__chips { order: 3; flex: 1 1 100%; }
}

/* digital cart: phone is hidden, so email takes the full row and first/last name sit side by side */
.ux-kfd[data-digital="1"] .ux-kfd__slot > #billing_email_field { flex: 1 1 100%; }

/* =================================================================
   Round 2: one radius, shipping rows, locker picker, summary column
   ================================================================= */

/* ---- one corner radius for every control (buttons already had it) ---- */
.ux-kfd input.input-text,
.ux-kfd input[type="text"],
.ux-kfd input[type="email"],
.ux-kfd input[type="tel"],
.ux-kfd input[type="password"],
.ux-kfd select,
.ux-kfd textarea,
.ux-kfd .select2-container .select2-selection,
.ux-kfd .select2-container--default .select2-selection--single,
.ux-kfd .form-row .woocommerce-input-wrapper > input,
.ux-kfd .wc_payment_method,
.ux-kfd .payment_box,
.ux-kfd .ux-kfd__notice,
.ux-kfd .ux-kfd__bonus,
.ux-kfd .ux-kfd__btn,
.ux-kfd #open-geowidget,
.ux-kfd .ux-apply-coupon,
.ux-kfd #ux_coupon_code {
    border-radius: var(--kfd-radius) !important;
}
.ux-kfd .ux-kfd__card { border-radius: calc(var(--kfd-radius) + 2px); }

/* ---- shipping rows: the <li> is the box ---- */
.ux-kfd #shipping_method > li:not(.ux-kfd__heading):not(.ux-kfd__more):not(.ux-kfd__locker) {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0 0 10px;
    padding: 0;
    background: #fff;
    border: 1px solid #d9dcde;
    border-radius: var(--kfd-radius);
    box-shadow: none;
    transition: border-color .15s, background-color .15s;
}
.ux-kfd #shipping_method > li.is-checked:not(.ux-kfd__locker) {
    border-color: rgb(var(--kfd-green));
    background: rgba(var(--kfd-green), .08);
    box-shadow: 0 0 0 1px rgb(var(--kfd-green));
}
.ux-kfd #shipping_method > li > input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.ux-kfd #shipping_method > li > label {
    display: flex;
    flex: 1 1 100%;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 14px 16px;
    width: 100%;
    min-height: 56px;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    cursor: pointer;
}
.ux-kfd #shipping_method > li > label::before,
.ux-kfd #shipping_method > li > label::after { display: none !important; }

.ux-kfd .ux-kfd-ship__icon {
    flex: 0 0 64px;
    width: 64px;
    height: 36px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}
.ux-kfd .ux-kfd-ship__icon--inpost { background-image: url("../img/inpost.svg"); }
.ux-kfd .ux-kfd-ship__icon--pin {
    background-size: 28px 28px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23242424' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M12 21s-7-5.6-7-11a7 7 0 1 1 14 0c0 5.4-7 11-7 11z'/><circle cx='12' cy='10' r='2.6'/></svg>");
}
.ux-kfd .ux-kfd-ship__icon--truck {
    background-size: 30px 30px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23242424' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M2 6h11v10H2zM13 9h4l3 3v4h-7z'/><circle cx='7' cy='17.5' r='1.8'/><circle cx='16.5' cy='17.5' r='1.8'/></svg>");
}
.ux-kfd .ux-kfd-ship__name { flex: 1 1 auto; font-size: 15px; font-weight: 600; color: var(--kfd-text); }
.ux-kfd .ux-kfd-ship__price { flex: 0 0 auto; margin-left: auto; font-size: 15px; font-weight: 700; color: var(--kfd-text); white-space: nowrap; }
.ux-kfd .ux-kfd-ship__price .amount,
.ux-kfd .ux-kfd-ship__price bdi { color: inherit; font-weight: inherit; }

/* description of a method (e.g. address of the pickup point) stays inside the box */
.ux-kfd #shipping_method > li > .shipping-method-description,
.ux-kfd #shipping_method > li > p {
    flex: 1 1 100%;
    margin: -6px 0 0;
    padding: 0 16px 14px 94px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--kfd-muted);
}

/* ---- parcel locker picker ---- */
.ux-kfd #shipping_method > li.ux-kfd__locker { margin: 0 0 10px; }
.ux-kfd #paczkomat_id_wrapper {
    display: flex !important;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin: 0;
    padding: 14px;
    background: #f7f8f8;
    border: 1px solid var(--kfd-line);
    border-radius: var(--kfd-radius);
}
.ux-kfd #paczkomat_id_wrapper.ux-kfd-hidden { display: none !important; }
.ux-kfd #paczkomat_id_field { flex: 1 1 240px; width: auto !important; margin: 0 !important; float: none; padding: 0; }
.ux-kfd #paczkomat_id_field > label {
    position: static !important;
    display: block;
    margin: 0 0 6px;
    padding: 0;
    background: none;
    transform: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--kfd-text);
}
.ux-kfd #paczkomat_id_field .woocommerce-input-wrapper,
.ux-kfd #paczkomat_id_field .select2-container { width: 100% !important; display: block; }
.ux-kfd #paczkomat_id_field .select2-selection { min-height: 44px; background: #fff; }
.ux-kfd #open-geowidget {
    flex: 0 0 auto;
    margin: 0;
    padding: 12px 20px;
    background: #fff !important;
    color: rgb(var(--kfd-link)) !important;
    border: 1px solid rgb(var(--kfd-link)) !important;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    line-height: 1.2;
}

/* ---- summary column: fixed final width, same white card as the steps ---- */
@media screen and (min-width: 992px) {
    .ux-kfd .ux-checkout__order-details-wrapper.ux-kfd__sidebar { flex: 0 0 440px; width: 440px; max-width: 440px; }
}
@media screen and (min-width: 768px) and (max-width: 991px) {
    .ux-kfd .ux-checkout__order-details-wrapper.ux-kfd__sidebar { flex: 0 0 340px; width: 340px; }
}
.ux-kfd .ux-kfd__sidebar,
.ux-kfd .ux-kfd__sidebar #order_details { margin-top: 0; }

.ux-kfd .ux-kfd__sidebar #order_details {
    background: #fff !important;
    border: 1px solid var(--kfd-line);
    border-radius: calc(var(--kfd-radius) + 2px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
    padding: 22px;
    width: 100%;
    box-sizing: border-box;
}
.ux-kfd .ux-kfd__sidebar #order_review,
.ux-kfd .ux-kfd__sidebar #order_review .wd-table-wrapper,
.ux-kfd .ux-kfd__sidebar #order_review table,
.ux-kfd .ux-kfd__sidebar #order_review thead,
.ux-kfd .ux-kfd__sidebar #order_review tbody,
.ux-kfd .ux-kfd__sidebar #order_review tfoot,
.ux-kfd .ux-kfd__sidebar #order_review tr,
.ux-kfd .ux-kfd__sidebar #order_review th,
.ux-kfd .ux-kfd__sidebar #order_review td,
.ux-kfd .ux-kfd__sidebar #payment {
    background: transparent !important;
    border-left: 0;
    border-right: 0;
}
.ux-kfd .ux-kfd__sidebar #order_review table { width: 100%; margin: 0; }
.ux-kfd .ux-kfd__sidebar #order_review th,
.ux-kfd .ux-kfd__sidebar #order_review td { padding: 12px 0; font-size: 14px; color: var(--kfd-text); }
.ux-kfd .ux-kfd__sidebar #order_review .woocommerce-Price-amount,
.ux-kfd .ux-kfd__sidebar #order_review .amount,
.ux-kfd .ux-kfd__sidebar #order_review bdi { color: var(--kfd-text) !important; font-weight: 600; }
.ux-kfd .ux-kfd__sidebar #order_review .order-total th { font-size: 16px; font-weight: 700; }
.ux-kfd .ux-kfd__sidebar #order_review .order-total .woocommerce-Price-amount,
.ux-kfd .ux-kfd__sidebar #order_review .order-total bdi { font-size: 22px; font-weight: 800; }
.ux-kfd .ux-kfd__sidebar .ux-order-review__free-shipping { color: var(--kfd-text); }

.ux-kfd .ux-coupon td { text-align: center; padding: 8px 0; }
.ux-kfd .ux-coupon__toggle { margin: 0; font-size: 14px; font-weight: 600; color: rgb(var(--kfd-link)) !important; text-align: center; }
.ux-kfd .ux-coupon__form { text-align: left; }

.ux-kfd .ux-checkout__order-title { text-align: left; font-size: 18px; text-transform: none; }
.ux-kfd .ux-kfd__products-toggle { justify-content: space-between; }

.ux-kfd .ux-kfd__sidebar .woocommerce-privacy-policy-text,
.ux-kfd .ux-kfd__sidebar .woocommerce-terms-and-conditions-wrapper { color: var(--kfd-text); }

@media screen and (max-width: 767px) {
    .ux-kfd .ux-kfd__sidebar #order_details { padding: 16px; }
    .ux-kfd #shipping_method > li > .shipping-method-description,
    .ux-kfd #shipping_method > li > p { padding-left: 16px; }
    .ux-kfd .ux-kfd-ship__icon { flex-basis: 48px; width: 48px; }
}

/* ---- round 2b ---- */

/* locker picker: neutralise the floating-label box of the older stylesheet */
.ux-kfd #paczkomat_id_field > label,
.ux-kfd #paczkomat_id_field > label.required_field {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: auto !important;
    height: auto !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    line-height: 1.3;
}
.ux-kfd #paczkomat_id_field > label .required { display: inline; margin-left: 2px; }
.ux-kfd #paczkomat_id_field .woocommerce-input-wrapper { position: static; }

/* carrier logo: the SVG has wide margins, so draw it larger inside the slot */
.ux-kfd .ux-kfd-ship__icon { flex-basis: 72px; width: 72px; height: 40px; }
.ux-kfd .ux-kfd-ship__icon--pin,
.ux-kfd .ux-kfd-ship__icon--truck { background-size: 28px 28px; }

/* summary heading: same look as the other headings, left aligned */
.ux-kfd .ux-kfd__sidebar #order_review_heading,
.ux-kfd .ux-kfd__sidebar .ux-checkout__order-title {
    margin: 0 0 6px;
    text-align: left;
    text-transform: none;
    font-size: 22px;
    font-weight: 600;
    color: var(--kfd-text);
}

/* no sticky: it made the column look shifted against the cards once the page was scrolled */
.ux-kfd .ux-checkout__order-details-wrapper.ux-kfd__sidebar { position: static; }
.ux-kfd__layout { margin-bottom: 40px; }

/* order button spans the card like on KFD */
.ux-kfd .ux-kfd__sidebar #place_order,
.ux-kfd .ux-kfd__sidebar .ux-payment__submit-button {
    display: block;
    width: 100%;
    margin: 16px 0 0;
    padding: 15px 20px;
    border-radius: var(--kfd-radius) !important;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

@media screen and (max-width: 767px) {
    .ux-kfd .ux-kfd-ship__icon { flex-basis: 56px; width: 56px; }
}

/* ---- round 2c ---- */
/* select2 hides the real <select> with a 1px clip; never override that */
.ux-kfd #paczkomat_id_field select.select2-hidden-accessible {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
}
.ux-kfd #paczkomat_id_field .select2-selection--single { display: flex; align-items: center; }
.ux-kfd #paczkomat_id_field .select2-selection__rendered { line-height: 42px; padding-left: 12px; }
.ux-kfd #paczkomat_id_field .select2-selection__arrow { height: 42px; }

/* logo slot: tight viewBox, so plain contain is enough */
.ux-kfd .ux-kfd-ship__icon { flex: 0 0 72px; width: 72px; height: 34px; }
.ux-kfd .ux-kfd-ship__icon--inpost { background-size: contain; }

/* summary: toggle flush left with the table, labels as big as the amounts */
.ux-kfd .ux-kfd__products-toggle { justify-content: flex-start; gap: 8px; padding: 8px 0 12px; }
.ux-kfd .ux-kfd__sidebar #order_review tfoot th,
.ux-kfd .ux-kfd__sidebar #order_review tfoot td,
.ux-kfd .ux-kfd__sidebar #order_review thead th,
.ux-kfd .ux-kfd__sidebar #order_review tbody td { font-size: 14px !important; }
.ux-kfd .ux-kfd__sidebar #order_review tfoot th { font-weight: 600; }
.ux-kfd .ux-kfd__sidebar #order_review .order-total th { font-size: 16px !important; font-weight: 700; }

/* locker select: only the outer select2 box has a border, not its inner text span */
.ux-kfd #paczkomat_id_field .select2-selection__rendered {
    flex: 1 1 auto;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    outline: 0;
}
.ux-kfd #paczkomat_id_field .select2-selection--single {
    border: 1px solid #d9dcde !important;
    background: #fff !important;
    height: 44px;
}

/* ---- round 2d: tighter locker block, mobile layout ---- */
.ux-kfd .ux-kfd__notice { margin: 0 0 8px; }
.ux-kfd #shipping_method > li.ux-kfd__locker { margin: 0 0 10px; }
.ux-kfd #shipping_method > li:not(.ux-kfd__heading):not(.ux-kfd__more):not(.ux-kfd__locker) { margin-bottom: 10px; }

.ux-kfd #shipping_method > li > label { flex-wrap: nowrap !important; }
.ux-kfd .ux-kfd-ship__name { min-width: 0; white-space: normal; }

@media screen and (max-width: 767px) {
    .ux-kfd #paczkomat_id_wrapper { flex-direction: column; align-items: stretch; }
    .ux-kfd #paczkomat_id_field {
        flex: 0 0 auto;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        float: none !important;
    }
    .ux-kfd #paczkomat_id_field .woocommerce-input-wrapper,
    .ux-kfd #paczkomat_id_field .select2-container { width: 100% !important; }
    .ux-kfd #open-geowidget { width: 100%; text-align: center; }
    .ux-kfd .ux-kfd-ship__icon { flex-basis: 52px; width: 52px; }
    .ux-kfd #shipping_method > li > label { gap: 10px; padding: 12px 14px; }
}

/* ---- round 3: clear selected state, fixed locker position, button alignment ---- */
.ux-kfd #shipping_method > li.is-checked:not(.ux-kfd__heading):not(.ux-kfd__more):not(.ux-kfd__locker) {
    border-color: rgb(var(--kfd-green));
    background: rgba(var(--kfd-green), .10);
    box-shadow: 0 0 0 1px rgb(var(--kfd-green));
}

/* visible radio indicator at the start of every row */
.ux-kfd .ux-kfd-ship__radio {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    box-sizing: border-box;
    border: 2px solid #b8bcc0;
    border-radius: 50%;
    background: #fff;
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.ux-kfd #shipping_method > li.is-checked .ux-kfd-ship__radio {
    border-color: rgb(var(--kfd-green));
    background: rgb(var(--kfd-green));
    box-shadow: inset 0 0 0 3px #fff;
}
.ux-kfd #shipping_method > li > .shipping-method-description,
.ux-kfd #shipping_method > li > p { padding-left: 116px; }

/* the map button lines up with the select (the older stylesheet gave it a top margin) */
.ux-kfd #paczkomat_id_wrapper #open-geowidget,
.ux-kfd #open-geowidget.button {
    margin: 0 !important;
    align-self: flex-end;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding-top: 0;
    padding-bottom: 0;
}
.ux-kfd #paczkomat_id_field { margin-bottom: 0 !important; }
.ux-kfd #paczkomat_id_field .woocommerce-input-wrapper { margin: 0; }

@media screen and (max-width: 767px) {
    .ux-kfd #shipping_method > li > .shipping-method-description,
    .ux-kfd #shipping_method > li > p { padding-left: 16px; }
    .ux-kfd #paczkomat_id_wrapper #open-geowidget { align-self: stretch; }
}

/* description lines up with the method name; pin icon sits at the left edge of the logo slot */
.ux-kfd #shipping_method > li > .shipping-method-description,
.ux-kfd #shipping_method > li > p { padding-left: 136px; }
.ux-kfd .ux-kfd-ship__icon--pin,
.ux-kfd .ux-kfd-ship__icon--truck { background-position: 4px center; }
@media screen and (max-width: 767px) {
    .ux-kfd #shipping_method > li > .shipping-method-description,
    .ux-kfd #shipping_method > li > p { padding-left: 16px; }
}

/* ---- round 4: one-piece rows, links row, mobile name fields ---- */
.ux-kfd .ux-kfd-ship__text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.ux-kfd .ux-kfd-ship__name { flex: none; }
.ux-kfd .ux-kfd-ship__desc { font-size: 13px; line-height: 1.35; font-weight: 400; color: var(--kfd-muted); }

/* pin / truck have no wide logo, so their slot is narrow and the text sits close to the icon */
.ux-kfd .ux-kfd-ship__icon--pin,
.ux-kfd .ux-kfd-ship__icon--truck { flex: 0 0 32px; width: 32px; background-position: center; }

/* the older description rules are obsolete (it is part of the label now) */
.ux-kfd #shipping_method > li > .shipping-method-description,
.ux-kfd #shipping_method > li > p { display: none; }

.ux-kfd__links-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 16px;
    margin-top: 4px;
}
.ux-kfd__links-left, .ux-kfd__links-right { display: flex; align-items: center; }
.ux-kfd__links-right { margin-left: auto; }
.ux-kfd__links-row .ux-kfd__linkbtn { padding: 8px 0 !important; }

@media screen and (max-width: 767px) {
    .ux-kfd__slot > #billing_first_name_field,
    .ux-kfd__slot > #billing_last_name_field,
    .ux-kfd__slot > #billing_email_field,
    .ux-kfd__slot > #billing_phone_field,
    .ux-kfd__slot > #billing_postcode_field,
    .ux-kfd__slot > #billing_city_field { flex: 1 1 100%; }
    .ux-kfd .ux-kfd-ship__icon--pin,
    .ux-kfd .ux-kfd-ship__icon--truck { flex-basis: 28px; width: 28px; }
    .ux-kfd__links-row { flex-direction: column; align-items: flex-start; }
    .ux-kfd__links-right { margin-left: 0; }
}

/* ---- round 5: login close, cancel-account link, no zoom on focus (iOS Safari) ---- */
body.ux-kfd-page form.woocommerce-form-login.ux-kfd__login { position: relative; padding-right: 56px; }
body.ux-kfd-page .ux-kfd__close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #242424;
    font-size: 28px;
    line-height: 34px;
    text-align: center;
    cursor: pointer;
}
body.ux-kfd-page .ux-kfd__close:hover,
body.ux-kfd-page .ux-kfd__close:focus-visible { background: rgba(0, 0, 0, .08); outline: 0; }

.ux-kfd__account-cancel { margin-top: 6px; }
.ux-kfd__account-cancel .ux-kfd__linkbtn { padding: 6px 0 !important; }

.ux-kfd__heading--other { margin-top: 14px; }

/* iOS Safari zooms into any field whose font is smaller than 16px; 16px on touch widths stops it
   without disabling pinch-zoom for the user (which would hurt accessibility) */
@media screen and (max-width: 991px) {
    .ux-kfd input[type="text"],
    .ux-kfd input[type="email"],
    .ux-kfd input[type="tel"],
    .ux-kfd input[type="password"],
    .ux-kfd input[type="number"],
    .ux-kfd input[type="search"],
    .ux-kfd input.input-text,
    .ux-kfd select,
    .ux-kfd textarea,
    .ux-kfd .select2-selection,
    .ux-kfd .select2-selection__rendered,
    .ux-kfd .select2-search__field,
    body.ux-kfd-page form.woocommerce-form-login input {
        font-size: 16px !important;
    }
}

/* =================================================================
   Round 6: inline "you already have an account" step (inside the Dane card)
   ================================================================= */
.ux-kfd--login [data-card="data"] .ux-kfd__hint,
.ux-kfd--login [data-card="data"] [data-slot="data"],
.ux-kfd--login [data-card="data"] .ux-kfd__actions,
.ux-kfd--login [data-card="data"] .ux-kfd__account-links { display: none !important; }

.ux-kfd__loginstep { padding-top: 16px; }
.ux-kfd__loginstep-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }
.ux-kfd__loginstep-title { font-size: 20px; font-weight: 700; color: var(--kfd-text); }
.ux-kfd__loginstep-cancel .ux-kfd__linkbtn { padding: 4px 0 !important; }

.ux-kfd__loginstep-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.ux-kfd__fld { position: relative; flex: 1 1 220px; min-width: 0; }
.ux-kfd__fld > label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--kfd-text); }
.ux-kfd__fld > input {
    display: block;
    width: 100%;
    height: 46px;
    box-sizing: border-box;
    padding: 0 14px;
    border: 1px solid #d9dcde;
    border-radius: var(--kfd-radius);
    background: #fff;
    font-size: 16px;
    color: var(--kfd-text);
}
.ux-kfd__fld > input:focus { outline: 0; border-color: rgb(var(--kfd-link)); box-shadow: 0 0 0 3px rgba(var(--kfd-link), .15); }
.ux-kfd__fld--pass > input { padding-right: 70px; }
.ux-kfd__pass-toggle {
    position: absolute;
    right: 8px;
    bottom: 7px;
    height: 32px;
    padding: 0 8px;
    border: 0;
    background: none;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    color: rgb(var(--kfd-link));
    cursor: pointer;
}
.ux-kfd__loginstep-go { flex: 0 0 auto; }
.ux-kfd__loginstep-go .ux-kfd__btn { height: 46px; padding-top: 0; padding-bottom: 0; white-space: nowrap; }

.ux-kfd__loginstep-msg { min-height: 0; margin-top: 10px; font-size: 14px; }
.ux-kfd__loginstep-msg:empty { display: none; }
.ux-kfd__loginstep-msg[data-type="error"] { color: #b3261e; }
.ux-kfd__loginstep-msg[data-type="ok"] { color: #2c7a1f; }

.ux-kfd__loginstep-or { display: flex; align-items: center; gap: 14px; margin: 18px 0 14px; font-size: 13px; color: var(--kfd-muted); }
.ux-kfd__loginstep-or::before,
.ux-kfd__loginstep-or::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--kfd-line); }

.ux-kfd .ux-kfd__btn--ghost {
    background: #fff !important;
    color: rgb(var(--kfd-link)) !important;
    border: 1px solid rgb(var(--kfd-link)) !important;
}
.ux-kfd .ux-kfd__btn.is-busy,
.ux-kfd .ux-kfd__btn:disabled { opacity: .6; cursor: progress; }

@media screen and (max-width: 767px) {
    .ux-kfd__loginstep-title { font-size: 18px; }
    .ux-kfd__loginstep-go { flex: 1 1 100%; }
    .ux-kfd__loginstep-go .ux-kfd__btn { width: 100%; }
    .ux-kfd__loginstep-reset .ux-kfd__btn { width: 100%; }
}

/* ---- round 6b: the theme restyles inputs/buttons, so pin the sub-step's own look ---- */
.ux-kfd .ux-kfd__loginstep .ux-kfd__fld { position: relative; margin: 0; padding: 0; }
.ux-kfd .ux-kfd__loginstep .ux-kfd__fld > label {
    position: static !important;
    display: block;
    margin: 0 0 6px !important;
    padding: 0 !important;
    transform: none !important;
    background: none !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--kfd-text);
}
.ux-kfd .ux-kfd__loginstep .ux-kfd__fld > input {
    display: block !important;
    width: 100% !important;
    height: 46px !important;
    margin: 0 !important;
    padding: 0 14px !important;
    box-sizing: border-box !important;
    border: 1px solid #d9dcde !important;
    border-radius: var(--kfd-radius) !important;
    background: #fff !important;
    box-shadow: none !important;
    font-size: 16px !important;
    line-height: 44px;
    color: var(--kfd-text);
}
.ux-kfd .ux-kfd__loginstep .ux-kfd__fld > input:focus {
    outline: 0 !important;
    border-color: rgb(var(--kfd-link)) !important;
    box-shadow: 0 0 0 3px rgba(var(--kfd-link), .15) !important;
}
.ux-kfd .ux-kfd__loginstep .ux-kfd__fld--pass > input { padding-right: 84px !important; }
.ux-kfd .ux-kfd__loginstep button.ux-kfd__pass-toggle {
    position: absolute !important;
    right: 6px;
    bottom: 7px;
    width: auto;
    height: 32px;
    min-height: 0;
    margin: 0;
    padding: 0 10px !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: none !important;
    box-shadow: none !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 32px;
    text-transform: none !important;
    color: rgb(var(--kfd-link)) !important;
}
.ux-kfd .ux-kfd__loginstep .ux-kfd__loginstep-row { align-items: flex-end; }
.ux-kfd .ux-kfd__loginstep-go .ux-kfd__btn { height: 46px; line-height: 46px; padding: 0 22px; }

.ux-kfd button.ux-kfd__btn.ux-kfd__btn--ghost {
    background: #fff !important;
    color: rgb(var(--kfd-link)) !important;
    border: 1px solid rgb(var(--kfd-link)) !important;
}

/* why the password is asked for */
.ux-kfd__loginstep-info { margin: -4px 0 14px; font-size: 15px; line-height: 1.4; color: var(--kfd-text); }
.ux-kfd__loginstep-info:empty { display: none; }
