.shipit24-shipping-options {
    margin-bottom: 20px;
}

.shipit24-shipping-select,
#shipit24_locker_select {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
}

.shipit24-lockers-wrapper {
    position: relative;
}

/* Once a locker is picked, the search input gives way to the selected-locker
 * card below it — re-shown only via the card's × (.shipit24-remove-locker). */
.shipit24-lockers-container.has-selection .shipit24-lockers-wrapper {
    display: none;
}

.shipit24-city-combobox {
    margin-bottom: 8px;
}

/* Vendored Select2 (src/assets/js/vendor/select2.min.js) powers both the
 * city picker and the locker search. Scoped to
 * .shipit24-lockers-wrapper/.shipit24-city-combobox rather than the bare
 * Select2 classes so they don't leak into other Select2 instances WC itself
 * may render elsewhere on the same checkout/cart page.
 *
 * Everything below is expressed relative to the control's own font-size and
 * line-height rather than the fixed 38/40px values this block used to carry.
 * Client themes override the checkout font-size, the input padding and —
 * most destructively — `button { ... }`, and the clear "x" is a real
 * <button> in Select2 4.1 that Select2 merely floats right. A theme button
 * rule (display:block, width:100%, padding:1em, min-height) turns that float
 * into its own line, which is why the "x" lands in a different wrong place
 * on every shop. The three custom properties are the per-theme tuning
 * points; nothing else here needs touching. */
.shipit24-lockers-wrapper,
.shipit24-city-combobox {
    /* Floor, not a lock: a theme with a bigger font-size grows the control
     * instead of clipping its own text. ~40px matches the inputs most
     * WooCommerce themes render next to it. */
    --shipit24-control-min-height: 40px;
    /* Select2's own arrow box is a fixed 20px pinned to the right edge. */
    --shipit24-arrow-width: 20px;
    /* Clear "x" hit area — in ems so it tracks the theme's font-size. */
    --shipit24-clear-width: 1.8em;
}

.shipit24-lockers-wrapper .select2-container--default .select2-selection--single,
.shipit24-city-combobox .select2-container--default .select2-selection--single {
    /* Flex + min-height centres the text vertically without a line-height
     * that has to be kept equal to the box height to look right. */
    display: flex;
    align-items: center;
    position: relative;
    height: auto;
    min-height: var(--shipit24-control-min-height);
    border: 1px solid #ddd;
    border-radius: 4px;
}

.shipit24-lockers-wrapper .select2-container--default .select2-selection--single .select2-selection__rendered,
.shipit24-city-combobox .select2-container--default .select2-selection--single .select2-selection__rendered {
    flex: 1 1 auto;
    /* Required for the ellipsis: a flex item won't shrink below its content
     * width without it, so a long locker name would overflow instead. */
    min-width: 0;
    line-height: 1.4;
    padding-top: 4px;
    padding-bottom: 4px;
    padding-left: 12px;
    padding-right: var(--shipit24-arrow-width);
}

/* Select2 adds .select2-selection--clearable once the control is filled and
 * the "x" exists — only then does the text need to keep clear of it too. */
.shipit24-lockers-wrapper .select2-container--default .select2-selection--single.select2-selection--clearable .select2-selection__rendered,
.shipit24-city-combobox .select2-container--default .select2-selection--single.select2-selection--clearable .select2-selection__rendered {
    padding-right: calc(var(--shipit24-arrow-width) + var(--shipit24-clear-width));
}

.shipit24-lockers-wrapper .select2-container--default .select2-selection--single .select2-selection__arrow,
.shipit24-city-combobox .select2-container--default .select2-selection--single .select2-selection__arrow {
    /* Stretch between the borders instead of Select2's fixed 26px box offset
     * 1px from the top, so the caret stays centred at any control height. */
    top: 0;
    bottom: 0;
    height: auto;
}

/* Take the "x" out of flow and anchor it to the selection box: its position
 * then depends only on the box, not on whatever metrics the theme gave
 * <button>. The rest of the declarations neutralise those metrics. */
.shipit24-lockers-wrapper .select2-container--default .select2-selection--single .select2-selection__clear,
.shipit24-city-combobox .select2-container--default .select2-selection--single .select2-selection__clear {
    position: absolute;
    top: 0;
    bottom: 0;
    right: var(--shipit24-arrow-width);
    left: auto;
    float: none;
    z-index: 1;

    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--shipit24-clear-width);
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 0;

    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    outline-offset: -2px;

    font: inherit;
    font-weight: 700;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    text-indent: 0;
    text-shadow: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    transform: none;
    transition: none;
}

.shipit24-lockers-wrapper .select2-container--default .select2-selection--single .select2-selection__clear:hover,
.shipit24-lockers-wrapper .select2-container--default .select2-selection--single .select2-selection__clear:focus,
.shipit24-city-combobox .select2-container--default .select2-selection--single .select2-selection__clear:hover,
.shipit24-city-combobox .select2-container--default .select2-selection--single .select2-selection__clear:focus {
    background: none;
    color: inherit;
    opacity: 1;
    transform: none;
}

