/* Układ metod dostawy w klasycznym checkout WooCommerce / KALA. */
.wr-checkout .wr-checkout-summary ul#shipping_method {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.wr-checkout .wr-checkout-summary ul#shipping_method li {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 66px;
    padding: 8px 0;
    border: 0;
    text-indent: 0 !important;
}

.wr-checkout .wr-checkout-summary ul#shipping_method input[type="radio"] {
    display: block !important;
    position: static !important;
    inset: auto !important;
    grid-column: 1 !important;
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 2px solid #aaa !important;
    border-radius: 50% !important;
    background: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
    appearance: none;
    -webkit-appearance: none;
    clip: auto !important;
    clip-path: none !important;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: auto !important;
    cursor: pointer;
}

.wr-checkout .wr-checkout-summary ul#shipping_method input[type="radio"]:checked {
    border-color: var(--wr-checkout-accent, #ff4081) !important;
    background: radial-gradient(circle, var(--wr-checkout-accent, #ff4081) 0 6px, #fff 7px) !important;
}

.wr-checkout .wr-checkout-summary ul#shipping_method label {
    display: block;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0 !important;
    text-indent: 0 !important;
}

/* Motyw Beaux rysuje własne radio na etykiecie. W checkout KALA używamy
 * widocznego inputa, więc ukrywamy ten dodatkowy znacznik. */
.wr-checkout .wr-checkout-summary ul#shipping_method input[type="radio"] + label::before {
    display: none !important;
    content: none !important;
}

/* Przy jednej metodzie WooCommerce używa ukrytego inputa zamiast radio. */
.wr-checkout .wr-checkout-summary ul#shipping_method input[type="hidden"] + label {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
}

