/**
 * Premium Header Styles
 * Modern and sophisticated header design
 */

/* ==========================================================================
   Header Base Styles
   ========================================================================== */
.premium-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.7, 0, 0.3, 1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    overflow: visible;
}

.premium-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

.premium-header.hidden {
    transform: translateY(-100%);
}

.header-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    overflow: visible;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 70px;
    transition: height 0.4s cubic-bezier(0.7, 0, 0.3, 1);
    overflow: visible;
}

.premium-header.scrolled .header-inner {
    height: 60px;
}

/* ==========================================================================
   Logo Styles
   ========================================================================== */
.header-logo {
    flex-shrink: 0;
    z-index: 2;
}

.header-logo-img {
    height: 150px;
    width: auto;
    display: block;
}

.logo-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #000;
    transition: transform 0.3s cubic-bezier(0.7, 0, 0.3, 1);
}

.logo-link:hover {
    transform: translateX(5px);
}

.logo-text {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 3px;
    line-height: 1.2;
    background: linear-gradient(135deg, #000 0%, #333 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.3s ease;
}

.logo-tagline {
    font-size: 10px;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-top: 2px;
    transition: opacity 0.3s ease;
}

.premium-header.scrolled .logo-tagline {
    opacity: 0;
    height: 0;
    margin: 0;
}

/* ==========================================================================
   Navigation Styles
   ========================================================================== */
.header-nav {
    flex: 1;
    display: flex !important; /* 強制表示 */
    justify-content: center;
    padding: 0 20px;
    visibility: visible !important;
    overflow: visible;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 15px;
    align-items: center;
}

.menu-item {
    position: relative;
}

.nav-link {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.7, 0, 0.3, 1);
    border-radius: 8px;
    gap: 0px;
    line-height: 1;
}

.nav-en {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1;
    transition: color 0.3s ease;
    order: 1;
}

.nav-ja {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.7;
    letter-spacing: 0.5px;
    line-height: 1;
    margin-top: 2px;
    transition: opacity 0.3s ease;
    order: 2;
    white-space: nowrap;
}

.nav-text {
    position: relative;
    display: block;
    transition: opacity 0.3s cubic-bezier(0.7, 0, 0.3, 1);
}

.nav-link:hover .nav-text {
    opacity: 1;
    color: #D4A574;
}

.nav-link:hover {
    background: rgba(102, 126, 234, 0.08);
    transform: translateY(-1px);
}

.nav-link:hover .nav-en {
    color: #667eea;
}

.nav-link:hover .nav-ja {
    opacity: 1;
}

.nav-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #000;
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.3s cubic-bezier(0.7, 0, 0.3, 1);
}

.nav-link:hover .nav-line {
    transform: scaleX(1);
    transform-origin: left center;
}

/* Current page indicator */
.menu-item.current-menu-item .nav-line {
    transform: scaleX(1);
    opacity: 0.3;
}

/* ==========================================================================
   Dropdown Menu Styles
   ========================================================================== */
.nav-item {
    position: relative;
}

/* ドロップダウンとリンクの間に見えない領域を作る */
.nav-item.has-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
    z-index: 999;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: white;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    min-width: 240px;
    padding: 12px 0;
    z-index: 1000;
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
}

/* 右端の項目のドロップダウンを右寄せにする */
.nav-menu > li:nth-last-child(1) .dropdown-menu,
.nav-menu > li:nth-last-child(2) .dropdown-menu,
.nav-menu > li:nth-last-child(3) .dropdown-menu {
    left: auto;
    right: 0;
    transform-origin: top right;
}

.nav-menu > li:nth-last-child(1):hover .dropdown-menu,
.nav-menu > li:nth-last-child(2):hover .dropdown-menu,
.nav-menu > li:nth-last-child(3):hover .dropdown-menu {
    transform: translateY(0);
}

.nav-item:hover .dropdown-menu,
.nav-item.has-dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition-delay: 0s;
}

/* ドロップダウンメニュー自体にホバーした時も表示を維持 */
.dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    list-style: none;
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 14px 24px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s ease;
    border-radius: 6px;
    margin: 2px 10px;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    padding-left: 28px;
    transform: translateX(2px);
}

