/* ============================================================
   📱 mobile-nav.css — 모바일 헤더 + 하단 네비게이션 바
   2026-05-28
   - 어른/고령자 친화: 햄버거 메뉴 의존 X
   - 모바일(≤991px)에서 하단 5개 메뉴 항상 노출
   - 큰 아이콘 + 텍스트 라벨로 명확한 인지
   - CSS 분리: .mb- 프리픽스로 다른 스타일과 충돌 방지
   ============================================================ */

/* PC에서는 숨김 */
.mb-bottomnav {
    display: none;
}

/* ============================================================
   📢 유틸리티 바 (어나운스먼트/프로모션) — 헤더 최상단
   - 데모 서비스 안내 + 오늘 날짜 + 서비스 구동중 표시
   - Toss 톤: 다크 배경 + 라이트 텍스트 + 라이브 dot
   ============================================================ */
/* ============================================================
   📐 헤더 레이아웃 — 사이트 표준 1000px 콘텐츠 박스 정렬
   - style_240703.css 의 .header { display: flex; height: 64px } 를
     세로 적층(util-bar 위 / header_inner 아래) 으로 재구성
   - util-bar / header_inner / 본문(.continer_inner) 모두 동일한 1000px 박스
   - 모바일에선 .header 의 legacy padding 을 리셋하고, 인셋은 inner 에서만 처리
     → mobile/PC 룰 책임 분리 (outer = column 전환만 / inner = 콘텐츠 너비)
   ============================================================ */
body .header {
    flex-direction: column;
    height: auto;
    padding: 0;        /* style_240703.css @991px 의 .header { padding: 0 20px } 무력화 */
}
/* header_inner — PC 1000px / 모바일 100% (인셋은 @media 에서) */
body .header .header_inner {
    width: 1000px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    flex: 0 0 auto;
    min-height: 64px;
    height: 64px;
    box-sizing: border-box;
}
/* header_top 도 1000px 안에서 양쪽 끝으로 확장 (로고 좌측, sub_nav 우측) */
body .header .header_inner .header_top {
    flex: 1 1 auto;
    width: 100%;
}
/* 본문 padding-top 보정 (util-bar 40px + header_inner 64px = 104px) */
body { padding-top: 104px; }

.util-bar {
    background: #191f28;
    color: #ffffff;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
    letter-spacing: -0.2px;
    width: 100%;
    flex: 0 0 auto;
    box-sizing: border-box;
}
.util-bar__inner {
    /* 사이트 표준 너비(.continer_inner = 1000px) 정렬 */
    width: 1000px;
    max-width: 100%;
    margin: 0 auto;
    padding: 11px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-sizing: border-box;
    min-height: 40px;
    animation: util-bar-fadein .5s ease-out both;
}
@keyframes util-bar-fadein {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   📐 .M-title.package — 본문 1000px 표준 너비에 맞춰 정렬
   - 보라색 그라데이션 배경은 풀폭 유지
   - 내부 텍스트(h5, p) 만 1000px 박스 내부에서 좌측 정렬
   ============================================================ */
body .M-title.package {
    text-align: left;
}
body .M-title.package h5,
body .M-title.package p {
    width: 1000px;
    max-width: calc(100% - 32px);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    display: block;
}
.util-bar__item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.92);
}

/* ── 프로모션 (좌측): 별 트윙클 + 텍스트 미세 글로우 ── */
.util-bar__item--promo {
    color: #ffd56b;
    text-shadow: 0 0 12px rgba(255, 213, 107, 0.20);
}
.util-bar__icon {
    flex-shrink: 0;
    color: #ffd56b;
    transform-origin: center;
    animation: util-bar-twinkle 2.6s ease-in-out infinite;
}
@keyframes util-bar-twinkle {
    0%, 100% {
        transform: rotate(0) scale(1);
        filter: drop-shadow(0 0 0 rgba(255, 213, 107, 0));
        opacity: 1;
    }
    25% {
        transform: rotate(-10deg) scale(1.10);
        filter: drop-shadow(0 0 4px rgba(255, 213, 107, 0.6));
    }
    50% {
        transform: rotate(0) scale(0.92);
        filter: drop-shadow(0 0 8px rgba(255, 213, 107, 0.9));
        opacity: 0.85;
    }
    75% {
        transform: rotate(10deg) scale(1.10);
        filter: drop-shadow(0 0 4px rgba(255, 213, 107, 0.6));
    }
}

