.od-addr-card {
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #e4ebf2;
    border-radius: 12px;
}

.od-addr-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef3f8;
}

.od-addr-card-title {
    display: inline-flex;
    align-items: center;
    gap: 0;
    color: #003C71;
    font-size: 1rem;
    font-weight: 800;
}

.od-ship-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef3f8;
    color: #111;
    font-size: .76rem;
    font-weight: 800;
    white-space: nowrap;
}

.od-ship-tag.is-campus {
    background: #bdffc1;
}

.od-ship-tag.is-post {
    background: #ffc3c3;
}

.od-addr-card.is-editable .checkout-address-selected {
    margin-top: 0;
}

.od-addr-actions {
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid #eef3f8;
}

.od-addr-hint {
    margin: 10px 0 0;
    color: #6b7c8d;
    font-size: .82rem;
    line-height: 1.45;
}

.od-addr-hint a {
    color: #003C71;
    font-weight: 700;
    text-decoration: none;
}

.od-addr-hint a:hover {
    text-decoration: underline;
}

.checkout-address-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkout-add-btn,
.checkout-pick-btn {
    border: 1px solid #cdddea;
    background: #f8fbfe;
    color: #245b80;
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 600;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.checkout-add-btn.is-outline {
    background: #fff;
    color: #003C71;
    border: 1px solid #c5d6e8;
}

.checkout-add-btn:hover,
.checkout-pick-btn:hover {
    filter: brightness(1.08);
}

.checkout-add-btn.is-outline:hover {
    background: #eef5fb;
    filter: none;
}

.checkout-selected-card {
    min-width: 0;
    overflow: hidden;
    padding: 0;
    background: transparent;
}

.checkout-selected-card .addr-card-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    row-gap: 6px;
}

.checkout-selected-card .addr-card-row strong {
    min-width: 0;
    color: #003C71;
    font-weight: 700;
}

.checkout-selected-card>p {
    margin: 8px 0 0;
    color: #5b6b7c;
    font-size: .86rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.checkout-address-list {
    display: grid;
    gap: 10px;
    max-height: min(60vh, 520px);
    overflow: auto;
    padding-right: 4px;
}

.checkout-address-card {
    display: block;
    cursor: pointer;
}

.checkout-address-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkout-address-inner {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    border: 1px solid #e4ebf2;
    border-radius: 10px;
    padding: 14px 16px;
    background: #fff;
    transition: border-color 0.16s ease, background 0.16s ease;
}

.checkout-address-card:has(input:checked) .checkout-address-inner,
.checkout-address-card.is-selected .checkout-address-inner {
    border-color: #003C71;
    background: #f8fbff;
    box-shadow: 0 0 0 2px rgba(0, 60, 113, 0.08);
}

.checkout-address-main {
    min-width: 0;
    flex: 1 1 auto;
}

.checkout-address-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.checkout-address-name strong {
    min-width: 0;
    color: #003C71;
    font-size: .95rem;
    font-weight: 700;
}

.checkout-address-phone {
    display: inline-flex;
    align-items: center;
    color: #6b7c8d;
    font-size: .78rem;
    white-space: nowrap;
}

.checkout-address-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex: 0 0 auto;
}

.checkout-address-default {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #fff8df;
    color: #8a6b00;
    font-size: .72rem;
    font-weight: 700;
}

.checkout-address-type {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}

.checkout-address-type.is-campus {
    background: #e8f7e9;
    color: #28733a;
}

.checkout-address-type.is-post {
    background: #fff0f0;
    color: #a44747;
}

.checkout-address-main>p {
    margin: 7px 0 0;
    color: #5b6b7c;
    font-size: .84rem;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.addr-card-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.addr-card-phone {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    color: #8099ab;
    font-size: .78rem;
    font-weight: 400;
    white-space: nowrap;
}

.checkout-empty-address {
    text-align: center;
    color: #6b7c8d;
    padding: 14px;
}

.checkout-address-placeholder {
    border: 1px dashed #d5e1ee;
    border-radius: 14px;
    padding: 18px 16px;
    text-align: center;
    color: #6b7c8d;
    background: #f7fafc;
    font-size: 0.9rem;
}

.checkout-empty-address i {
    display: block;
    font-size: 1.4rem;
    margin-bottom: 6px;
    color: #9aacbf;
}

.addr-type-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.addr-type {
    border: 1px solid #d5e1ee;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
    font-weight: 600;
    color: #003C71;
    min-width: 0;
    width: 100%;
}

.addr-type:has(input:checked) {
    border-color: #003C71;
    background: #eef5fb;
}

/* Shared address modal appearance for profile and buy-now. */
#addrModal .addr-type,
#bnAddrModal .addr-type,
#odAddrModal .addr-type,
#odGuestAddrModal .addr-type {
    align-items: flex-start;
    padding: 12px;
    gap: 10px;
}

#addrModal .addr-type input,
#bnAddrModal .addr-type input,
#odAddrModal .addr-type input,
#odGuestAddrModal .addr-type input {
    margin-top: 3px;
    flex: 0 0 auto;
}