/* ==========================================================================
   CTA Buttons
   ========================================================================== */
.header-cta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 30px;
    transition: all 0.3s cubic-bezier(0.7, 0, 0.3, 1);
    overflow: hidden;
}

.btn-reserve {
    background: #000;
    color: #fff;
    border: 1px solid #000;
}

.btn-reserve::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: #fff;
    transition: width 0.3s cubic-bezier(0.7, 0, 0.3, 1);
    z-index: -1;
}

.btn-reserve:hover {
    color: #000;
}

.btn-reserve:hover::before {
    width: 100%;
}

.btn-arrow {
    display: inline-flex;
    transition: transform 0.3s cubic-bezier(0.7, 0, 0.3, 1);
}

.btn-reserve:hover .btn-arrow {
    transform: translateX(3px);
}

.btn-contact {
    padding: 12px 24px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: transparent;
    color: #000;
    white-space: nowrap;
}

.btn-contact:hover {
    background: #000;
    color: #fff;
    border-color: #000;
    transform: translateY(-2px);
}

/* ==========================================================================
   Mobile Menu Toggle
   ========================================================================== */
.menu-toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10000;
}

.toggle-wrapper {
    position: relative;
    width: 28px;
    height: 20px;
}

.toggle-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: #000;
    transition: all 0.3s cubic-bezier(0.7, 0, 0.3, 1);
}

.toggle-line:nth-child(1) {
    top: 0;
}

.toggle-line:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.toggle-line:nth-child(3) {
    bottom: 0;
}

.toggle-text {
    font-size: 10px;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* Active state */
.menu-toggle.active .toggle-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active .toggle-line:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .toggle-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ==========================================================================
   Progress Bar
   ========================================================================== */
.header-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #000;
    width: 0%;
    transition: width 0.1s linear;
}

/* ==========================================================================
   Mobile Menu Header (inside navigation)
   ========================================================================== */
.mobile-menu-header {
    display: none !important;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-menu-logo {
    display: block;
}

.mobile-logo-img {
    height: 50px;
    width: auto;
}

/* ==========================================================================
   Submenu Toggle Button
   ========================================================================== */
.submenu-toggle {
    display: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
}

.submenu-toggle::before,
.submenu-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    background: #333;
    transition: transform 0.3s ease;
}

.submenu-toggle::before {
    transform: translate(-50%, -50%);
}

.submenu-toggle::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.menu-item-has-children.open .submenu-toggle::after {
    transform: translate(-50%, -50%) rotate(0deg);
}

/* ==========================================================================
   Nav CTA Buttons (inside navigation)
   ========================================================================== */
.nav-cta {
    display: none !important;
    flex-direction: row;
    gap: 10px;
    padding: 20px;
    margin-top: auto;
}

.nav-cta .btn {
    display: block;
    flex: 1;
    padding: 14px 16px;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn--outline {
    background: transparent;
    border: 2px solid #333;
    color: #333;
}

.btn--outline:hover {
    background: #333;
    color: #fff;
}

.btn--secondary {
    background: #333;
    color: #fff;
    border: 2px solid #333;
}

.btn--secondary:hover {
    background: #555;
    border-color: #555;
}

/* ==========================================================================
   Full Screen Mobile Menu
   ========================================================================== */
.mobile-menu {
    display: none !important; /* Disabled - using inline navigation instead */
}

.mobile-menu-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 30px;
    overflow-y: auto;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.mobile-logo {
    display: block;
    text-decoration: none;
}

.mobile-logo-img {
    height: 85px;
    width: auto;
    display: block;
}

.mobile-menu-close {
    display: none; /* デスクトップでは非表示 */
}

.mobile-menu-close span,
.mobile-menu-close .close-x {
    display: none !important;
}

/* Mobile Navigation */
.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.7, 0, 0.3, 1);
}