/* ── 상태 (우측): 날짜 슬라이드 + 라이브 dot 펄스 + 더블 ring ── */
.util-bar__item--status {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
}
.util-bar__date {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.1px;
    color: rgba(255, 255, 255, 0.78);
    animation: util-bar-slidein .6s ease-out both;
}
@keyframes util-bar-slidein {
    from { opacity: 0; transform: translateX(8px); }
    to   { opacity: 1; transform: translateX(0); }
}
.util-bar__sep {
    color: rgba(255, 255, 255, 0.30);
    margin: 0 4px;
}
.util-bar__live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #ffffff;
    font-weight: 600;
}
.util-bar__dot {
    position: relative;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1f9d57;
    flex-shrink: 0;
    animation: util-bar-dot-glow 1.6s ease-in-out infinite;
}
.util-bar__dot::before,
.util-bar__dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #1f9d57;
    opacity: 0.55;
    z-index: -1;
}
.util-bar__dot::before { animation: util-bar-ring 1.8s ease-out infinite; }
.util-bar__dot::after  { animation: util-bar-ring 1.8s ease-out infinite .6s; }
@keyframes util-bar-dot-glow {
    0%, 100% { box-shadow: 0 0 4px rgba(31, 157, 87, 0.45); }
    50%      { box-shadow: 0 0 10px rgba(31, 157, 87, 0.9); }
}
@keyframes util-bar-ring {
    0%   { transform: scale(1);   opacity: 0.55; }
    100% { transform: scale(2.8); opacity: 0; }
}

/* 모션 줄이기 환경 — 모든 애니메이션 비활성화 (접근성) */
@media (prefers-reduced-motion: reduce) {
    .util-bar__inner,
    .util-bar__icon,
    .util-bar__date,
    .util-bar__dot,
    .util-bar__dot::before,
    .util-bar__dot::after {
        animation: none !important;
    }
}

/* ============================================================
   📱 1023px↓ — 모바일/태블릿 콘텐츠 인셋
   util-bar / header_inner 둘 다 인셋 16px 통일 (정렬축 일관 유지)
   .header outer 의 padding 은 위에서 이미 0 으로 리셋됨
   ============================================================ */
@media (max-width: 1023px) {
    .util-bar__inner,
    body .header .header_inner {
        width: 100%;
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }
    /* util-bar 는 세로 패딩은 별도 유지 */
    .util-bar__inner { padding-top: 8px; padding-bottom: 8px; }
}

/* ============================================================
   📱 768px↓ — 모바일 컴팩트 (인셋 14px)
   util-bar / header_inner 좌우 14px 통일
   ============================================================ */
@media (max-width: 768px) {
    .util-bar__inner,
    body .header .header_inner {
        padding-left: 14px;
        padding-right: 14px;
    }
    .util-bar__inner {
        padding-top: 6px;
        padding-bottom: 6px;
        gap: 10px;
        min-height: 28px;
    }
    .util-bar__item { font-size: 11.5px; gap: 5px; }
    .util-bar__icon { width: 12px; height: 12px; }
    .util-bar__dot { width: 5px; height: 5px; }
    /* util-bar(~28px) + header_inner(56px) ≈ 84px */
    body { padding-top: 84px; }
}

/* ============================================================
   📱 480px↓ — 초소형 (인셋 12px, 날짜 숨김)
   ============================================================ */
@media (max-width: 480px) {
    .util-bar__inner,
    body .header .header_inner {
        padding-left: 12px;
        padding-right: 12px;
    }
    .util-bar__inner {
        padding-top: 5px;
        padding-bottom: 5px;
        gap: 8px;
    }
    .util-bar__item { font-size: 11px; }
    .util-bar__date,
    .util-bar__sep { display: none; }
    /* util-bar(~26px) + header_inner(52px) ≈ 78px */
    body { padding-top: 78px; }
}

/* ============================================================
   📱 viewport overflow 차단 (모든 모바일 화면 공통)
   ============================================================ */
@media (max-width: 991px) {
    html, body { overflow-x: hidden !important; max-width: 100vw; }
}

/* ============================================================
   📱 모바일 헤더 (≤991px) — 로고(좌) + 회원 버튼(우)
   - 햄버거는 숨김 (하단 nav가 메인 네비 역할)
   - 로그인 상태: 마이페이지 버튼 노출
   - 비로그인 상태: 로그인 + 회원가입 버튼 노출
   - 로고는 좌측 자연스럽게 정렬
   ============================================================ */
