/**
 * 메인 신규 비주얼 (Hero + 검색바)
 * 참고 커밋 cd2fcbf8 www/css/Main/topBanner.css 의 hero 부분 스타일을 이식.
 * 인원/날짜 필드는 자체 팝업이 아니라 공통 tpSearchModal 을 열기 때문에
 * .guests-popup / .location-popup 관련 스크립트 로직은 필요 없음.
 */

/* ===== HERO 배경 ===== */
.hero {
    position: relative;
    width: 100%;
    overflow: visible;
    background-color: #0d3d52;
}
.hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-image: url("../../images/main/banner/hero_bg.webp");
    background-size: cover;
    background-position: center 40%;
}
.hero__inner {
    position: relative;
    z-index: 2;
    max-width: 1270px;
    margin: 0 auto;
    padding: 82px 20px 48px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.hero__headline {
    color: #fff;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.5px;
    margin: 0;
}

/* ===== 헤드라인 아래 리드 텍스트 + 배지들 ===== */
.hero__badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 24px;
}
/* 좌측 2줄 리드 텍스트 (배경 없음) */
.hero-lead {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.4;
    margin-right: 6px;
}
.hero-lead__line1 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}
.hero-lead__line2 {
    color: #F5DF4D;
    font-size: 16px;
    font-weight: 600;
}
/* 우측 흰색 라운드 pill 배지 (아이콘 + 검정 텍스트) */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 17px 0 16px;
    border-radius: 999px;
    background: #fff;
    color: #545454;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.hero-badge__ico {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px;
    flex-shrink: 0;
    display: block;
}

