@charset "utf-8";

/* ==========================================================================
   달림가이드 (op-runga / 런가) 모던 디자인 토큰 & 스타일시트
   - Primary Accent : Rose-600 (#e11d48)
   - Secondary CTA  : Slate-600 / Ghost
   - Success Badge  : Emerald-600 (#059669)
   - Neutral Scale  : Slate (50, 100, 200, 500, 700, 900)
   - Responsive     : Desktop 5열/4열 -> Tablet 3열 -> Mobile 2열 고정
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 상단 필터 네비게이션 (지역 / 업종 필터)
   -------------------------------------------------------------------------- */
.main-top-header {
    margin-bottom: 16px;
}

.main-top-header .list-main {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 12px;
}

/* 필터 알약(Pill) 기본 스타일 - 인체공학 40px 터치 타깃 */
.main-top-header .addr-list .item,
.main-top-header .comptype-list .item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 6px 14px;
    color: #334155;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.main-top-header .addr-list .item:hover,
.main-top-header .comptype-list .item:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
    transform: translateY(-1px);
}

/* 활성(Active) 필터 토큰 - WCAG 준수 Rose-600 */
.main-top-header .addr-list .item.active,
.main-top-header .comptype-list .item.active {
    background: #e11d48;
    color: #ffffff;
    border-color: #e11d48;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.3);
}

/* 세부 지역(구/군) 서브 필터 */
.addr-sub-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.addr-sub-list .item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 4px 12px;
    font-size: 0.9rem;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.addr-sub-list .item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.addr-sub-list .item.active {
    background: #be123c;
    color: #ffffff;
    border-color: #be123c;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   2. 메인 업체 카드 그리드 (Card Grid)
   -------------------------------------------------------------------------- */
.main-comp-list-wrap {
    width: 100%;
}

.main-comp-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin: -6px;
}

/* 데스크톱 기본: 5열 (20%) */
.main-comp-list .item {
    width: 20%;
    padding: 6px;
    box-sizing: border-box;
    display: block;
    position: relative;
}

/* 고대비 출처 배지 (오피가이드/크롤링) */
.main-comp-list .item.opga:before {
    content: "오피가이드";
    display: inline-block;
    position: absolute;
    top: 14px;
    left: 14px;
    color: #ffffff;
    background: #059669; /* Emerald-600: 명도비 4.5:1 이상 */
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 카드 컨테이너: Elevation & Smooth Hover */
.main-comp-list .item .item-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}

