/**
 * Header Bar 共通CSS - BEM Pattern System v3.0
 * 依存: lib/common/utilities.css, lib/common/animations.css
 * 注意: グリッドシステムはaffiliated-stores.cssに移行済み
 * 全てのheader-barパターンで共通的に使用されるスタイル
 * 設計システム: BEM + CSS変数 + パターン化
 */

/* ==========================================================================
   親テーマスタイル打ち消し - 共通設定
   ========================================================================== */

/* 親テーマの.l-header__bar .l-header__barInner ul li aのborder打ち消し */
.header-bar-reset .l-header__bar .l-header__barInner ul li a {
    border-top: none !important;
    border-bottom: none !important;
}

/* ==========================================================================
   CSS Variables - 全パターン共通変数
   ========================================================================== */

:root {
    /* 基本カラー */
    --hb-bg-color: transparent;
    --hb-text-primary-color: var(--arkhe-color-text, #333);
    --hb-text-secondary-color: var(--arkhe-color-text-sub, #666);
    --hb-border-color: rgba(0, 0, 0, 0.1);
    
    /* 状態カラー */
    --hb-active-bg-color: var(--arkhe-color-primary, #007cba);
    --hb-active-text-color: white;
    --hb-hover-bg-color: var(--arkhe-color-bg-light, #f8f9fa);
    --hb-hover-text-color: var(--arkhe-color-primary, #007cba);
    
    /* サブメニューカラー */
    --hb-submenu-text-color: var(--hb-text-primary-color);
    
    /* レイアウト */
    --hb-padding: 0.5rem;
    --hb-gap: 0;
    --hb-border-width: 1px;
    --hb-border-radius: 0;
    
    /* タイポグラフィ */
    --hb-font-weight-primary: 500;
    --hb-font-weight-secondary: 300;
    --hb-letter-spacing-secondary: 0.5px;
}

/* ==========================================================================
   Legacy Container Integration - 既存システムとの統合
   ========================================================================== */

.l-header__barInner {
    display: flex;
    align-items: center;
    height: 100%;
    width: 100%;
}

/* ==========================================================================
   Header Bar Container - BEMヘッダーバーコンテナ
   ========================================================================== */

.hb-container {
    display: flex;
    align-items: center;
    height: 100%;
    width: 100%;
    background-color: var(--hb-bg-color);
}

/* ==========================================================================
   Header Bar Menu - BEMメインメニューシステム
   ========================================================================== */

.hb-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    gap: var(--hb-gap);
}

/* ==========================================================================
   Menu Items - BEMメニューアイテム
   ========================================================================== */

.hb-item {
    position: relative;
    text-align: center;
    flex: 1;
    border-right: var(--hb-border-width) solid var(--hb-border-color);
}

.hb-item:last-child {
    border-right: none;
}

.hb-item--dropdown {
    position: relative;
}

.hb-item--dropdown .hb-link {
    padding-right: 2rem;
}

/* ==========================================================================
   Menu Links - BEMメニューリンク
   ========================================================================== */

.hb-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--hb-text-primary-color);
    padding: var(--hb-padding);
    transition: all 0.3s ease;
    height: 100%;
    border-radius: var(--hb-border-radius);
    margin: 0.5rem 0.25rem;
}

.hb-item:hover {
    background-color: var(--hb-hover-bg-color);
}

.hb-item:hover .hb-link {
    color: var(--hb-hover-text-color);
    text-decoration: none;
}

.hb-item:hover .hb-text--primary,
.hb-item:hover .hb-text--secondary {
    color: var(--hb-hover-text-color);
}

/* ==========================================================================
   Menu Item Text - BEMテキストスタイル
   ========================================================================== */

.hb-text--primary {
    font-weight: var(--hb-font-weight-primary);
    margin-bottom: 2px;
    line-height: 1.2;
    color: var(--hb-text-primary-color);
}

.hb-text--secondary {
    color: var(--hb-text-secondary-color);
    text-transform: uppercase;
    letter-spacing: var(--hb-letter-spacing-secondary);
    font-weight: var(--hb-font-weight-secondary);
    line-height: 1.2;
}

.hb-text--submenu {
    color: var(--hb-submenu-text-color);
    font-weight: var(--hb-font-weight-primary);
    line-height: 1.2;
    font-size: 0.9rem;
}

/* ==========================================================================
   Dropdown Icon - BEMドロップダウンアイコン
   ========================================================================== */

.hb-icon--dropdown {
    font-size: 1.2rem;
    margin-left: 0.3rem;
    transition: transform 0.3s ease;
    position: absolute;
    right: 1rem;
    top: 50%;
    line-height: 1;
    color: var(--hb-text-primary-color);
}

/* ==========================================================================
   Sub Menu (Dropdown) - BEMサブメニューシステム
   ========================================================================== */

.hb-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    display: none;
}

.hb-item--dropdown:hover .hb-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    display: block;
}

.hb-submenu .hb-item {
    width: 100%;
    text-align: left;
    border-right: none;
    flex: none;
}

.hb-submenu .hb-link {
    padding: 0.75rem 1rem;
    min-height: auto;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.hb-submenu .hb-item:hover {
    background-color: var(--hb-hover-bg-color);
}

.hb-submenu .hb-item:hover .hb-link {
    color: var(--hb-hover-text-color);
}

.hb-submenu .hb-text--primary {
    font-size: 0.9rem;
}

.hb-submenu .hb-text--secondary {
    font-size: 0.7rem;
}

/* ==========================================================================
   Active State (Current Page) - BEMアクティブ状態
   ========================================================================== */

.hb-item--active,
.hb-item--current {
    background-color: var(--hb-active-bg-color);
}

.hb-item--active .hb-link,
.hb-item--current .hb-link {
    color: var(--hb-active-text-color);
}

.hb-item--active .hb-text--primary,
.hb-item--active .hb-text--secondary,
.hb-item--current .hb-text--primary,
.hb-item--current .hb-text--secondary {
    color: var(--hb-active-text-color);
}

.hb-item--active .hb-text--secondary,
.hb-item--current .hb-text--secondary {
    opacity: 0.8;
}

/* サブメニューのアクティブ状態 */
.hb-submenu .hb-item--active,
.hb-submenu .hb-item--current {
    background-color: var(--hb-active-bg-color);
}

.hb-submenu .hb-item--active .hb-link,
.hb-submenu .hb-item--current .hb-link {
    color: var(--hb-active-text-color);
}

/* ==========================================================================
   WordPress Class Mapping - WordPress標準クラスとの統合
   ========================================================================== */

/* 全ての現在ページスタイルは動的CSS（header-patterns.php）で管理 */

/* ==========================================================================
   Responsive Design - レスポンシブ対応
   ========================================================================== */

@media (max-width: 768px) {
    :root {
        --hb-padding: 0.4rem 0.2rem;
    }
    
    .hb-icon--dropdown,
    .dropdown-icon {
        display: none;
    }

    .hb-item--dropdown .hb-link{
        padding-right:0;
    }
    
    /* スマホではサブメニューを完全に非表示 */
    .hb-submenu {
        display: none !important;
    }
    
    .hb-item--dropdown:hover .hb-submenu {
        display: none !important;
    }
}

@media (max-width: 480px) {
    :root {
        --hb-padding: 0.3rem 0.1rem;
    }
}

/* ==========================================================================
   Pattern Base Classes - パターン基盤クラス
   ========================================================================== */

.hb-pattern-default {
    /* デフォルトパターンの基盤設定 */
}

.hb-pattern-simple {
    /* シンプルパターンの基盤設定 */
    --hb-border-color: transparent;
    --hb-gap: 1rem;
}