@media (max-width: 991px) {
    /* 헤더 — 풀폭 + 좌우 패딩 균형 */
    body .header {
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box;
    }
    body .header .header_inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        /* 좌우 인셋은 상단 공유 셀렉터(@1023px/768px/480px) 에서 일관 처리 */
        padding-top: 10px;
        padding-bottom: 10px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        position: relative;
    }
    /* 좌측 — 로고 (마진/패딩 0 으로 가장 왼쪽에 정렬) */
    body .header .header_top {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0 !important;
        flex: 0 0 auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    body .header .logo_section {
        flex: 0 0 auto !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
    }
    body .header .logo_section a.logo_img {
        margin: 0 !important;
        padding: 0 !important;
    }
    body .header .logo_section a.logo_img {
        display: inline-block !important;
        vertical-align: middle !important;
        /* width/height/background-position 은 common.css의 모바일 sprite 유지 */
    }

    /* 햄버거 메뉴 아이콘 — 완전히 숨김 (하단 nav가 네비 역할) */
    body .header .m_nav_icon {
        display: none !important;
    }

    /* sub_nav — header_top 옆으로 정렬, 회원 버튼만 노출 */
    body .header .sub_nav {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        flex: 1 1 auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
    }
    body .header .sub_nav_inner {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        flex: 1 1 auto !important;
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        max-width: none !important;
        background: transparent !important;
        gap: 0 !important;
    }
    /* PC 메인 네비(.nav) 숨김 — 하단 nav에 통합됨 */
    body .header .sub_nav_inner > .nav,
    body .header nav.sub_nav .nav {
        display: none !important;
    }

    /* 회원 영역 — 우측 정렬 + flex row */
    body .header .member_section {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 6px !important;
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        flex: 0 0 auto !important;
        background: transparent !important;
    }
    body .header .member_section > div.member {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 34px !important;
        min-height: 34px !important;
        padding: 0 12px !important;
        margin: 0 !important;
        font-size: 12.5px !important;
        font-weight: 700 !important;
        letter-spacing: -0.3px !important;
        border-radius: 8px !important;
        border: 1px solid #e5e8eb !important;
        background: #ffffff !important;
        color: #4e5968 !important;
        white-space: nowrap !important;
        cursor: pointer;
        line-height: 1 !important;
        box-shadow: none !important;
        transition: background-color .15s ease, border-color .15s ease, color .15s ease;
    }
    body .header .member_section > div.member > a,
    body .header .member_section > div.member > span {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        font: inherit !important;
        color: inherit !important;
        text-decoration: none !important;
        line-height: 1 !important;
    }
    /* 로그인 버튼 — outline */
    body .header .member_section > div.member.login_btn {
        background: #ffffff !important;
        color: #191f28 !important;
        border-color: #d1d6db !important;
    }
    /* 회원가입 버튼 — 강조 (블루 필) */
    body .header .member_section > div.member.join_btn {
        background: #3182f6 !important;
        color: #ffffff !important;
        border-color: #3182f6 !important;
    }
    /* 마이페이지 버튼 — 강조 (블루 필) */
    body .header .member_section > div.member.mypage_btn {
        background: #3182f6 !important;
        color: #ffffff !important;
        border-color: #3182f6 !important;
    }
    body .header .member_section > div.member.mypage_btn > a {
        color: #ffffff !important;
    }
    /* 고객센터 버튼 — outline 다크 */
    body .header .member_section > div.member.cs_btn {
        background: #ffffff !important;
        color: #191f28 !important;
        border-color: #d1d6db !important;
    }
    body .header .member_section > div.member.cs_btn > a {
        color: #191f28 !important;
    }
    /* 로그아웃 버튼 — outline 그레이 */
    body .header .member_section > div.member.logout {
        background: #ffffff !important;
        color: #6b7684 !important;
        border-color: #e5e8eb !important;
    }
    /* 로그인된 상태의 환영 메시지/마이페이지 호버 박스 숨김 */
    body .header .member_section > div.mypage_btn .login_user_box,
    body .header .welcome {
        display: none !important;
    }
}

/* ============================================================
   📱 480px↓ — 회원 버튼 더 컴팩트 (작은 폰)
   ============================================================ */
