/* Header Styles */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: #fff; }
.header .gnb { border-bottom: 1px solid #E5E7EB; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; position: relative; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
/* 관리자에서 올린 로고는 크기를 알 수 없다. height 로 늘리면 작은 로고가 뭉개지므로
   max-height 로 상한만 두고 원본 비율을 지킨다.

   display 는 반드시 .logo .logo-pc / .logo .logo-mobile 쪽에서만 다룬다.
   .logo img 에 display 를 두면 (0,1,1) 이라 (0,1,0) 인 .logo-mobile 의
   display:none 을 이겨서 PC·모바일 로고가 동시에 보인다 */
.logo img { width: auto; }
.logo .logo-pc { display: block; max-height: 40px; }
.logo .logo-mobile { display: none; max-height: 28px; }
.header .search-box { max-width: 320px; width: 100%; position: relative; }
.header .search-box input { width: 100%; height: 44px; padding: 0 44px 0 18px; border: 1px solid #D1D5DB; border-radius: 22px; font-size: 15px; outline: none; transition: border-color .2s; }
.header .search-box input:focus { border-color: #1e2761; }
.header .search-box i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #9CA3AF; }
.header .search-box button { position: absolute; right: 0; top: 0; height: 100%; width: 44px; background: none !important; border: none; cursor: pointer; color: #9CA3AF; display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 0; }
.popular-rolling { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-right: auto; margin-left: 16px; position: relative; cursor: pointer; }
.popular-rolling .label { font-size: 13px; color: #1F2937; white-space: nowrap; font-weight: 700; }
.popular-rolling .hot-badge { background: #EF4444; color: #fff; font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 4px; margin-left: 4px; }
.popular-rolling .rolling-wrap { display: flex; align-items: center; gap: 8px; }
.popular-rolling .rolling-current { width: 80px; height: 24px; overflow: hidden; position: relative; }
.popular-rolling .rolling-list { list-style: none; margin: 0; padding: 0; animation: rolling 25s linear infinite; }
.popular-rolling .rolling-list li { height: 24px; line-height: 24px; display: flex; align-items: center; }
.popular-rolling .rolling-list a { font-size: 14px; color: #1F2937; font-weight: 500; text-decoration: none; display: block; }
.popular-rolling .arrow { font-size: 12px; color: #9CA3AF; transition: transform 0.2s; }
.popular-rolling:hover .rolling-list { animation-play-state: paused; }
.popular-rolling:hover .arrow { transform: rotate(180deg); }
.popular-rolling .dropdown { position: absolute; top: 100%; left: 0; padding-top: 12px; background: transparent; min-width: 260px; display: none; z-index: 100; }
.popular-rolling .dropdown::before { content: ''; position: absolute; top: 12px; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.popular-rolling .dropdown li { position: relative; z-index: 1; list-style: none; }
.popular-rolling:hover .dropdown { display: block; }
.popular-rolling .dropdown li { padding: 0; height: auto; }
.popular-rolling .dropdown li:first-child a { padding-top: 22px; }
.popular-rolling .dropdown li a { display: flex; align-items: center; gap: 8px; padding: 10px 20px; font-size: 14px; color: #374151; text-decoration: none; }
.popular-rolling .dropdown li a:hover { background: #F3F4F6; color: #1e2761; }
.popular-rolling .dropdown li a .rank { width: 20px; font-weight: 600; color: #1e2761; }
.popular-rolling .dropdown li a .hot-badge { background: #EF4444; color: #fff; font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 4px; margin-right: -2px; }
@keyframes rolling { 0%, 8% { transform: translateY(0); } 10%, 18% { transform: translateY(-24px); } 20%, 28% { transform: translateY(-48px); } 30%, 38% { transform: translateY(-72px); } 40%, 48% { transform: translateY(-96px); } 50%, 58% { transform: translateY(-120px); } 60%, 68% { transform: translateY(-144px); } 70%, 78% { transform: translateY(-168px); } 80%, 88% { transform: translateY(-192px); } 90%, 100% { transform: translateY(-216px); } }
/* 일정 캘린더 진입 아이콘 (인기검색어 ↔ 회원영역 사이) */
/* 출발확정 캘린더 - 브라운으로 구분한다 */
.calendar-entry { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; padding: 8px 10px; margin-right: 2px; border-radius: 10px; font-size: 12px; color: var(--color-primary, #1E2761); font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .2s, color .2s; }
.calendar-entry i { font-size: 20px; }
/* 출발확정 캘린더 아이콘 - PC 는 검정, 모바일은 로고 파랑(mobile.css) */
.calendar-entry .calendar-icon { width: 22px; height: 22px; color: #111827; }
.calendar-entry:hover { background: #F3F4F6; color: var(--color-primary-dark, #161E4D); }

.nav-actions { display: flex; align-items: center; gap: 0; font-size: 12px; }
.nav-actions a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 10px; color: #6B7280; transition: color .2s; text-decoration: none; position: relative; white-space: nowrap; }
.nav-actions a i { font-size: 20px; }
.nav-actions a:hover { color: #1e2761; }
.nav-actions .divider { width: 1px; height: 36px; background: #E5E7EB; margin: 0 4px; }
.nav-actions .cart-link .badge { position: absolute; top: 2px; right: 6px; background: #EF4444; color: #fff; font-size: 10px; font-weight: 600; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
header.header .gnb { background: #fff; border-bottom: 1px solid #E5E7EB; display: block; }
header.header .gnb .container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
/* 대분류 수가 관리자 설정에 따라 늘어나므로 넘치면 가로로 스크롤한다.
   flex-shrink 를 막지 않으면 항목이 눌려 글자가 줄바꿈된다 */
header.header .gnb .gnb-list { display: flex; gap: 32px; height: 48px; align-items: center; font-size: 15px; font-weight: 400; list-style: none; margin: 0; padding: 0; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
header.header .gnb .gnb-list::-webkit-scrollbar { display: none; }
header.header .gnb .gnb-list > li { flex-shrink: 0; }
.gnb-list a { color: #1F2937; padding: 14px 0; position: relative; text-decoration: none; }
.gnb-list a:hover { color: #1e2761; }
/* 지금 보고 있는 대분류만 글자 밑에 라인 (PC/모바일 공통).
   누르는 중(:active)·포커스에는 라인을 넣지 않는다 - 지나가는 상태에 선이 생기면
   어느 분류를 보고 있는지 헷갈린다 */
.gnb-list a.active { color: #1e2761; font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.gnb-list .gnb-all { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.gnb-list .gnb-all i { font-size: 14px; }
header.header .gnb .gnb-utils { display: flex; gap: 20px; align-items: center; list-style: none; margin: 0; padding: 0; }
header.header .gnb .gnb-utils a { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #9CA3AF; text-decoration: none; transition: color .2s; }
header.header .gnb .gnb-utils a:hover { color: #1e2761; }
header.header .gnb .gnb-utils a.active { color: #1e2761; font-weight: 600; }
header.header .gnb .gnb-utils a i { font-size: 14px; }

/* Mobile Menu Button - hidden by default on desktop */
.mobile-menu-btn { display: none; background: none; border: none; font-size: 20px; color: #374151; cursor: pointer; padding: 8px; }

/* Mobile Menu Overlay */
.mobile-menu-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; opacity: 0; transition: opacity 0.3s; }
.mobile-menu-overlay.active { display: block; opacity: 1; }

/* Mobile Slide Menu */
.mobile-menu { position: fixed; top: 0; left: 0; width: 280px; max-width: 85vw; height: 100vh; background: #fff; z-index: 201; transform: translateX(-100%); transition: transform 0.3s ease; overflow-y: auto; }
.mobile-menu.active { transform: translateX(0); }
.mobile-menu-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #E5E7EB; font-size: 18px; font-weight: 700; }
.mobile-menu-close { background: none; border: none; font-size: 20px; color: #6B7280; cursor: pointer; padding: 4px; }
.mobile-menu-list { list-style: none; margin: 0; padding: 8px 0; }
/* 글자크기·색은 아래 유틸 항목(공지사항·여행후기 …)과 같게 맞춘다 (14px / #6B7280) */
.mobile-menu-list li a { display: block; padding: 10px 20px; font-size: 14px; color: #6B7280; text-decoration: none; }
.mobile-menu-list li a:hover { background: #F9FAFB; color: #1e2761; }
.mobile-menu-utils { padding: 8px 20px; display: flex; flex-direction: column; gap: 0; }
.mobile-menu-utils a { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: 14px; color: #6B7280; text-decoration: none; }
.mobile-menu-utils a i { font-size: 16px; width: 20px; text-align: center; }
.mobile-menu-utils a:hover { color: #1e2761; }

/* Mobile */
@media (max-width: 768px) {
    .header-inner { height: 56px; display: flex !important; justify-content: center !important; }
    .header-inner > *:not(.logo) { display: none !important; }
    .mobile-menu-btn { display: none !important; }
    .header .search-box { display: none !important; }
    .popular-rolling { display: none !important; }
    .nav-actions { display: none !important; }
    header.header .gnb { display: none !important; }
    .mega-menu { display: none !important; }
    .mega-overlay { display: none !important; }
    .logo { position: static !important; margin: 0 !important; flex-shrink: 0; }
    .logo .logo-pc { display: none; }
    .logo .logo-mobile { display: block; }
    /* 하단 네비게이션 자리를 body 여백으로 비워 두지 않는다.
       네비게이션은 스크롤을 내리면 감춰지므로, 비워 두면 페이지 끝에서
       카피라이트 아래에 흰 띠로 남는다. 네비게이션은 그냥 본문 위에 얹는다 */
}

/* Mobile Bottom Nav */
.mobile-bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; height: 64px; background: #fff; border-top: 1px solid #e5e7eb; z-index: 100; transition: transform .3s ease; }
/* 상단 헤더와 같은 신호로 움직인다. 아래로 내려 감춘다 (위로 올리면 화면 밖이 아니라 본문 위를 덮는다) */
body.nav-hidden .mobile-bottom-nav { transform: translateY(100%); }
.mobile-bottom-nav-inner { display: grid; grid-template-columns: repeat(5, 1fr); height: 100%; }
.mobile-bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: #6b7280; font-size: 11px; font-weight: 500; white-space: nowrap; transition: color .2s; }
.mobile-bottom-nav a i { font-size: 22px; }
.mobile-bottom-nav a:active { color: #1e2761; }
/* 현재 화면 항목은 로고 파랑 (로고 이미지에서 뽑은 #2786EA) */
.mobile-bottom-nav a.is-active { color: #2786EA; }
@media (max-width: 768px) {
    .mobile-bottom-nav { display: block; }
}

/* Mega Menu */
header.header .gnb { position: relative; }
/* 메가메뉴 뒤를 덮는 마스크.
   z-index 는 헤더(100)·상단배너(101)보다 낮고 플로팅 버튼(58)보다는 높게 둔다.
   그래야 헤더와 메뉴만 남고 그 아래 본문이 가려진다.
   display 대신 opacity/visibility 로 여닫아야 사라질 때도 부드럽게 넘어간다. */
.mega-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99; opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease; }
.mega-overlay.active { opacity: 1; visibility: visible; }
.mega-menu { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; z-index: 150; box-shadow: 0 8px 30px rgba(0,0,0,0.15); }
.mega-menu.active { display: block; }
/* 메가메뉴는 .gnb 안에 들어 있어서 위의 `header.header .gnb .container` 규칙이
   특이도(0,3,1)로 이겨 버린다. 그래서 여기 적어 둔 위아래 여백이 통째로 사라지고
   대분류 제목이 헤더에 딱 붙어 있었다. 같은 경로로 다시 적어 되찾는다.
   그 규칙이 함께 걸어 둔 flex 배치도 여기서는 필요 없으므로 block 으로 되돌린다. */
/* 아래는 10px 만 준다. 마지막 항목이 자기 margin-bottom:10px 를 이미 들고 있어서
   30px 을 주면 아래가 40px 이 돼 위(20px)의 두 배로 벌어진다. 10+10 으로 위와 맞춘다. */
header.header .gnb .mega-menu > .container { max-width: 1200px; margin: 0 auto; padding: 20px 20px 10px; display: block; }
/* 지역 대분류가 관리자 설정에 따라 늘어나므로 한 줄에 다 못 담기면 다음 줄로 넘긴다.
   고정 80px 간격으로는 대분류를 몇 개만 더 켜도 컨테이너를 넘어간다 */
/* 열 사이 56px 은 열 자체가 130px 인 것에 비해 너무 벌어져 보인다.
   행 간격과 같은 32px 로 맞춘다 (열 폭의 25% 정도가 적당한 간격이다) */
.mega-grid { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.mega-col { min-width: 130px; }
.mega-col h4 { font-size: 16px; font-weight: 700; color: #1F2937; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid #1e2761; }
.mega-col h4 a { color: #1F2937; text-decoration: none; }
.mega-col h4 a:hover { color: #1e2761; }
.mega-col h4:not(:first-child) { margin-top: 28px; }
.mega-col ul { list-style: none; margin: 0; padding: 0; }
/* 줄 간격 39px 은 14px 글자에 비해 지나치게 벌어진다.
   li 가 본문 글자크기(15px)를 물려받아 줄상자가 29px 이나 되던 것을
   링크와 같은 14px 로 맞추고 줄높이를 23px 로 못 박았다 (항목 간격 31px). */
.mega-col ul li { margin-bottom: 8px; font-size: 14px; line-height: 23px; }
.mega-col ul li a { font-size: 14px; color: #6B7280; text-decoration: none; transition: color 0.2s; }
.mega-col ul li a:hover { color: #1e2761; }
.mega-footer { border-top: 1px solid #E5E7EB; font-size: 14px; color: #6B7280; background: #f9fafb; }
.mega-footer-inner { max-width: 1200px; margin: 0 auto; padding: 16px 20px; }
.mega-footer strong { font-size: 18px; font-weight: 700; color: #1e2761; margin: 0 12px; }

/* ── 상단 배너 (헤더 최상단 띠) ── */
/* 헤더가 position:fixed 라 배너도 함께 고정하고, 헤더/본문을 배너 높이만큼 밀어낸다 (JS가 --top-banner-h 설정) */
.top-banner { position: fixed; top: 0; left: 0; right: 0; width: 100%; z-index: 101; }
body.has-top-banner .header { top: var(--top-banner-h, 0px); }

body.has-top-banner { padding-top: var(--sticky-top, calc(120px + var(--top-banner-h, 0px))); }

/* ── 모바일: 상단을 고정하지 않는다 ──
   배너와 헤더가 본문과 함께 자연스럽게 밀려 올라간다. 고정이 아니므로
   자리를 비워두던 padding-top 도 필요 없다. 하단 탭바만 스크롤 방향에 반응한다
   (body.nav-hidden 토글은 JS가 계속 하고, 상단에는 적용하지 않는다) */
@media (max-width: 768px) {
    .top-banner { position: static; }
    .header { position: static; }
    body.has-top-banner .header { top: auto; }
    body.has-top-banner { padding-top: 0; }
}
.top-banner-track { position: relative; }
/* 슬라이드는 겹쳐두고 활성 항목만 보인다 */
.top-banner-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 1.2s ease; }
.top-banner-slide.on { position: relative; opacity: 1; visibility: visible; }
.top-banner-inner { max-width: 1280px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: center; height: 54px; position: relative; }
.top-banner-link { display: flex; align-items: center; justify-content: center; width: 100%; text-decoration: none; }
.top-banner img { max-width: 100%; height: auto; object-fit: contain; display: block; }
.top-banner-text { font-size: 15px; font-weight: 700; color: #1f2226; }
/* 닫기 버튼은 이미지가 아니라 배너 영역(.top-banner-inner) 오른쪽 끝에 붙인다.
   예전엔 이미지 안쪽 오른쪽에 붙였는데, 폭이 좁은 이미지(정사각 로고 등)면 버튼이 이미지를 덮었다.
   right:28px = 안쪽 여백 20px + 8px 이라, 폭을 꽉 채운 이미지에서는 예전과 같은 자리다 */
.top-banner-media { display: inline-flex; align-items: center; max-width: 100%; height: 100%; }
.top-banner-close { position: absolute; right: 28px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: none; background: none; font-size: 24px; cursor: pointer; line-height: 1; z-index: 2; }
.top-banner-close:hover { opacity: .7; }

@media (max-width: 768px) {
    /* 높이는 관리자에서 넣은 값(인라인 style)을 모바일에서도 그대로 쓴다.
       예전에는 height:auto !important 로 이미지 높이를 따르게 했는데, 그러면
       관리자 높이 설정이 모바일에서 먹지 않았다 */
    .top-banner-inner { padding: 0 12px; }
    .top-banner-text { font-size: 13px; }
    /* 모바일은 화면 오른쪽에서 20px 을 띄운다 */
    .top-banner-close { right: 20px; width: 32px; height: 32px; font-size: 20px; }
}
