/* public/assets/css/footer.css */

/* =========================================================
   Footer Base Layout (PC)
   ========================================================= */
.footer {
    position: relative;
    background-color: #fff;
    width: 100%;
    overflow: hidden;
    z-index: 10;
    font-family: var(--font-display);
}

.footer .pt-b3 {
    padding-top: 120px;
    padding-bottom: 60px;
}

/* =========================================================
   Scroll Top Button
   ========================================================= */
.footer .func {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 0;
    pointer-events: none;
}

.footer .bttn-scroll {
    position: absolute;
    right: clamp(16px, 4vw, 60px);
    top: -40px;
    width: 80px;
    height: 80px;
    background-color: #111;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.3s;
    z-index: 20;
}

.footer .bttn-scroll:hover {
    transform: translateY(-5px) scale(1.05);
    background-color: #000;
}

.footer .bttn-scroll .icon {
    width: 14px;
    height: 14px;
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    transform: rotate(45deg);
    margin-top: 4px;
}

/* =========================================================
   Footer Main Menu (Top)
   ========================================================= */
.footer__top {
    margin-bottom: 80px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 60px;
}

/* PC: 가로 정렬 */
.footer .fd-list {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.footer .fd-item {
    flex: 1;
    min-width: 0;
}

/* 대분류 링크 */
.footer .fd-link {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #000;
    margin-bottom: 24px;
    text-decoration: none;
    position: relative;
    cursor: pointer;
    white-space: nowrap;
}

/* 소분류 리스트 */
.footer .fd2-wrap {
    display: block;
}

.footer .fd2-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer .fd2-link {
    font-size: 15px;
    color: #666;
    text-decoration: none;
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
    font-weight: 500;
    white-space: nowrap;
}

.footer .fd2-link:hover {
    color: #000;
    transform: translateX(4px);
}

/* =========================================================
   Footer Right Info (Logo & Address)
   ========================================================= */
.footer-card {
    text-align: right;
    margin-top: -6px;
}

.footer-card__logo {
    display: inline-block;
    margin-bottom: 20px;
    max-width: 140px;
    width: 100%;
}

.footer-card__logo img {
    width: 100%;
    height: auto;
    display: block;
}

.footer-card__desc {
    font-size: 14px;
    color: #555;
    line-height: 1.8;
    font-weight: 300;
}

/* =========================================================
   Footer Bottom Utility
   ========================================================= */
.footer__bot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer .fd-list--util {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.footer .fd-list--util .fd-link {
    font-size: 14px;
    color: #444;
    font-weight: 500;
    margin-bottom: 0;
}

.copyright {
    font-size: 14px;
    color: #888;
    font-weight: 300;
    margin: 0;
}

.cp-name {
    font-weight: 700;
    color: #000;
}


/* =========================================================
   ✅ [MOBILE EXCLUSIVE] 모바일 전용 디자인 (1024px 이하)
   ========================================================= */
@media (max-width: 1024px) {

    .footer .pt-b3 {
        padding-top: 60px;
        padding-bottom: 40px;
    }

    /* --- [1] 상단 아코디언 영역 (.footer__top만 적용) --- */

    .footer__top {
        margin-bottom: 40px;
        padding-bottom: 0;
        border-bottom: none;
    }

    /* 리스트: 세로 스택 & 구분선 */
    .footer__top .fd-list {
        flex-direction: column !important;
        gap: 0;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

    .footer__top .fd-item {
        width: 100%;
        padding-right: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    /* 대분류 제목 (아코디언 헤더) */
    .footer__top .fd-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0;
        padding: 22px 0;
        /* 터치 영역 */
        font-size: 18px;
    }

    /* 화살표 아이콘 */
    .footer__top .fd-link::after {
        content: "";
        display: block;
        width: 10px;
        height: 10px;
        border-right: 2px solid #333;
        border-bottom: 2px solid #333;
        transform: rotate(45deg);
        /* 아래 화살표 */
        transition: transform 0.3s ease;
        margin-right: 8px;
    }

    /* 활성화 시 화살표 회전 */
    .footer__top .fd-item.is-active .fd-link::after {
        transform: rotate(-135deg);
        /* 위 화살표 */
        border-color: #000;
    }

    /* 소분류 래퍼 (기본 숨김) */
    .footer__top .fd2-wrap {
        display: grid;
        grid-template-rows: 0fr;
        transition: grid-template-rows 0.4s cubic-bezier(0.25, 1, 0.5, 1), padding 0.4s;
        overflow: hidden;
        opacity: 0.5;
    }

    .footer__top .fd2-list {
        min-height: 0;
        overflow: hidden;
    }

    /* 활성화 시 펼침 */
    .footer__top .fd-item.is-active .fd2-wrap {
        grid-template-rows: 1fr;
        opacity: 1;
        padding-bottom: 24px;
    }

    /* --- [2] 하단 유틸리티 영역 (아코디언 해제) --- */

    .footer__bot .fd-list--util {
        gap: 10px 20px;
        /* 세로 10px, 가로 20px */
        flex-wrap: wrap;
    }

    /* 상단 메뉴 스타일 상속 방지 및 초기화 */
    .footer__bot .fd-item {
        width: auto;
        border-bottom: none;
        padding: 0;
        margin: 0;
    }

    .footer__bot .fd-link {
        display: inline-block;
        padding: 0;
        margin-bottom: 0;
        font-size: 14px;
    }

    .footer__bot .fd-link::after {
        display: none !important;
        /* 화살표 제거 */
    }

    /* --- [3] 기타 레이아웃 --- */

    /* 우측 회사 정보 */
    .footer .col-3.col-offset-2 {
        margin-left: 0 !important;
        width: 100%;
        margin-top: 40px;
        padding-top: 30px;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

    .footer-card {
        text-align: left;
    }

    .footer-card__logo {
        max-width: 110px;
    }

    /* 하단 레이아웃 */
    .footer__bot {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        margin-top: 0;
    }

    /* 탑 버튼 */
    .footer .bttn-scroll {
        width: 50px;
        height: 50px;
        top: -25px;
        right: 20px;
    }
}

/* =========================================================
   [Hotfix] 하단 유틸리티 메뉴(개인정보/이용약관) 간격 복구
   - 상단 메인 메뉴의 flex:1 속성이 상속되는 것을 막아줍니다.
   ========================================================= */

.footer .fd-list--util {
    /* 가로 배치 및 간격 설정 */
    display: flex !important;
    flex-direction: row !important;
    gap: 40px !important;
    /* 메뉴 사이 간격 (원하는 만큼 조절하세요) */
    justify-content: flex-start !important;
    /* 왼쪽부터 차례대로 정렬 */
    width: auto !important;
    /* 전체 너비 차지하지 않도록 */
}

.footer .fd-list--util .fd-item {
    /* 상단 메뉴 스타일(늘어남) 초기화 */
    flex: 0 0 auto !important;
    width: auto !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 링크 텍스트 스타일 재확인 */
.footer .fd-list--util .fd-link {
    margin-bottom: 0 !important;
    display: inline-block;
    white-space: nowrap;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .footer .fd-list--util {
        gap: 20px !important;
        /* 모바일에서는 간격 조금 좁게 */
        flex-wrap: wrap !important;
    }
}