.mobile-menu.active .mobile-menu-item {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu-item a {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    text-decoration: none;
    color: #000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.mobile-menu-item a:hover {
    padding-left: 10px;
}

.menu-number {
    font-size: 12px;
    opacity: 0.4;
    font-weight: 600;
}

.menu-text {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 1px;
}

/* Mobile Footer */
.mobile-menu-footer {
    margin-top: auto;
    padding-top: 40px;
}

.mobile-menu-cta {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.mobile-cta-btn {
    flex: 1;
    padding: 15px;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 30px;
    border: 2px solid #000;
    color: #000;
    transition: all 0.3s ease;
}

.mobile-cta-btn:first-child {
    background: #000;
    color: #fff;
}

.mobile-cta-btn:hover {
    transform: translateY(-2px);
}

.mobile-menu-info {
    font-size: 12px;
    opacity: 0.6;
}

.mobile-menu-info p {
    margin: 5px 0;
}

/* ==========================================================================
   Dropdown Submenu Styles
   ========================================================================== */
.menu-item {
    position: relative;
}

.menu-item.has-submenu > .nav-link::after {
    content: '▼';
    font-size: 8px;
    margin-left: 4px;
    opacity: 0.5;
    transition: transform 0.3s ease;
    vertical-align: middle;
}

.menu-item.has-submenu:hover > .nav-link::after {
    transform: rotate(180deg);
}

.submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 8px;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.25s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    z-index: 100;
    margin-top: 10px;
}

.menu-item.has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.submenu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #ffffff;
}

.submenu li {
    list-style: none;
    padding: 0;
    margin: 0;
}

.submenu a {
    display: block;
    padding: 10px 16px;
    margin: 2px 0;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-radius: 8px;
}