#addrModal .addr-type i,
#bnAddrModal .addr-type i,
#odAddrModal .addr-type i,
#odGuestAddrModal .addr-type i {
    width: 28px;
    margin-top: 2px;
    text-align: center;
    flex: 0 0 28px;
}

#addrModal .addr-type strong,
#addrModal .addr-type small,
#bnAddrModal .addr-type strong,
#bnAddrModal .addr-type small,
#odAddrModal .addr-type strong,
#odAddrModal .addr-type small,
#odGuestAddrModal .addr-type strong,
#odGuestAddrModal .addr-type small {
    display: block;
}

#addrModal .addr-type small,
#bnAddrModal .addr-type small,
#odAddrModal .addr-type small,
#odGuestAddrModal .addr-type small {
    margin-top: 2px;
    color: #5b6b7c;
    font-size: .8rem;
    font-weight: 400;
    line-height: 1.4;
}

#addrModal .form-label,
#bnAddrModal .form-label,
#odAddrModal .form-label,
#odGuestAddrModal .form-label {
    color: #355064;
    font-weight: 600;
}

#addrModal .form-control,
#addrModal .form-select,
#bnAddrModal .form-control,
#bnAddrModal .form-select,
#odAddrModal .form-control,
#odAddrModal .form-select,
#odGuestAddrModal .form-control,
#odGuestAddrModal .form-select {
    min-height: 42px;
    border-radius: 10px;
}

.addr-default-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #355064;
    font-weight: 600;
}

.btn-addr-save {
    background: #003C71;
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-weight: 700;
    padding: 8px 18px;
}

.btn-addr-save:hover {
    filter: brightness(1.08);
    color: #fff;
}

#odAddrModal .od-addr-modal-close,
#odAddrModal .od-addr-modal-save {
    min-width: 118px;
}

#odAddrModal .od-addr-modal-close {
    border-color: #6c757d;
    background: #6c757d;
    color: #fff;
}

#odAddrModal .od-addr-modal-close:hover {
    border-color: #5c636a;
    background: #5c636a;
    color: #fff;
}

#odAddrPickModal .od-addr-modal-close {
    border-radius: 10px;
    padding: 8px 16px;
    font-size: .88rem;
    font-weight: 600;
}

#odGuestAddrModal .od-addr-modal-close,
#odGuestAddrModal .od-addr-modal-save {
    min-width: 118px;
}

#odGuestAddrModal .od-addr-modal-save:hover {
    background: #00284d;
    color: #fff;
    filter: none;
}

.buynow-addr-form .form-control,
.buynow-addr-form .form-select,
#odAddrForm .form-control,
#odAddrForm .form-select,
#odGuestAddrForm .form-control,
#odGuestAddrForm .form-select {
    border-radius: 10px;
    min-height: 42px;
    border-color: #d6e3ef;
    background: #fbfdff;
}

.buynow-addr-form .form-label,
#odAddrForm .form-label,
#odGuestAddrForm .form-label {
    color: #355064;
    font-weight: 600;
    font-size: .88rem;
}

.js-od-new-postal.is-off,
.js-od-guest-postal.is-off {
    display: none !important;
}

/* เปิด modal ก่อนหน้าแบบทันทีหลังปิด modal เพิ่มที่อยู่ */
.modal-no-animation,
.modal-no-animation .modal-dialog {
    transition: none !important;
}

.modal-no-animation .modal-dialog {
    transform: none !important;
}

@media (max-width: 576px) {
    .addr-type-row {
        grid-template-columns: minmax(0, 1fr);
    }

    #addrModal .addr-type,
    #bnAddrModal .addr-type,
    #odAddrModal .addr-type,
    #odGuestAddrModal .addr-type {
        padding: 10px;
        gap: 8px;
    }

    #addrModal .addr-type i,
    #bnAddrModal .addr-type i,
    #odAddrModal .addr-type i,
    #odGuestAddrModal .addr-type i {
        width: 22px;
        flex-basis: 22px;
        font-size: .9rem;
    }

    #addrModal .addr-type strong,
    #bnAddrModal .addr-type strong,
    #odAddrModal .addr-type strong,
    #odGuestAddrModal .addr-type strong {
        font-size: .88rem;
    }

    #addrModal .addr-type small,
    #bnAddrModal .addr-type small,
    #odAddrModal .addr-type small,
    #odGuestAddrModal .addr-type small {
        font-size: .74rem;
    }

    .checkout-selected-card .addr-card-badges {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }

    .checkout-address-inner {
        gap: 10px;
        padding: 12px;
    }

    .checkout-address-name {
        gap: 5px;
    }

    .checkout-address-badges {
        gap: 4px;
    }

    .checkout-address-type {
        padding: 4px 7px;
        font-size: .68rem;
    }

    .checkout-address-default {
        min-height: 22px;
        padding: 4px 7px;
        font-size: .68rem;
    }

    .checkout-address-main>p {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}