/* ===== 검색바 ===== */
.hero-search-bar {
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(6, 14, 30, 0.28);
    padding: 12px 10px 12px 20px;
}
.hero-search-bar .field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px;
    min-width: 0;
}
.hero-search-bar .field-icon {
    flex-shrink: 0;
    width: 25px; height: 25px;
    color: #1C1C1E;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-search-bar .field-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}
.hero-search-bar .field-value {
    font-size: 17px;
    font-weight: 600;
    color: #1C1C1E;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 필드별 flex 비율 */
.hero-search-bar .field-location { flex: 0 0 19%; padding-left: 0; }
.hero-search-bar .field-dates    { flex: 1 1 300px; }
.hero-search-bar .field-guests   { flex: 0 1 250px; }

/* 날짜 뒤 박수 뱃지 */
.hero-search-bar .nights-badge {
    flex-shrink: 0;
    margin-left: 8px;
    padding: 0;
    background: transparent;
    color: #1C1C1E;
    font-size: 16px;
    font-weight: 600;
}
.hero-search-bar .nights-badge:empty { display: none; }

/* 필드 사이 세로 구분선 */
.hero-search-bar .divider {
    flex-shrink: 0;
    align-self: center;
    width: 1px;
    height: 32px;
    background-color: #E5E5EA;
}

/* tpSearchModal 오픈 영역 (날짜 + 인원 + 검색버튼 묶음) */
.hero-search-bar .hero-open-search {
    display: flex;
    align-items: stretch;
    flex: 1;
    cursor: pointer;
}

/* 검색 버튼 */
.hero-search-bar .search-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 108px;
    height: 44px;
    align-self: center;
    border: none;
    border-radius: 5px;
    background: #157CED;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}
.hero-search-bar .search-btn:hover { background: #0c5cb1; }

/* ===== 지역 커스텀 드롭다운 ===== */
.hero-search-bar .field-location { position: relative; }
.hero-search-bar .custom-select-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}
.hero-search-bar .custom-select-display {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding-right: 16px;
    font-size: 17px;
    font-weight: 600;
    color: #1C1C1E;
    cursor: pointer;
}
.hero-search-bar .custom-select-display .select-chevron {
    position: absolute;
    top: 50%; right: 0;
    transform: translateY(-50%);
    width: 14px; height: 14px;
    color: #9AA1AC;
    pointer-events: none;
    transition: transform 0.2s ease;
}
.hero-search-bar .field-location.is-open .select-chevron {
    transform: translateY(-50%) rotate(180deg);
}
.hero-search-bar .location-popup {
    position: absolute;
    top: calc(100% + 20px); left: 0;
    width: 268px;
    background: #fff;
    border: 1px solid #EEF0F3;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    padding: 8px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}
.hero-search-bar .field-location.is-open .location-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.hero-search-bar .location-popup__header { display: none; }
.hero-search-bar .custom-select-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.hero-search-bar .custom-option {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 600;
    color: #1C1C1E;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.hero-search-bar .custom-option:hover { background: #EEF4FF; }
.hero-search-bar .custom-option.is-selected { background: #EEF4FF; color: #157CED; }

/* ===== 태블릿 구간 (940~761px) — field-location 고정 26% 해제 ===== */
@media (max-width: 940px) and (min-width: 761px) {
    .hero-search-bar .field-location {
        flex: 1 1 200px;
        min-width: 160px;
    }
    .hero-search-bar .field-dates  { flex: 1 1 220px; }
    .hero-search-bar .field-guests { flex: 1 1 200px; }
    .hero-search-bar .field { padding: 0 16px; }
    .hero-search-bar .field-value,
    .hero-search-bar .custom-select-display { font-size: 15px; }
}

/* ===== 반응형 (모바일) ===== */
@media (max-width: 760px) {
    .hero__inner { padding: 40px 16px 32px; gap: 14px; }
    .hero__headline { font-size: 25px; line-height: 1.35; }

    /* 리드 텍스트 — 가로 인라인 (푸꾸옥 나트랑 / 호텔 1박만 예약해도) */
    .hero__badges { gap: 6px; row-gap: 8px; }
    .hero-lead {
        flex-direction: row;
        align-items: baseline;
        gap: 6px;
        margin-right: 0;
        flex-basis: 100%;
    }
    .hero-lead__line1,
    .hero-lead__line2 { font-size: 15px; }

    .hero-badge {
        height: 28px;
        padding: 0 12px 0 10px;
        font-size: 12px;
    }
    .hero-badge__ico { width: 14px !important; height: 14px !important; max-width: 14px; }

    /* 검색바 — 세로 스택. 필드마다 얇은 밑줄, 검색 버튼은 최하단 별도 라인 */
    .hero-search-bar {
        flex-wrap: wrap;
        padding: 12px 14px;
        gap: 0;
        border-radius: 14px;
    }
    .hero-search-bar .divider { display: none; }
    .hero-search-bar .field {
        flex: 1 1 100% !important;
        padding: 12px 4px;
        border-bottom: 1px solid #EEF0F3;
    }
    .hero-search-bar .field-icon {
        width: 20px;
        height: 20px;
    }
    .hero-search-bar .field-icon svg {
        width: 20px;
        height: 20px;
    }
    /* 좁은 폭에서 긴 텍스트가 필드 폭을 밀어내는 문제 방지 */
    .hero-search-bar .field-text {
        overflow: hidden;
        min-width: 0;
        flex: 1 1 0;
    }
    .hero-search-bar .field-value {
        font-size: 15px;
        max-width: 100%;
    }
    .hero-search-bar .custom-select-display {
        font-size: 15px;
    }
    .hero-search-bar .nights-badge {
        font-size: 13px;
        padding: 3px 8px;
    }
    .hero-search-bar .field-guests { border-bottom: none; }
    .hero-search-bar .hero-open-search {
        flex: 1 1 100%;
        flex-direction: column;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    .hero-search-bar .search-btn-wrap {
        width: 100%;
        margin-top: 8px;
        box-sizing: border-box;
    }
    .hero-search-bar .search-btn {
        width: 100%;
        box-sizing: border-box;
        border-radius: 10px;
        height: 40px;
        font-size: 16px;
    }
    .hero-search-bar .location-popup { width: 100%; }
}
