/* ============================================================================
   Frontend Header Styles - 프론트엔드 헤더 스타일
   ============================================================================ */

/* ===== 헤더 기본 스타일 ===== */
.frontend-header {
    position: relative;
    z-index: 1000;
    width: 100%;
    height: var(--header-height, 80px);
    background-color: var(--header-bg-color, #ffffff);
    color: var(--header-text-color, #333333);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.frontend-header__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Sticky Header */
.frontend-header--sticky {
    position: sticky;
    top: 0;
}

.frontend-header--sticky.is-scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: var(--header-bg-color, #ffffff);
}

/* Transparent Header */
.frontend-header--transparent {
    background-color: transparent;
    box-shadow: none;
    position: absolute;
    top: 0;
    left: 0;
}

.frontend-header--transparent.is-scrolled {
    background-color: var(--header-bg-color, #ffffff);
    position: fixed;
}

/* 로고 영역 */
.frontend-header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.frontend-header__logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.frontend-header__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--header-text-color, #333333);
}

/* 네비게이션 영역 */
.frontend-header__nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 검색바 */
.frontend-header__search {
    flex-shrink: 0;
}

.frontend-header__search-form {
    position: relative;
}

.frontend-header__search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.frontend-header__search-input {
    width: 250px;
    height: 40px;
    padding: 0 40px 0 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s;
    background-color: #f8f8f8;
}

.frontend-header__search-input:focus {
    outline: none;
    border-color: #FF6B35;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.1);
}

.frontend-header__search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s;
    font-size: 14px;
}

.frontend-header__search-btn:hover {
    color: #FF6B35;
}

/* 햄버거 메뉴 버튼 */
.frontend-header__hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 1001;
}

.frontend-header__hamburger-line {
    width: 100%;
    height: 3px;
    background-color: var(--header-text-color, #333333);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.frontend-header__hamburger.is-open .frontend-header__hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.frontend-header__hamburger.is-open .frontend-header__hamburger-line:nth-child(2) {
    opacity: 0;
}

.frontend-header__hamburger.is-open .frontend-header__hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* 모바일 메뉴 */
.frontend-header__mobile-menu {
    display: none;
    position: fixed;
    top: var(--header-height, 80px);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.frontend-header__mobile-menu.is-open {
    opacity: 1;
    pointer-events: auto;
}

.frontend-header__mobile-menu-inner {
    background-color: #ffffff;
    max-height: calc(100vh - var(--header-height, 80px));
    overflow-y: auto;
    padding: 20px;
}

.frontend-header__mobile-menu-placeholder {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 14px;
}

/* ===== 1단: 프로모션 배너 ===== */
.promo-banner {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    color: white;
    padding: 10px 0;
    position: relative;
    z-index: 1001;
    animation: slideDown 0.3s ease-out;
}

.promo-banner__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.promo-banner__content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.promo-banner__icon {
    font-size: 18px;
    animation: pulse 2s infinite;
}

.promo-banner__text {
    font-size: 14px;
    line-height: 1.4;
}

.promo-banner__text strong {
    font-weight: 700;
    margin-right: 8px;
}

.promo-banner__close {
    background: transparent;
    border: 2px solid white;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
    font-size: 14px;
}

.promo-banner__close:hover {
    background: white;
    color: #FF6B35;
    transform: rotate(90deg);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* ===== 2단: 유틸리티 바 ===== */
.utility-bar {
    background-color: #333;
    color: #fff;
    height: 35px;
    position: relative;
    z-index: 1000;
}

.utility-bar__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
}

.utility-bar__menu {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    margin: 0;
    padding: 0;
    height: 100%;
}

.utility-bar__item {
    margin: 0;
}

.utility-bar__link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.utility-bar__link:hover {
    color: white;
}

.utility-bar__link i {
    font-size: 12px;
}

/* 관리자 버튼 (강조) */
.utility-bar__item--admin {
    margin-right: 10px;
    padding-right: 15px;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.utility-bar__link--admin {
    background: linear-gradient(135deg, #FF6B35 0%, #e85a2a 100%);
    color: white !important;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 500;
}

.utility-bar__link--admin:hover {
    background: linear-gradient(135deg, #e85a2a 0%, #d14a1a 100%);
    color: white !important;
}

/* ===== 3단: 메인 헤더 ===== */
.main-header {
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.main-header__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

/* 로고 */
.main-header__logo {
    flex-shrink: 0;
}

.main-header__logo-link {
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
    color: #1a1a1a;
    font-size: 24px;
    font-weight: 700;
}

.main-header__logo-subtitle {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.85;
    color: #666;
}

/* 메인 메뉴 */
.main-header__nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-header__menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 40px;
    margin: 0;
    padding: 0;
}

.main-header__menu-item {
    position: relative;
}

.main-header__menu-link {
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    transition: color 0.2s;
}

.main-header__menu-link:hover {
    color: #FF6B35;
}

.main-header__menu-link i:first-child {
    font-size: 14px;
}

.main-header__menu-arrow {
    font-size: 10px !important;
    margin-left: 2px;
    transition: transform 0.3s;
}

.main-header__menu-item--has-dropdown:hover .main-header__menu-arrow {
    transform: rotate(180deg);
}

/* 2뎁스 드롭다운 */
.main-header__dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    padding: 8px 0;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    pointer-events: none;
}

.main-header__menu-item--has-dropdown:hover .main-header__dropdown {
    opacity: 1;
    visibility: visible;
    margin-top: 0;
    pointer-events: auto;
}

.main-header__dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-header__dropdown-item {
    margin: 0;
}

.main-header__dropdown-link {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.main-header__dropdown-link:hover {
    background-color: #f8f8f8;
    color: #FF6B35;
}

/* 검색 버튼 */
.main-header__search {
    flex-shrink: 0;
}

.main-header__search-btn {
    background: transparent;
    border: 2px solid #e0e0e0;
    color: #666;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.main-header__search-btn:hover {
    border-color: #FF6B35;
    color: #FF6B35;
    background-color: #fff5f0;
}

/* 햄버거 메뉴 (모바일) */
.main-header__hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.main-header__hamburger-line {
    width: 25px;
    height: 3px;
    background-color: #333;
    transition: all 0.3s;
    border-radius: 2px;
}

.main-header__hamburger--open .main-header__hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.main-header__hamburger--open .main-header__hamburger-line:nth-child(2) {
    opacity: 0;
}

.main-header__hamburger--open .main-header__hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* 모바일 메뉴 */
.main-header__mobile-menu {
    display: none;
    background: white;
    border-top: 1px solid #e0e0e0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.main-header__mobile-menu--open {
    max-height: 500px;
}

.main-header__mobile-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-header__mobile-item {
    border-bottom: 1px solid #f0f0f0;
}

.main-header__mobile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
}

.main-header__mobile-link:hover {
    background-color: #f8f8f8;
    color: #FF6B35;
}

.main-header__mobile-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: #f8f8f8;
}

.main-header__mobile-subitem {
    border-top: 1px solid #e8e8e8;
}

.main-header__mobile-sublink {
    display: block;
    padding: 12px 20px 12px 50px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.main-header__mobile-sublink:hover {
    color: #FF6B35;
    background-color: white;
}

/* ===== 반응형 (모바일) ===== */
@media (max-width: 768px) {
    /* Frontend Header */
    .frontend-header {
        height: 60px;
        --header-height: 60px;
    }

    .frontend-header__container {
        padding: 0 15px;
        gap: 10px;
    }

    .frontend-header__logo-img {
        height: 30px;
    }

    .frontend-header__title {
        font-size: 18px;
    }

    /* 네비게이션 숨김 (모바일 메뉴로 대체) */
    .frontend-header__nav {
        display: none;
    }

    /* 검색바 축소 */
    .frontend-header__search-input {
        width: 180px;
        height: 36px;
        font-size: 13px;
    }

    /* 햄버거 메뉴 표시 */
    .frontend-header__hamburger {
        display: flex;
    }

    /* 모바일 메뉴 표시 */
    .frontend-header__mobile-menu {
        display: block;
    }

    /* 프로모션 배너 */
    .promo-banner {
        padding: 8px 0;
    }

    .promo-banner__text {
        font-size: 12px;
    }

    .promo-banner__text strong {
        display: block;
        margin-bottom: 2px;
    }

    /* 유틸리티 바 */
    .utility-bar {
        display: none;
    }

    /* 메인 헤더 */
    .main-header__container {
        height: 60px;
    }

    .main-header__logo-link {
        font-size: 18px;
    }

    .main-header__logo-subtitle {
        display: none;
    }

    .main-header__nav {
        display: none;
    }

    .main-header__search {
        margin-right: 10px;
    }

    .main-header__search-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .main-header__hamburger {
        display: flex;
    }

    .main-header__mobile-menu {
        display: block;
    }
}

@media (max-width: 480px) {
    /* Frontend Header */
    .frontend-header__logo-img {
        height: 26px;
    }

    .frontend-header__title {
        font-size: 16px;
    }

    /* 검색바 더 축소 또는 숨김 */
    .frontend-header__search {
        display: none; /* 아주 작은 화면에서는 검색바 숨김 */
    }

    /* 프로모션 배너 */
    .promo-banner__icon {
        font-size: 16px;
    }

    .promo-banner__close {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    /* 메인 헤더 */
    .main-header__logo-link {
        font-size: 16px;
    }
}