.main-comp-list .item .item-inner:hover {
    transform: translateY(-3px);
    border-color: #cbd5e1;
    box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* 썸네일 영역 (4:3 비율 고정) */
.main-comp-list .item .thumb {
    width: 100%;
    padding-bottom: 75%;
    position: relative;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #f1f5f9;
    margin-bottom: 10px;
}

.main-comp-list .item .thumb .img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.main-comp-list .item .thumb .img a {
    display: block;
    width: 100%;
    height: 100%;
}

.main-comp-list .item .thumb .img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.main-comp-list .item .item-inner:hover .thumb .img img {
    transform: scale(1.04);
}

/* 카드 텍스트 정보 및 타이포그래피 */
.main-comp-list .item .name {
    margin-bottom: 4px;
}

.main-comp-list .item .name .meta-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.main-comp-list .item .name .addr,
.main-comp-list .item .name .type {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b; /* Slate-500: 가독성 확보 */
}

.main-comp-list .item .name .addr:after {
    content: "·";
    margin-left: 4px;
    color: #94a3b8;
}

.main-comp-list .item .name .cmpname {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a; /* Slate-900 */
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1.35;
}

/* 전화번호 안내 */
.main-comp-list .item .contact {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    padding: 2px 0 8px 0;
    letter-spacing: -0.2px;
}

/* --------------------------------------------------------------------------
   3. CTA 인터랙션 버튼 (Primary vs Secondary)
   -------------------------------------------------------------------------- */
.main-comp-list .item .btn-wrap {
    display: flex;
    gap: 6px;
    margin-top: auto;
}

.main-comp-list .item .btn-wrap .btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

/* 보조 버튼: 업소정보 (Secondary Outline) */
.main-comp-list .item .btn-wrap .btn.btn-info {
    width: 44%;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.main-comp-list .item .btn-wrap .btn.btn-info:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* 주력 전환 버튼: 전화걸기 (Primary Rose-600) */
.main-comp-list .item .btn-wrap .btn.btn-call {
    width: 56%;
    background: #e11d48;
    color: #ffffff;
    border: 1px solid #e11d48;
    box-shadow: 0 2px 4px rgba(225, 29, 72, 0.2);
}

.main-comp-list .item .btn-wrap .btn.btn-call:hover {
    background: #be123c;
    border-color: #be123c;
    box-shadow: 0 3px 6px rgba(225, 29, 72, 0.3);
}

/* --------------------------------------------------------------------------
   4. 모달 팝업 다이얼로그 (Modal Window)
   -------------------------------------------------------------------------- */
.cmp_modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
    background-color: rgba(15, 23, 42, 0.65); /* Backdrop Blur 효과와 조화 */
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.cmp_modal .cmp_modal_inner {
    margin: 0 auto;
    width: calc(100% - 32px);
    max-width: 800px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 16px;
    overflow: hidden;
}

.cmp_modal .cmp_modal_inner .modal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.cmp_modal .cmp_modal_inner .modal-top .tab {
    display: flex;
    gap: 12px;
}

.cmp_modal .cmp_modal_inner .modal-top .tab .tmenu {
    padding: 6px 12px;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: #64748b;
    transition: all 0.15s ease;
}

.cmp_modal .cmp_modal_inner .modal-top .tab .tmenu.active {
    border-bottom: 2px solid #e11d48;
    color: #0f172a;
}

.cmp_modal .cmp_modal_inner .modal-top .tab-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cmp_modal .cmp_modal_inner .modal-top .tab-right .adm-tab .tmenu.modi {
    padding: 4px 10px;
    font-size: 0.85rem;
    color: #e11d48;
    font-weight: 600;
    cursor: pointer;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.cmp_modal .cmp_modal_inner .modal-top .tab-right .adm-tab .tmenu.modi:hover {
    background: #ffe4e6;
}

/* 닫기 버튼 - 인체공학 44x44px 터치 히트박스 */
.tab-right .close {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: background 0.15s ease;
}

.tab-right .close:hover {
    background: #e2e8f0;
}

.tab-right .close:before,
.tab-right .close:after {
    position: absolute;
    content: "";
    height: 2px;
    width: 18px;
    top: 50%;
    left: 11px;
    background-color: #334155;
    transition: background 0.15s ease;
}

.tab-right .close:before {
    transform: rotate(45deg);
}

.tab-right .close:after {
    transform: rotate(-45deg);
}

/* 모달 본문 콘텐츠 */
.cmp_modal .cmp_modal_inner .modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 12px;
    padding: 4px;
    background-color: #ffffff;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    overflow-x: hidden;
}

.cmp_modal .cmp_modal_inner .modal-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* --------------------------------------------------------------------------
   5. 하단 더보기 버튼
   -------------------------------------------------------------------------- */
.index-btm-btn {
    margin: 28px 0 36px 0;
    text-align: center;
}

.index-btm-btn .index-next-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 180px;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: #334155; /* Slate-700 */
    border: 0;
    padding: 10px 24px;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.index-btm-btn .index-next-btn:hover {
    background: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
}

/* --------------------------------------------------------------------------
   6. 반응형 브레이크포인트 (반응형 2열 모바일 최적화)
   -------------------------------------------------------------------------- */

/* 태블릿 (대형 화면): 4열 */
@media only screen and (max-width: 1200px) {
    .main-comp-list .item {
        width: 25%;
    }
}

/* 태블릿 (일반 화면): 3열 */
@media only screen and (max-width: 860px) {
    .main-comp-list .item {
        width: 33.333%;
    }
}

/* 🌟 스마트폰/모바일 화면 (640px 이하): 2열 그리드 고정으로 가독성 및 터치 영역 극대화 */
@media only screen and (max-width: 640px) {
    .main-comp-list .item {
        width: 50%;
        padding: 4px;
    }
    
    .main-comp-list .item .item-inner {
        padding: 8px;
        border-radius: 12px;
    }

    .main-comp-list .item .name .cmpname {
        font-size: 0.95rem;
    }

    .main-comp-list .item .contact {
        font-size: 0.85rem;
    }

    .main-comp-list .item .btn-wrap .btn {
        min-height: 34px;
        font-size: 0.8rem;
    }

    .main-top-header .addr-list .item,
    .main-top-header .comptype-list .item {
        min-height: 34px;
        padding: 5px 10px;
        font-size: 0.88rem;
    }
}

/* 극소형 모바일 화면 (360px 이하) */
@media only screen and (max-width: 360px) {
    .main-comp-list .item {
        width: 50%;
        padding: 3px;
    }
    
    .main-comp-list .item .btn-wrap .btn {
        min-height: 32px;
        font-size: 0.75rem;
        padding: 0 4px;
    }
}
