.address-page {
    width: min(100% - 40px, 1280px);
    margin: 0 auto;
    padding: 46px 15px 88px;
    color: #202124;
}

.address-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 26px;
    border-bottom: 1px solid #202124;
}

.address-head span {
    display: block;
    color: #dd4a2c;
    font-size: 14px;
    font-weight: 500;
}

.address-head h1 {
    margin: 4px 0 0;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.3;
}

.address-head p {
    margin: 8px 0 0;
    color: #6f7680;
    font-size: 14px;
    line-height: 1.5;
}

.address-head > a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    color: #5f6672;
    font-size: 14px;
    white-space: nowrap;
}

.address-layout {
    padding-top: 30px;
}

.address-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.address-section__head > div {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.address-section__head h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.35;
}

.address-section__head span {
    color: #7b838f;
    font-size: 14px;
}

.address-section__head b {
    font-weight: 600;
}

.address-add-button,
.address-state button,
.address-card__actions button,
.address-search button,
.address-form__actions button,
.address-dialog__close {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    border: 1px solid #d9dde5;
    border-radius: 6px;
    background: #ffffff;
    color: #202124;
    font-size: 14px;
    white-space: nowrap;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.address-add-button,
.address-form__actions button[type="submit"],
.address-state--empty button {
    border-color: #dd4a2c;
    background: #dd4a2c;
    color: #ffffff;
    font-weight: 600;
}

.address-page a:focus-visible,
.address-page button:focus-visible,
.address-dialog button:focus-visible,
.address-dialog input:focus-visible,
.address-dialog select:focus-visible {
    outline: 2px solid #dd4a2c;
    outline-offset: 3px;
}

.address-page button:active,
.address-dialog button:active {
    transform: scale(0.98);
}

.address-page button:disabled,
.address-dialog button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.address-limit,
.address-notice {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-left: 3px solid #d9dde5;
    background: #f7f8fa;
    color: #5f6672;
    font-size: 14px;
    line-height: 1.5;
}

.address-limit,
.address-notice.is-error {
    border-left-color: #dd4a2c;
}

.address-notice.is-success {
    border-left-color: #202124;
    color: #202124;
}

.address-loading {
    display: grid;
    gap: 0;
    border-top: 1px solid #202124;
}

.address-loading span {
    position: relative;
    display: block;
    height: 150px;
    overflow: hidden;
    border-bottom: 1px solid #e5e8ee;
    background: #f3f4f6;
}

.address-loading span::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 35%;
    background: rgba(255, 255, 255, 0.7);
    animation: address-loading 1.2s ease-in-out infinite;
}

@keyframes address-loading {
    from { opacity: 0; transform: translateX(-120%); }
    40% { opacity: 0.9; }
    to { opacity: 0; transform: translateX(380%); }
}

.address-state {
    padding: 54px 24px;
    border-top: 1px solid #202124;
    border-bottom: 1px solid #e5e8ee;
    text-align: center;
}

.address-state > i {
    display: block;
    margin-bottom: 14px;
    color: #8a929d;
    font-size: 30px;
}

.address-state strong {
    display: block;
    font-size: 18px;
    font-weight: 600;
}

.address-state p {
    margin: 8px 0 18px;
    color: #6f7680;
    font-size: 14px;
    line-height: 1.55;
}

.address-state--error > i {
    color: #dd4a2c;
}

.address-list {
    border-top: 1px solid #202124;
}

.address-card {
    padding: 24px 0;
    border-bottom: 1px solid #e5e8ee;
}

.address-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
}