/* The glyph lives in a <span aria-hidden="true"> that themes styling button
 * children (icon wrappers) can resize or offset. */
.shipit24-lockers-wrapper .select2-container--default .select2-selection--single .select2-selection__clear > span,
.shipit24-city-combobox .select2-container--default .select2-selection--single .select2-selection__clear > span {
    display: block;
    font-size: 1.1em;
    line-height: 1;
    margin: 0;
    padding: 0;
}

/* Select2's own RTL rules only flip the float we just dropped, so mirror the
 * two absolutely-positioned controls and the text padding here. */
.shipit24-lockers-wrapper .select2-container--default[dir='rtl'] .select2-selection--single .select2-selection__clear,
.shipit24-city-combobox .select2-container--default[dir='rtl'] .select2-selection--single .select2-selection__clear {
    right: auto;
    left: var(--shipit24-arrow-width);
}

.shipit24-lockers-wrapper .select2-container--default[dir='rtl'] .select2-selection--single .select2-selection__rendered,
.shipit24-city-combobox .select2-container--default[dir='rtl'] .select2-selection--single .select2-selection__rendered {
    padding-left: var(--shipit24-arrow-width);
    padding-right: 12px;
}

.shipit24-lockers-wrapper .select2-container--default[dir='rtl'] .select2-selection--single.select2-selection--clearable .select2-selection__rendered,
.shipit24-city-combobox .select2-container--default[dir='rtl'] .select2-selection--single.select2-selection--clearable .select2-selection__rendered {
    padding-left: calc(var(--shipit24-arrow-width) + var(--shipit24-clear-width));
    padding-right: 12px;
}

/* Locker results dropdown: dropdownCssClass:'shipit24-locker-dropdown' (set
 * in initLockerSelect()) scopes these to the locker picker only, since its
 * results are rich pre-rendered .shipit24-locker rows (not plain text like
 * the city picker's), which already carry their own padding/hover styling —
 * Select2's default 6px option padding and highlight color would otherwise
 * double up with / clash against them.
 *
 * !important is needed here: Select2's own stylesheet is enqueued after
 * shipit24-styles.css (it's only registered once the city/locker picker
 * actually needs it), so its same-specificity .select2-results__option--
 * highlighted.select2-results__option--selectable rule (background
 * #5897fb + white text) would otherwise win the cascade tie by load
 * order and leave white-on-transparent (invisible) hover text. */
.shipit24-locker-dropdown .select2-results__option {
    padding: 0 !important;
}

.shipit24-locker-dropdown .select2-results__option--highlighted {
    background-color: #f9f9f9 !important;
    color: inherit !important;
}

.shipit24-selected-locker {
    margin-top: 4px;
}

.shipit24-selected-locker,
.shipit24-lockers-container {
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
    text-indent: 0;
}

.shipit24-locker {
    font-size: 16px;
    line-height: 1.5;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    text-align: left;
}

.shipit24-locker p,
.shipit24-lockers-container p {
    margin: 0;
}

.shipit24-locker:hover {
    background: #f9f9f9;
}

.shipit24-locker__price,
.shipit24-selected-locker__price {
    font-weight: 700;
    font-size: 16px;
    color: #000;
}

.shipit24-selected-locker__name,
.shipit24-locker__name {
    margin-top: 4px;
    font-size: 14px;
    max-width: 139px;
}

* + .shipit24-lockers-container {
    margin-top: 8px;
}

.shipit24-lockers-container {
    position: relative;
    padding-bottom: 8px;
    display: none;
}

.wc-block-components-shipping-rates-control__package
    + .shipit24-lockers-container {
    margin-top: 8px;
}

.shipit24-selected-locker__title,
.shipit24-locker__title {
    text-align: left;
    font-family: Arial, sans-serif;
    font-weight: 700;
    font-size: 18px;
    margin: 0;
}

.shipit24-selected-locker__inner {
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #417f64;
    background-color: #f2f9f4;
    position: relative;
}

.shipit24-remove-locker {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    user-select: none;
}

.shipit24-remove-locker:hover {
    opacity: 0.6;
}

.shipit24-locker__meta,
.shipit24-selected-locker__meta {
    margin-top: 8px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.shipit24-locker__address,
.shipit24-selected-locker__address {
    margin-top: 4px;
    font-size: 12px;
}

.shipit24-locker__city,
.shipit24-selected-locker__city {
    margin-top: 2px;
    font-size: 12px;
    opacity: 0.6;
}

.shipit24-selected-locker__distance,
.shipit24-locker__distance {
    opacity: 0.6;
    font-size: 14px;
}

@media (min-width: 960px) {
    .woocommerce-checkout form.checkout {
        grid-template-columns: 2fr 2fr;
        grid-column-gap: 30px;
    }
}

.woocommerce label[for^='shipping_method_'] {
    min-width: 225px;
    display: block;
}

.woocommerce
    input[name^='shipping_method']:checked
    ~ .shipit24-lockers-container,
.shipit24-lockers-container.is-open {
    display: block;
}
