/*
 * KingSoft / Osapa 2.2.4 migration — Phase 12
 * Account address cards, checkout shipping layout, visible payment selection,
 * and bank-transfer details.
 */

/* --------------------------------------------------------------------------
 * My Account > Addresses
 * The parent Osapa template uses old English strings and places the Edit link
 * outside the address box. Turn each address into one clean card and pin the
 * edit action to the card's top-right corner.
 * ----------------------------------------------------------------------- */
.woocommerce-account .woocommerce-MyAccount-content .u-columns.woocommerce-Addresses.col2-set.addresses,
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses.addresses {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 24px !important;
    width: 100% !important;
    margin: 32px 0 0 !important;
    padding: 0 !important;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses .woocommerce-Address,
.woocommerce-account .woocommerce-MyAccount-content .u-columns.woocommerce-Addresses > .woocommerce-Address {
    position: relative !important;
    float: none !important;
    clear: none !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 210px !important;
    margin: 0 !important;
    padding: 24px !important;
    border: 1px solid #e3e3e3 !important;
    border-radius: 2px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Address .title,
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Address header.title {
    margin: 0 90px 18px 0 !important;
    padding: 0 !important;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Address .title h3 {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Address address {
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Address > a.edit,
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Address .edit {
    position: absolute !important;
    top: 18px !important;
    right: 18px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 3 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 8px 13px !important;
    border: 0 !important;
    background: #ea0028 !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Address > a.edit:hover,
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Address > a.edit:focus-visible {
    background: #111b4c !important;
    color: #fff !important;
    text-decoration: none !important;
}

/* --------------------------------------------------------------------------
 * Checkout order review
 * Make the footer independent from the product table's narrow price column.
 * Shipping becomes one full-width block with its heading above the methods.
 * ----------------------------------------------------------------------- */
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot > tr {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot > tr:not(.shipping):not(.woocommerce-shipping-totals) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 120px !important;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot > tr:not(.shipping):not(.woocommerce-shipping-totals) > th,
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot > tr:not(.shipping):not(.woocommerce-shipping-totals) > td {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot > tr:not(.shipping):not(.woocommerce-shipping-totals) > td {
    text-align: right !important;
    white-space: nowrap !important;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping,
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot tr.shipping {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #e3e3e3 !important;
    border-top: 0 !important;
    box-sizing: border-box !important;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping > th,
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot tr.shipping > th {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 15px 18px 6px !important;
    border: 0 !important;
    text-align: left !important;
    box-sizing: border-box !important;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping > td,
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot tr.shipping > td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 4px 18px 16px !important;
    border: 0 !important;
    text-align: left !important;
    box-sizing: border-box !important;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table #shipping_method {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table #shipping_method li {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
    text-align: left !important;
    box-sizing: border-box !important;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table #shipping_method li:last-child {
    border-bottom: 0 !important;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table #shipping_method input[type="radio"] {
    order: 0 !important;
    flex: 0 0 auto !important;
    margin: 3px 0 0 !important;
    accent-color: #ea0028 !important;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table #shipping_method input[type="radio"] + label {
    order: 1 !important;
    flex: 1 1 auto !important;
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    line-height: 1.4 !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

/* --------------------------------------------------------------------------
 * Payment methods: make the chosen method unmistakable.
 * ----------------------------------------------------------------------- */
.woocommerce-checkout #payment.woocommerce-checkout-payment ul.payment_methods li.wc_payment_method {
    position: relative !important;
    margin: 4px 0 !important;
    padding: 10px 12px !important;
    border: 1px solid transparent !important;
    box-sizing: border-box !important;
}

.woocommerce-checkout #payment.woocommerce-checkout-payment ul.payment_methods li.wc_payment_method > input[type="radio"] {
    position: relative !important;
    top: 0 !important;
    display: inline-block !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 8px 0 0 !important;
    border: 2px solid #aaa !important;
    border-radius: 50% !important;
    background: #fff !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    vertical-align: -4px !important;
    box-shadow: none !important;
    cursor: pointer !important;
}

.woocommerce-checkout #payment.woocommerce-checkout-payment ul.payment_methods li.wc_payment_method > input[type="radio"]:checked {
    border-color: #ea0028 !important;
    background: #ea0028 !important;
    box-shadow: inset 0 0 0 4px #fff !important;
}

.woocommerce-checkout #payment.woocommerce-checkout-payment ul.payment_methods li.wc_payment_method > input[type="radio"]:checked + label {
    color: #ea0028 !important;
    font-weight: 700 !important;
}

.woocommerce-checkout #payment.woocommerce-checkout-payment ul.payment_methods li.wc_payment_method > input[type="radio"]:focus-visible {
    outline: 2px solid #ea0028 !important;
    outline-offset: 3px !important;
}

/* Bank data shown immediately when "Przelew bankowy" is selected. */
.woocommerce-checkout .kingsoft-bacs-checkout-details {
    margin-top: 12px !important;
    padding: 13px 15px !important;
    border-left: 3px solid #ea0028 !important;
    background: #fff !important;
    color: #333 !important;
    line-height: 1.55 !important;
}

.woocommerce-checkout .kingsoft-bacs-checkout-details strong {
    color: #111b4c !important;
}

.woocommerce-checkout .kingsoft-bacs-account-number {
    display: block !important;
    margin: 5px 0 2px !important;
    font-family: monospace !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: .2px !important;
    color: #111b4c !important;
}

@media (max-width: 767px) {
    .woocommerce-account .woocommerce-MyAccount-content .u-columns.woocommerce-Addresses.col2-set.addresses,
    .woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses.addresses {
        grid-template-columns: 1fr !important;
    }

    .woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses .woocommerce-Address {
        min-height: 0 !important;
    }

    .woocommerce-checkout .woocommerce-checkout-review-order-table tfoot > tr:not(.shipping):not(.woocommerce-shipping-totals) {
        grid-template-columns: minmax(0, 1fr) 95px !important;
    }
}