.submenu a:hover {
    background: rgba(212, 165, 116, 0.12);
    color: #D4A574;
    padding-left: 20px;
    transform: translateX(2px);
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */
@media (max-width: 1200px) {
    .header-wrapper {
        padding: 0 30px;
    }
    
    .nav-menu {
        gap: 12px;
    }
    
    .nav-link {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .header-btn {
        font-size: 12px;
        padding: 10px 20px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .header-wrapper {
        padding: 0 20px;
    }

    .nav-menu {
        gap: 8px;
    }

    .header-nav {
        padding: 0 10px;
    }

    .nav-link {
        font-size: 12px;
        padding: 6px 8px;
    }

    .menu-toggle {
        display: none !important;
    }

    .header-cta {
        gap: 10px;
    }

    .btn-reserve {
        display: flex !important;
        align-items: center;
        gap: 5px;
    }

    .btn-text {
        display: inline-block;
    }
}

@media (max-width: 768px) {
    .premium-header {
        padding: 0 !important;
    }

    .header-wrapper {
        padding: 0 15px;
    }

    .header-inner {
        height: 60px;
        justify-content: space-between;
        padding: 10px 0;
    }

    .header-logo {
        margin: 0;
        padding: 0;
    }

    .header-logo-img {
        height: 50px !important;
        transition: height 0.3s ease;
    }

    /* モバイルナビゲーション */
    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        max-width: 85vw;
        height: 100vh;
        background: #fff;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
        transition: right 0.4s cubic-bezier(0.7, 0, 0.3, 1);
        z-index: 10000;
        overflow-y: auto;
        padding: 0;
    }

    .header-nav.active {
        right: 0;
    }

    /* ナビゲーションオーバーレイ */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    .nav-menu {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 0;
        margin: 0;
        gap: 0;
    }

    /* モバイルメニューヘッダー表示 */
    .mobile-menu-header {
        display: flex !important;
    }

    /* モバイルメニュークローズボタン */
    .mobile-menu-close {
        display: flex !important; /* モバイルで表示 */
        position: relative;
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0;
    }

    .mobile-menu-close::before,
    .mobile-menu-close::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 2px;
        background: #333;
    }

    .mobile-menu-close::before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .mobile-menu-close::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    /* スタイルの重複を防ぐ */
    .mobile-menu-close span,
    .mobile-menu-close .close-x {
        display: none !important;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        position: relative;
    }

    .menu-item-has-children > .nav-link {
        position: static;
    }

    .nav-link {
        display: flex;
        width: 100%;
        padding: 18px 20px;
        font-size: 15px;
        font-weight: 500;
        justify-content: flex-start;
        border-radius: 0;
    }

    .nav-text {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .nav-en {
        font-size: 15px;
        font-weight: 600;
    }

    .nav-ja {
        font-size: 12px;
        opacity: 0.6;
    }

    .nav-link:hover {
        background: rgba(0, 0, 0, 0.03);
        transform: none;
    }

    /* モバイルでnav-linkの::afterを非表示 */
    .nav-link::after {
        display: none !important;
    }

    /* サブメニュートグルボタン表示 */
    .submenu-toggle {
        display: block !important;
        position: absolute !important;
        right: 10px !important;
        top: 18px !important;
        height: 40px !important;
        transform: none !important;
    }

    .menu-item-has-children.open .submenu-toggle {
        top: 18px !important;
        transform: none !important;
    }

    /* ドロップダウンメニューのモバイル対応 */
    .dropdown-menu,
    .sub-menu {
        position: static;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        background: rgba(0, 0, 0, 0.02);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .menu-item-has-children.open .dropdown-menu,
    .menu-item-has-children.open .sub-menu {
        display: block;
        max-height: 500px;
    }

    .dropdown-menu li,
    .sub-menu li {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .dropdown-menu a,
    .sub-menu a {
        padding: 14px 20px 14px 40px;
        font-size: 14px;
        margin: 0;
        border-radius: 0;
    }

    .dropdown-menu a:hover,
    .sub-menu a:hover {
        background: rgba(0, 0, 0, 0.05);
        padding-left: 45px;
        transform: none;
    }

    /* Nav CTA表示 */
    .nav-cta {
        display: flex !important;
        border-bottom: none;
    }
    
    .header-cta {
        display: none !important;
    }

    .header-social {
        display: none !important;
    }

    /* モバイルメニュートグルボタン - 完全リセット */
    .mobile-menu-toggle {
        all: unset !important;
        display: block !important;
        width: 30px !important;
        height: 24px !important;
        position: relative !important;
        cursor: pointer !important;
        z-index: 10001 !important;
    }

    /* ハンバーガーライン - 完全リセットして再定義 */
    .mobile-menu-toggle .hamburger-line {
        all: unset !important;
        display: block !important;
        width: 30px !important;
        height: 3px !important;
        background-color: #333 !important;
        position: absolute !important;
        left: 0 !important;
        transition: all 0.3s ease !important;
    }

    .mobile-menu-toggle .hamburger-line:nth-child(1) {
        top: 0 !important;
    }

    .mobile-menu-toggle .hamburger-line:nth-child(2) {
        top: 50% !important;
        transform: translateY(-50%) !important;
    }

    .mobile-menu-toggle .hamburger-line:nth-child(3) {
        bottom: 0 !important;
    }

    /* アクティブ状態（×マーク） */
    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        top: 50% !important;
        transform: translateY(-50%) rotate(45deg) !important;
    }

    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0 !important;
    }

    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        bottom: 50% !important;
        transform: translateY(50%) rotate(-45deg) !important;
    }

    .header-actions {
        display: flex;
        align-items: center;
    }
    
    /* When scrolled on mobile */
    .premium-header.scrolled .header-inner {
        gap: 10px;
    }
    
    .premium-header.scrolled .header-logo-img {
        height: 75px;
    }
    
    /* Touch-friendly hover states */
    @media (hover: none) {
        .menu-item.has-submenu .submenu {
            display: none;
        }
        
        .menu-item.has-submenu.touch-open .submenu {
            display: block;
            opacity: 1;
            visibility: visible;
            transform: translateX(0) translateY(0);
        }
    }
}

@media (max-width: 480px) {
    .header-logo-img {
        height: 80px;
    }
    
    .nav-menu {
        gap: 3px;
    }
    
    .nav-link {
        font-size: 10px;
        padding: 5px 6px;
    }
    
    .header-cta {
        display: none !important;
    }

    .header-cta .btn-reserve {
        display: none !important;
    }

    .header-cta .btn-contact {
        display: none !important;
    }
}