﻿/* Footer Component Styling */
/* Safari·태블릿: 상위 overflow-x와 플렉스 조합 시 푸터 텍스트가 세로로 잘리는 경우 방지 */
.common-footer {
    background: #8e8e8e; /* Medium gray as per user's image */
    color: #fff;
    padding: 0;
    padding-bottom: max(0px, env(safe-area-inset-bottom, 0px));
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    position: relative;
    z-index: 30;
    overflow-x: visible;
    overflow-y: visible;
    max-height: none;
    /* 브랜드 바·푸터 본문 동일 좌우 끝선(콘텐츠 폭 + 좌우 패딩) — header-inner와 동일 clamp */
    --footer-content-max-w: min(1440px, 100%);
    --footer-content-pad-x: clamp(20px, 4.1667vw, 60px);
}

#footer-placeholder {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    clear: both;
    position: relative;
    /* 본문(z-index:auto) 위, 고정 헤더(2000) 아래 — 오버레이·고스트 레이어에 가리지 않게 */
    z-index: 1500;
    isolation: isolate;
    overflow-x: visible;
    overflow-y: visible;
    max-height: none;
}

/* Brand Bar Section */
.brand-bar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0;
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.brand-bar-title {
    display: none;
}

/* 데스크톱·태블릿: 한 줄 — PC에서는 가로 스크롤바 없음(visible). 좁은 창만 필요 시 auto
   기준 폭 1440px: 박스 129.84×58.54, 박스 간격 26, 좌우 padding 60
   → 화면 폭이 1440px 이하로 좁아지면 모든 값이 동일 비율로 축소되어 박스가 겹치지 않음 */
.brand-bar-inner {
    --brand-bar-padding-x: var(--footer-content-pad-x);
    --brand-bar-padding-y: 25px;
    --brand-box-width: min(9.0167vw, 129.84px);
    --brand-box-height: min(4.0653vw, 58.54px);
    --brand-box-radius: min(0.55vw, 8px);
    --brand-logo-gap-x: min(1.8056vw, 26px);
    --brand-logo-gap-y: 20px;
    width: 100%;
    max-width: var(--footer-content-max-w);
    min-width: 0;
    margin: 0 auto;
    padding: var(--brand-bar-padding-y) var(--brand-bar-padding-x);
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--brand-logo-gap-y) var(--brand-logo-gap-x);
    overflow-x: visible;
    overflow-y: visible;
    box-sizing: border-box;
    overscroll-behavior-x: auto;
}

/* PC 박스: 흰색 라운드 테두리 안에 로고가 들어가는 형태 (8개 일렬) */
.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    width: var(--brand-box-width);
    height: var(--brand-box-height);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--brand-box-radius);
    opacity: 1;
    text-decoration: none;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.brand-logo img {
    /* 박스 안에서 로고는 박스 크기보다 작게 표시 — 각 브랜드별 width는 아래에서 지정 */
    max-width: 80%;
    max-height: 60%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    /* 회색 배경 위에서 흰 로고처럼 보이도록 변환 (원본이 어두운 색일 때 유용) */
    filter: brightness(0) invert(1);
    transition: transform 0.2s ease, filter 0.2s ease;
}

/* 각 브랜드 로고의 PC 박스 안 가로 폭: 박스 너비 비례로 잡아 박스 축소 시 함께 줄어듦 */
.brand-logo-clio img,
.brand-logo[aria-label="CLIO"] img {
    width: calc(var(--brand-box-width) * 0.40);
}

.brand-logo-peripera img {
    width: calc(var(--brand-box-width) * 0.55);
}

.brand-logo-goodal img {
    width: calc(var(--brand-box-width) * 0.45);
}

.brand-logo-dermatory img {
    width: calc(var(--brand-box-width) * 0.72);
}

.brand-logo-healingbird img {
    width: calc(var(--brand-box-width) * 0.55 * 1.05 * 1.05 * 1.03);
}

.brand-logo-typenumber img {
    width: calc(var(--brand-box-width) * 0.78);
}

.brand-logo-truerx img {
    width: calc(var(--brand-box-width) * 0.45);
}

.brand-logo-clubclio img {
    width: calc(var(--brand-box-width) * 0.62);
}

.brand-logo:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 1);
}

.brand-logo:hover img {
    transform: scale(1.06);
}

.brand-logo-goodal img {
    transform: translateY(2px);
}

.brand-logo-goodal:hover img {
    transform: translateY(2px) scale(1.06);
}

.brand-logo-healingbird img {
    transform: translateY(1px);
}

.brand-logo-healingbird:hover img {
    transform: translateY(1px) scale(1.06);
}

/* Main Footer Content */
.footer-main {
    padding: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: visible;
    overflow-y: visible;
    max-height: none;
}