.address-card__head > div:first-child {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.address-card__head strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.address-card__head span {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid #dd4a2c;
    border-radius: 999px;
    color: #dd4a2c;
    font-size: 12px;
    font-weight: 600;
}

.address-card__actions {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.address-card__actions .address-card__default {
    border-color: #202124;
}

.address-card__actions .address-card__delete {
    color: #6f7680;
}

.address-card__info {
    display: grid;
    gap: 9px;
    margin: 0;
}

.address-card__info > div {
    min-width: 0;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 14px;
}

.address-card__info dt {
    color: #8a929d;
    font-size: 14px;
}

.address-card__info dd {
    min-width: 0;
    margin: 0;
    color: #30343b;
    font-size: 15px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

body.is-address-dialog-open {
    overflow: hidden;
}

.address-dialog {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 24px;
}

.address-dialog__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: rgba(32, 33, 36, 0.48);
}

.address-dialog__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 580px);
    max-height: min(760px, calc(100dvh - 48px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #d9dde5;
    border-radius: 8px;
    background: #ffffff;
}

.address-dialog__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 24px 18px;
    border-bottom: 1px solid #e5e8ee;
}

.address-dialog__head h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.address-dialog__head p {
    margin: 5px 0 0;
    color: #6f7680;
    font-size: 14px;
    line-height: 1.5;
}

.address-dialog__close {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 24px;
}

.address-form {
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
}

.address-form__body {
    min-height: 0;
    display: grid;
    gap: 17px;
    overflow-y: auto;
    padding: 20px 24px;
}

.address-form__status {
    padding: 11px 13px;
    border-left: 3px solid #202124;
    background: #f7f8fa;
    color: #30343b;
    font-size: 14px;
    line-height: 1.5;
}

.address-form__status.is-error {
    border-left-color: #dd4a2c;
}

.address-field {
    min-width: 0;
    display: grid;
    gap: 8px;
    color: #202124;
    font-size: 14px;
}

.address-field > span,
.address-field > label {
    color: #5f6672;
    font-weight: 500;
    line-height: 1.4;
}

.address-field input,
.address-field select {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #d9dde5;
    border-radius: 6px;
    background: #ffffff;
    color: #202124;
    font-size: 16px;
    outline: 0;
}

.address-field input:focus,
.address-field select:focus {
    border-color: #dd4a2c;
}

.address-field input[aria-invalid="true"],
.address-field select[aria-invalid="true"] {
    border-color: #dd4a2c;
}

.address-field input::placeholder {
    color: #9aa1aa;
}

.address-field small {
    color: #dd4a2c;
    font-size: 13px;
    line-height: 1.45;
}

.address-search {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.address-check {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4b5563;
    font-size: 14px;
}

.address-check input {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    accent-color: #dd4a2c;
}

.address-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid #e5e8ee;
    background: #ffffff;
}

[hidden] {
    display: none !important;
}

@media (max-width: 768px) {
    .address-page {
        width: min(100% - 30px, 1280px);
        padding: 28px 0 76px;
    }

    .address-head {
        align-items: flex-start;
    }

    .address-head h1 {
        font-size: 26px;
    }

    .address-card__head {
        align-items: flex-start;
    }

    .address-card__actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .address-head {
        display: block;
    }

    .address-head > a {
        margin-top: 10px;
    }

    .address-section__head,
    .address-card__head {
        display: block;
    }

    .address-add-button {
        width: 100%;
        margin-top: 14px;
    }

    .address-card {
        padding: 21px 0;
    }

    .address-card__actions {
        justify-content: flex-start;
        margin-top: 14px;
    }

    .address-card__actions button {
        flex: 1 1 auto;
    }

    .address-card__info > div {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .address-dialog {
        align-items: end;
        padding: 12px;
    }

    .address-dialog__panel {
        max-height: calc(100dvh - 24px);
    }

    .address-dialog__head,
    .address-form__body,
    .address-form__actions {
        padding-right: 18px;
        padding-left: 18px;
    }

    .address-search {
        grid-template-columns: 1fr;
    }

    .address-search button {
        width: 100%;
    }

    .address-form__actions button {
        flex: 1 1 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .address-loading span::after {
        animation: none;
    }
}

/* mypage-sub 래핑 시 페이지 자체 폭 보정 (디자이너 내부 BEM 유지) */
.mypage-sub__content.address-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 0 24px;
}
