.favorite-modal {
    position: fixed;
    inset: 0;
    z-index: 10100;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100vh;
    height: 100dvh;

    padding: 16px;
    box-sizing: border-box;
}

/* 팝업 닫힌 상태 */
.favorite-modal[hidden] {
    display: none !important;
}

/* 어두운 배경 */
.favorite-modal-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(15, 23, 42, 0.6);
}

.favorite-modal-dialog {
    position: relative;
    z-index: 1;

    width: min(650px, 100%);
    max-height: min(85vh, 850px);

    display: flex;
    flex-direction: column;
    min-height: 0;

    padding: 15px;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;

    box-sizing: border-box;

    box-shadow: 0 16px 56px rgba(0, 0, 0, 0.2);
}

.favorite-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;
    padding-bottom: 12px;

    border-bottom: 1px solid #e5e7eb;

    flex-shrink: 0;
}

/* 찜 목록 제목 */
.favorite-modal-header h2 {
    display: flex;
    align-items: center;
    gap: 6px;

    margin: 0;

    color: #111827;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
}

/* 제목 별표 */
.favorite-modal-header h2 i {
    color: #e9a000;
    font-size: 16px;
}

/* 찜한 업체 개수 */
.favorite-modal-header h2 span {
    color: #6b7280;
    font-size: 13px;
    font-weight: 400;
}

/* 닫기 버튼 */
.favorite-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    padding: 5px;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: #555;

    font-size: 18px;
    cursor: pointer;

    flex-shrink: 0;
}

.favorite-modal-close:hover {
    background: #f3f4f6;
    color: #111;
}

.favorite-modal-list {
    flex: 1;
    min-height: 0;

    margin-top: 6px;

    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

/* 찜 목록이 없거나 로딩 중 */
.favorite-modal-empty {
    padding: 30px 10px;
    margin: 0;

    color: #6b7280;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.7;

    text-align: center;
}

.favorite-modal-item {
    display: flex;
    align-items: center;

    gap: 9px;
    padding: 10px 0;

    border-bottom: 1px solid #f1f3f5;

    min-width: 0;
}

.favorite-modal-item:last-child {
    border-bottom: 0;
}

/* 업체 상세보기 링크 */
.favorite-modal-link {
    display: flex;
    align-items: center;

    gap: 9px;

    flex: 1;
    min-width: 0;

    color: inherit;
    text-decoration: none;
}

.favorite-modal-link:hover .favorite-modal-name {
    color: #e86d0b;
}

.favorite-modal-link[aria-disabled="true"] {
    cursor: default;
}

.favorite-modal-img {
    display: block;

    width: 50px;
    height: 50px;

    flex: 0 0 50px;

    border-radius: 7px;

    object-fit: contain;
    object-position: center;

    background: #ffffff;
}

.favorite-modal-info {
    flex: 1;
    min-width: 0;
}

/* 광고 종류 */
.favorite-modal-type {
    display: block;

    margin-bottom: 3px;

    color: #6b7280;
    font-size: 11px;
    font-weight: 400;
}

/* 업체명 */
.favorite-modal-name {
    display: block;

    color: #222;
    font-size: 12px;
    font-weight: 700;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* 지역 */
.favorite-modal-region {
    display: block;

    margin-top: 3px;

    color: #6b7280;
    font-size: 11px;
    font-weight: 400;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.favorite-modal-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    padding: 6px 8px;

    border: 1px solid #e5e7eb;
    border-radius: 6px;

    background: #ffffff;
    color: #777;

    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;

    cursor: pointer;
    transition: 0.15s ease;
}

.favorite-modal-remove:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fff7f7;
}

.favorite-modal-remove:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* =========================================================
   태블릿 / 모바일
   1060px 이하
========================================================= */

@media (max-width: 1060px) {
    .favorite-modal {
        padding: 16px;
    }

    .favorite-modal-dialog {
        width: min(440px, 100%);
        max-height: calc(100dvh - 32px);

        overflow: hidden;
    }

    .favorite-modal-list {
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}

/* =========================================================
   모바일
   640px 이하
========================================================= */

@media (max-width: 640px) {
    .favorite-modal {
        padding: 15px;
    }

    .favorite-modal-dialog {
        width: 100%;
        max-height: calc(100dvh - 30px);

        padding: 14px;
        border-radius: 12px;
    }

    .favorite-modal-header {
        padding-bottom: 10px;
    }

    .favorite-modal-header h2 {
        font-size: 15px;
    }

    .favorite-modal-item {
        gap: 8px;
        padding: 9px 0;
    }

    .favorite-modal-img {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
    }

    .favorite-modal-name {
        font-size: 12px;
    }

    .favorite-modal-remove {
        padding: 6px 7px;
        font-size: 11px;
    }
}

/* =========================================================
   화면이 매우 작은 모바일
========================================================= */

@media (max-width: 380px) {
    .favorite-modal {
        padding: 12px;
    }

    .favorite-modal-dialog {
        max-height: calc(100dvh - 24px);
        padding: 12px;
    }

    .favorite-modal-item {
        gap: 6px;
    }

    .favorite-modal-img {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
    }

    .favorite-modal-remove {
        padding: 5px 6px;
    }
}