.wr-checkout .wr-checkout-summary ul#shipping_method input[type="hidden"] + label::before {
    display: block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--wr-checkout-accent, #ff4081);
    border-radius: 50%;
    background: radial-gradient(circle, var(--wr-checkout-accent, #ff4081) 0 6px, #fff 7px);
    content: "";
}

.wr-checkout .kala-shipping-method {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    width: 100%;
    color: var(--wr-checkout-right-text, #111);
    text-indent: 0 !important;
}

.wr-checkout .kala-shipping-method__logo {
    display: flex;
    flex: 0 0 70px;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 44px;
}

.wr-checkout .kala-shipping-method__logo img {
    display: block;
    width: auto;
    height: auto;
    max-width: 70px;
    max-height: 44px;
    margin: 0;
    object-fit: contain;
}

.wr-checkout .kala-shipping-method__name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 16px;
    line-height: 1.25;
    white-space: normal;
}

.wr-checkout .kala-shipping-method__price {
    flex: 0 0 auto;
    margin-left: auto;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    text-align: right;
    white-space: nowrap;
}

.wr-checkout .kala-shipping-method__price .amount {
    display: inline !important;
    margin-left: 0 !important;
}

.wr-checkout .kala-shipping-method.is-free .kala-shipping-method__price {
    color: var(--wr-checkout-accent, #ff4081) !important;
    font-weight: 700 !important;
}

.wr-checkout .kala-point-picker {
    display: none;
    width: 100%;
    margin: 8px 0 12px;
}

.wr-checkout .kala-point-picker__label {
    display: block;
    margin-bottom: 8px;
    color: var(--wr-checkout-right-text, #111);
    font-size: 13px;
    line-height: 1.4;
}

.wr-checkout .kala-point-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 50px;
    padding: 10px 14px !important;
    border: 1px solid var(--wr-checkout-border, #d2d2d2) !important;
    border-radius: 7px !important;
    background: #fff !important;
    color: var(--wr-checkout-right-text, #111) !important;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    text-align: left;
}

.wr-checkout .kala-point-field__value {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wr-checkout .kala-point-field__arrow {
    flex: 0 0 auto;
    color: var(--wr-checkout-accent, #ff4081);
    font-size: 18px;
}

.wr-checkout .kala-point-map {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
    min-height: auto;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--wr-checkout-right-text, #111) !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
    width: auto;
}

.wr-checkout .kala-point-map span {
    color: var(--wr-checkout-accent, #ff4081);
    font-size: 17px;
}

.wr-checkout .kala-point-field:hover,
.wr-checkout .kala-point-field:focus {
    border-color: var(--wr-checkout-accent, #ff4081) !important;
    background: #fff !important;
}

/* Lista i mapa punktów w tym samym modalu. */
.kala-point-view-switch {
    display: flex;
    gap: 8px;
    margin: -8px 0 14px;
}

.kala-point-search-hint {
    margin: -12px 0 18px;
    color: #555;
    font-size: 13px;
    line-height: 1.4;
}

.kala-point-search-hint[hidden] {
    display: none !important;
}

.kala-point-view-button {
    min-width: 110px;
    min-height: 42px;
    padding: 8px 20px !important;
    border: 1px solid #ff4081 !important;
    border-radius: 7px !important;
    background: #fff !important;
    color: #111 !important;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.kala-point-view-button.is-active,
.kala-point-view-button:hover,
.kala-point-view-button:focus {
    background: #ff4081 !important;
    color: #fff !important;
}

.kala-point-browser {
    min-height: 300px;
}

.kala-point-browser [hidden] {
    display: none !important;
}

.kala-point-browser .kala-point-results {
    width: 100%;
    min-height: 300px;
    max-height: 42vh;
}

.kala-point-map-canvas {
    width: 100%;
    height: 360px;
    min-height: 300px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    background: #f3f3f3;
    overflow: hidden;
}

.kala-point-map-canvas .leaflet-control-zoom a {
    color: #111 !important;
    text-decoration: none !important;
}

.kala-point-map-canvas .leaflet-control-attribution {
    font-size: 10px;
}

.kala-point-dialog.is-map-view {
    height: calc(100vh - 30px);
}

.kala-point-dialog.is-map-view .kala-point-browser {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

.kala-point-dialog.is-map-view .kala-point-map-canvas {
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
}

.kala-inpost-geowidget-wrap[hidden] {
    display: none !important;
}

.kala-inpost-geowidget-wrap {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 320px;
    overflow: hidden;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
}

.kala-inpost-geowidget-wrap inpost-geowidget {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* Iframe oficjalnego Geowidgetu oblicza wysokość procentowo. Dialog oraz jego
 * bezpośredni kontener muszą więc mieć określoną wysokość, a nie tylko min-height. */
.kala-point-dialog.is-official-inpost {
    height: calc(100vh - 30px);
}

.kala-point-dialog.is-official-inpost .kala-point-search,
.kala-point-dialog.is-official-inpost .kala-point-view-switch,
.kala-point-dialog.is-official-inpost .kala-point-browser {
    display: none !important;
}

@media (max-width: 480px) {
    .wr-checkout .kala-shipping-method {
        gap: 10px;
    }

    .wr-checkout .kala-shipping-method__logo {
        flex-basis: 62px;
        width: 62px;
        height: 40px;
    }

    .wr-checkout .kala-shipping-method__logo img {
        max-width: 62px;
        max-height: 40px;
    }

    .wr-checkout .kala-shipping-method__name,
    .wr-checkout .kala-shipping-method__price {
        font-size: 14px;
    }

    .kala-point-view-switch {
        margin-top: 0;
    }

    .kala-point-view-button {
        flex: 1 1 50%;
        min-width: 0;
    }

    .kala-point-browser,
    .kala-point-browser .kala-point-results,
    .kala-point-map-canvas {
        min-height: 280px;
    }

    .kala-point-map-canvas {
        height: 42vh;
    }

    .kala-point-dialog.is-official-inpost {
        height: 100vh;
    }

    .kala-point-dialog.is-map-view {
        height: 100vh;
    }

    .kala-inpost-geowidget-wrap {
        min-height: 280px;
    }
}