@media (max-width: 480px) {
    body .header .header_inner { padding-top: 8px; padding-bottom: 8px; gap: 8px; }
    body .header .member_section { gap: 4px !important; }
    body .header .member_section > div.member {
        height: 30px !important;
        min-height: 30px !important;
        padding: 0 9px !important;
        font-size: 11.5px !important;
        border-radius: 7px !important;
    }
}

/* ============================================================
   📱 360px↓ — 초소형 폰 (회원가입은 숨겨서 자리 확보)
   ============================================================ */
@media (max-width: 360px) {
    body .header .member_section > div.member { padding: 0 7px !important; font-size: 10.5px !important; }
    body .header .member_section > div.member.join_btn,
    body .header .member_section > div.member.cs_btn { display: none !important; }
}

/* ============================================================
   📱 하단 네비게이션 바 — 모바일(≤991px) 에서만 노출
   PC 에서는 .mb-bottomnav { display: none } (라인 11) 으로 숨김 유지
   ============================================================ */
@media (max-width: 991px) {
    /* ============================================================
       📱 하단 네비게이션 바 — 항상 노출 (햄버거 모름 사용자 대비)
       ============================================================ */
    .mb-bottomnav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9988;
        height: 64px;
        padding: 6px 4px max(6px, env(safe-area-inset-bottom)) 4px;
        background: #ffffff;
        border-top: 1px solid #f1f3f5;
        box-shadow: 0 -4px 16px rgba(17, 24, 39, 0.06);
        font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
        box-sizing: border-box;
    }
    .mb-bottomnav__item {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 6px 4px;
        background: transparent;
        color: #6b7684;
        text-decoration: none !important;
        font-family: inherit;
        letter-spacing: -0.2px;
        transition: color .15s ease, background-color .15s ease, transform .1s ease;
        border-radius: 10px;
        min-width: 0;
        position: relative;
    }
    .mb-bottomnav__item:hover {
        color: #191f28;
        background: #f9fafb;
    }
    .mb-bottomnav__item:active {
        transform: scale(0.96);
    }
    .mb-bottomnav__item.is-active {
        color: #3182f6;
    }
    .mb-bottomnav__icon {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
        display: block;
    }
    .mb-bottomnav__label {
        font-size: 11px;
        font-weight: 700;
        line-height: 1.2;
        white-space: nowrap;
        color: inherit;
    }
    /* CTA 아이템 (로그인) - 강조 */
    .mb-bottomnav__item--cta {
        color: #ffffff;
        background: #3182f6;
        margin: 4px 4px;
        font-weight: 800;
    }
    .mb-bottomnav__item--cta:hover {
        color: #ffffff;
        background: #1b64da;
    }
    .mb-bottomnav__item--cta:active {
        transform: scale(0.96);
    }

    /* 본문 하단 패딩 — 하단 nav에 콘텐츠가 가리지 않게 */
    body { padding-bottom: 70px !important; }
    body .footer,
    body footer { margin-bottom: 64px; }

    /* 플로팅 배너가 하단 nav와 겹치지 않게 위로 띄움 */
    body .fb-wrap,
    body .fb-stack {
        bottom: 78px !important;
    }
}

/* ============================================================
   📱 480px↓ 미니 모바일 — 폰트/아이콘 살짝 축소
   ============================================================ */
@media (max-width: 480px) {
    .mb-bottomnav {
        height: 60px;
        padding-top: 4px;
        padding-bottom: max(4px, env(safe-area-inset-bottom));
    }
    .mb-bottomnav__icon { width: 22px; height: 22px; }
    .mb-bottomnav__label { font-size: 10.5px; }
    body { padding-bottom: 66px !important; }
    body .fb-wrap,
    body .fb-stack { bottom: 72px !important; }
}

/* ============================================================
   📱 360px↓ 초소형 — 아주 컴팩트
   ============================================================ */
@media (max-width: 360px) {
    .mb-bottomnav__item { gap: 2px; padding: 6px 2px; }
    .mb-bottomnav__icon { width: 20px; height: 20px; }
    .mb-bottomnav__label { font-size: 10px; }
}

/* ============================================================
   접근성 — 시스템 다크 모드 (선택 사항)
   ============================================================ */
@media (prefers-color-scheme: dark) {
    /* dark theme not enabled by default to avoid breaking site */
}