.footer-main-inner {
    width: 100%;
    max-width: var(--footer-content-max-w);
    min-width: 0;
    min-height: min-content;
    margin: 0 auto;
    padding: 60px var(--footer-content-pad-x);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px 32px;
    box-sizing: border-box;
    overflow-x: visible;
    overflow-y: visible;
    max-height: none;
}

.footer-left {
    flex: 1 1 260px;
    min-width: 0;
    max-width: 100%;
    min-height: min-content;
    overflow: visible;
    max-height: none;
    position: relative;
    z-index: 1;
}

.footer-left h4 {
    font-size: 22px;
    margin-bottom: 25px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.footer-left p {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    opacity: 0.9;
    line-height: 1.6;
    overflow-wrap: break-word;
    word-break: keep-all;
    overflow: visible;
    max-height: none;
    visibility: visible;
}

.footer-copyright {
    display: block;
    margin-top: 40px;
    font-size: 14px;
    opacity: 0.7;
    overflow: visible;
    max-height: none;
    visibility: visible;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 30px;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
}

.family-site-wrapper {
    position: relative;
    width: 220px;
}

.family-site-select {
    width: 100%;
    padding: 10px 15px;
    background: #fff;
    border: none;
    font-size: 14px;
    color: #333;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4L6 8L10 4' stroke='%23333' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    cursor: pointer;
}

.footer-util-links {
    list-style: none;
    padding: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-util-item {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    font-size: 14px;
}

.footer-link-tag {
    font-weight: 500;
}

.footer-btn-apply {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    padding: 2px 10px;
    font-size: 11px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s;
}

.footer-btn-apply:hover {
    background: #fff;
    color: #8e8e8e;
}

/* 태블릿 영역: 1025px ~ 1366px — 4열 2행 박스 그리드
   기준 폭 1366px: 박스 272×118, 가로/세로 간격 40, 좌우 padding 79, 두 번째 줄 아래(CONTACT US와의 간격) 90
   → 1366px 이하로 좁아지면 모든 값이 동일 비율로 축소 */
@media (min-width: 1025px) and (max-width: 1366px) {
    .common-footer {
        --footer-content-pad-x: min(5.7833vw, 79px);
        --footer-content-max-w: 100%;
    }

    .brand-bar {
        border-bottom: 0;
    }

    .brand-bar-inner {
        --brand-bar-padding-x: var(--footer-content-pad-x);
        --brand-bar-padding-top: min(4.3924vw, 60px);
        --brand-bar-padding-bottom: min(6.5886vw, 90px);
        --brand-box-width: min(19.9121vw, 272px);
        --brand-box-height: min(8.6384vw, 118px);
        --brand-box-radius: min(0.7321vw, 10px);
        --brand-logo-gap-x: min(2.9282vw, 40px);
        --brand-logo-gap-y: min(2.9282vw, 40px);

        max-width: 100%;
        display: grid;
        grid-template-columns: repeat(4, var(--brand-box-width));
        justify-content: space-between;
        align-content: center;
        gap: var(--brand-logo-gap-y) var(--brand-logo-gap-x);
        padding: var(--brand-bar-padding-top) var(--brand-bar-padding-x) var(--brand-bar-padding-bottom);
    }

    .footer-main-inner {
        /* 두 번째 줄과 CONTACT US 사이 90px 간격은 .brand-bar-inner padding-bottom에서 전부 처리 */
        max-width: var(--footer-content-max-w);
        padding: 0 var(--footer-content-pad-x) 60px;
    }
}

/* 모바일 영역: 1024px 이하 — 2열 4행 박스 그리드 */
@media (max-width: 1024px) {
    .brand-bar-inner {
        --brand-bar-padding-x: var(--footer-content-pad-x);
        --brand-logo-gap-x: 15px;
        --brand-logo-gap-y: 15px;
    }

    .footer-main-inner {
        flex-direction: column;
        justify-content: flex-start;
    }

    .footer-right {
        align-items: flex-start;
    }

    .footer-util-item {
        justify-content: flex-start;
    }

    .common-footer {
        --footer-content-pad-x: clamp(16px, 3.8vw, 44px);
        --footer-content-max-w: min(820px, 100%);
        background: #939393;
    }

    .brand-bar {
        border-bottom: 0;
        flex-direction: column;
        align-items: stretch;
        padding-top: clamp(36px, 6.8vw, 84px);
    }

    .brand-bar-title {
        display: block;
        align-self: center;
        margin: 0 0 clamp(12px, 2.5vw, 30px);
        color: #fff;
        font-family: "Noto Sans KR", "Noto Sans", sans-serif;
        font-size: clamp(20px, 4.2vw, 46px);
        line-height: 1.25;
        font-weight: 700;
        letter-spacing: 0;
    }

    .brand-bar-inner {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        column-gap: var(--brand-logo-gap-x);
        row-gap: var(--brand-logo-gap-y);
        padding: 0 var(--footer-content-pad-x);
        margin: 0;
        width: 100%;
        max-width: var(--footer-content-max-w);
        background: transparent;
        overflow-x: visible;
        overflow-y: visible;
        box-sizing: border-box;
    }

    .brand-logo {
        width: 100%;
        height: clamp(64px, 11.5vw, 140px);
        min-height: 0;
        padding: 0;
        box-sizing: border-box;
        background: transparent;
        border: 1px solid rgba(255, 255, 255, 0.8);
        border-radius: clamp(6px, 1.4vw, 16px);
        opacity: 1;
        justify-content: center;
    }

    .brand-logo img {
        max-width: none;
        width: auto;
        height: auto;
        margin: 0;
    }

    .brand-logo:not(:hover) img {
        transform: none;
    }

    .brand-logo-clio img,
    .brand-logo[aria-label="CLIO"] img {
        width: clamp(60px, 12vw, 140px);
        height: auto;
    }

    .brand-logo-peripera img {
        width: clamp(72px, 14vw, 164px);
        height: auto;
    }

    .brand-logo-goodal img {
        width: clamp(60px, 12vw, 140px);
        height: auto;
    }

    .brand-logo-dermatory img {
        width: clamp(98px, 19vw, 224px);
        height: auto;
    }

    .brand-logo-healingbird img {
        width: calc(clamp(88px, 17vw, 200px) * 1.05 * 1.05 * 1.03);
        height: auto;
    }

    .brand-logo-typenumber img {
        width: clamp(104px, 20vw, 236px);
        height: auto;
    }

    .brand-logo-truerx img {
        width: clamp(60px, 11.8vw, 138px);
        height: auto;
    }

    .brand-logo-clubclio img {
        width: clamp(82px, 16vw, 188px);
        height: auto;
    }

    .footer-main-inner {
        width: 100%;
        max-width: var(--footer-content-max-w);
        padding: clamp(36px, 7vw, 90px) var(--footer-content-pad-x) clamp(40px, 8vw, 100px);
        justify-content: flex-start;
        /* CONTACT US 블록 ↔ Family site (세로 gap만 — space-between은 이 간격을 과하게 벌림) */
        gap: 3px;
    }

    .footer-left {
        flex: 0 1 auto;
    }

    .footer-left h4 {
        margin-bottom: clamp(8px, 1.6vw, 18px);
        font-family: "Noto Sans KR", "Noto Sans", sans-serif;
        font-size: clamp(15px, 3.2vw, 32px);
        line-height: 1.6;
        font-weight: 400;
        letter-spacing: 0;
    }

    .footer-left p {
        margin-bottom: clamp(6px, 1.3vw, 14px);
        font-family: "Noto Sans KR", "Noto Sans", sans-serif;
        font-size: clamp(11px, 2.2vw, 22px);
        line-height: 1.85;
        font-weight: 500;
        letter-spacing: 0;
        opacity: 1;
        word-break: keep-all;
    }

    .footer-left > p:last-of-type {
        margin-bottom: clamp(2px, 0.35vw, 4px);
    }

    .footer-copyright {
        margin-top: clamp(2px, 0.5vw, 5px);
        margin-bottom: 0;
        font-family: "Noto Sans KR", "Noto Sans", sans-serif;
        font-size: clamp(11px, 2.2vw, 22px);
        line-height: 1.85;
        font-weight: 500;
        letter-spacing: 0;
        opacity: 0.95;
    }

    .footer-right {
        width: 100%;
        gap: clamp(14px, 2.8vw, 32px);
        margin-top: 0;
        padding-top: 0;
    }

    .family-site-wrapper {
        width: clamp(150px, 30vw, 340px);
    }

    .family-site-select {
        height: clamp(26px, 5vw, 52px);
        padding: 0 clamp(24px, 4.6vw, 48px) 0 clamp(10px, 2.2vw, 22px);
        font-size: clamp(10px, 2vw, 20px);
        background-position: right clamp(8px, 1.8vw, 18px) center;
    }

    .footer-util-links {
        gap: clamp(8px, 1.6vw, 18px);
        text-align: left;
        font-family: "Noto Sans KR", "Noto Sans", sans-serif;
        font-size: clamp(11px, 2.2vw, 22px);
        line-height: 1.95;
        font-weight: 500;
        letter-spacing: 0;
    }

    .footer-util-item {
        font-size: clamp(11px, 2.2vw, 22px);
        line-height: 1.95;
        gap: clamp(6px, 1.4vw, 16px);
    }

    .footer-btn-apply {
        padding: clamp(2px, 0.5vw, 6px) clamp(7px, 1.5vw, 16px);
        font-family: inherit;
        font-size: clamp(11px, 2.2vw, 18px);
        line-height: 1.2;
        font-weight: 500;
    }
}
