/**
 * ZOZOTOWN風ヘッダースタイル
 *
 * @package Welcart
 * @subpackage Welcart_Basic
 */

/* ==========================================================================
   ZOZOTOWN風ヘッダー
   ========================================================================== */

/* ヘッダー全体 */
.zozo-header {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.zozo-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ヘッダー内側コンテナ */
.zozo-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 30px;
    flex-wrap: nowrap;
}

/* ロゴ */
.zozo-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 60px;
}

.zozo-logo a {
    text-decoration: none;
    color: #333;
    display: block;
    transition: opacity 0.2s ease;
}

.zozo-logo a:hover {
    opacity: 0.8;
}

.zozo-logo .site-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
    color: #333;
    text-shadow: none;
}

.zozo-logo .site-description {
    font-size: 12px;
    color: #666;
    margin: 5px 0 0 0;
    font-weight: 400;
}

.zozo-logo .custom-logo-link img {
    max-height: 50px;
    width: auto;
    vertical-align: middle;
}

/* PC画面でのヘッダーロゴサイズ調整 - 優先度を上げて確実に適用 */
.zozo-header-logo img.custom-logo,
.zozo-logo img.custom-logo,
.zozo-logo .custom-logo-link img {
    max-height: 60px !important; /* 60pxに拡大、!importantで優先度を上げる */
    max-width: none !important; /* max-widthの制限を解除 */
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 0 !important;
}

/* 検索フォーム - PC画面での中央配置 */
.zozo-search {
    flex: 0 1 400px;
    margin: 0 auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.zozo-search form {
    display: flex;
    position: relative;
    width: 100%;
}

.zozo-search input[type="text"] {
    width: 100%;
    padding: 8px 40px 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: #f8f8f8;
    color: #333;
    flex-grow: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.zozo-search input[type="text"]:focus {
    border-color: #333;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.zozo-search input[type="text"]::placeholder {
    color: #999;
    font-size: 13px;
}

.zozo-search input[type="submit"],
.zozo-search button[type="submit"] {
    position: absolute;
    right: 0;
    top: 0;
    background: #007cba;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 0 4px 4px 0;
    transition: all 0.2s ease;
    width: 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zozo-search input[type="submit"]:hover,
.zozo-search button[type="submit"]:hover {
    background-color: #005a87;
    color: white;
}

.zozo-search input[type="submit"]::before,
.zozo-search button[type="submit"] i {
    font-family: "FontAwesome";
    font-size: 14px;
    line-height: 1;
}

.zozo-search input[type="submit"]::before {
    content: "\f002";
}

/* アカウント・カート */
.zozo-account-cart {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.zozo-cart,
.zozo-account {
    position: relative;
}

.zozo-cart a,
.zozo-account a {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.zozo-cart a:hover,
.zozo-account a:hover {
    background-color: #f5f5f5;
    color: #000;
    transform: translateY(-1px);
}

.zozo-cart i,
.zozo-account i {
    font-size: 16px;
    color: #666;
    transition: color 0.2s ease;
}

.zozo-cart a:hover i,
.zozo-account a:hover i {
    color: #333;
}

.cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .zozo-header-container {
        padding: 0 15px;
    }
    
    .zozo-header-content {
        flex-direction: row; /* スマホでも横並びに */
        flex-wrap: nowrap;
        justify-content: space-between; /* ロゴとアイコンを両端に配置 */
        padding: 10px 0;
        gap: 15px;
        align-items: center;
    }
    
    .zozo-logo {
        order: 1;
        flex: none;
        width: auto;
        text-align: left;
        min-height: auto;
        justify-content: flex-start;
    }
    
    .zozo-logo .site-title {
        font-size: 22px; /* サイズを大きく */
        font-weight: bold;
    }
    
    .zozo-account-cart {
        order: 2;
        gap: 15px;
        justify-content: flex-end;
        align-self: center; /* 中央揃えに変更 */
        flex-shrink: 0; /* サイズを固定 */
    }
    
    .zozo-search {
        display: none !important; /* スマホでは検索バーを完全に非表示 */
    }
    
    /* 念のため、他のクラス名でも非表示にする */
    .zozo-search,
    .zozo-search form,
    .zozo-search .s-box,
    .zozo-search input,
    .zozo-search button {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }

    .zozo-cart a,
    .zozo-account a {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .zozo-cart span,
    .zozo-account span {
        display: none;
    }
    
    .zozo-cart i,
    .zozo-account i {
        font-size: 16px;
    }

    .zozo-header-logo img.custom-logo,
    .zozo-logo img.custom-logo,
    .zozo-logo .custom-logo-link img {
        max-height: 70px !important; /* 55pxから70pxに拡大 */
        max-width: 140px !important; /* 55pxから140pxに拡大 */
        width: auto !important;
        height: auto !important;
    }
}

@media (max-width: 480px) {
    .zozo-header-container {
        padding: 0 10px;
    }
    
    .zozo-logo .site-title {
        font-size: 16px;
    }
    
    .zozo-search input[type="text"] {
        font-size: 13px;
    }
}

/* ハンバーガーメニュー */
.zozo-hamburger-menu {
    display: none; /* デフォルトでは非表示 */
}

.hamburger-button {
    background: none;
    border: none;
    color: #333;
    font-size: 18px;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.hamburger-button:hover {
    background: #f0f0f0;
}

/* スマホ版でハンバーガーメニューを表示 */
@media (max-width: 768px) {
    .zozo-hamburger-menu {
        display: block;
        order: 1; /* ハンバーガーメニューを最初に */
        margin-right: 15px;
    }
    
    .zozo-logo {
        order: 2; /* ロゴを2番目に */
        flex: 1; /* ロゴエリアを拡張 */
    }
    
    .zozo-cart {
        order: 3; /* カートを3番目に */
        margin-right: 10px;
    }
    
    .zozo-account {
        order: 4; /* アカウントを最後に */
    }
    
    .zozo-header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 10px;
    }
    
    .zozo-cart a,
    .zozo-account a {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px;
        color: #333;
        text-decoration: none;
        border-radius: 4px;
        transition: background 0.3s ease;
        min-width: 40px;
        height: 40px;
    }
    
    .zozo-cart a:hover,
    .zozo-account a:hover {
        background: #f0f0f0;
    }
    
    .zozo-cart i,
    .zozo-account i {
        font-size: 18px;
    }
    
    .zozo-cart span,
    .zozo-account span {
        display: none; /* スマホではテキストを非表示 */
    }
    
    .zozo-cart {
        position: relative;
    }
    
    .cart-count {
        position: absolute;
        top: 2px;
        right: 2px;
        background: #ff4757;
        color: white;
        border-radius: 50%;
        font-size: 11px;
        padding: 2px 6px;
        min-width: 16px;
        height: 16px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }
}

/* モバイルサイドメニュー */
.mobile-side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-side-menu.active {
    visibility: visible;
    opacity: 1;
}

.mobile-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.mobile-side-menu.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.mobile-menu-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.close-menu-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
}

.close-menu-btn:hover {
    background: #e9ecef;
}

.mobile-menu-body {
    padding: 20px;
}

/* モバイル検索フォーム */
.mobile-category-search {
    margin-bottom: 25px;
}

.mobile-search-box {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-search-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    outline: none;
    font-size: 14px;
}

.mobile-search-button {
    padding: 12px 15px;
    background: #007cba;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.mobile-search-button:hover {
    background: #005a87;
}

/* モバイルカテゴリツリー */
.mobile-category-tree {
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.mobile-category-item {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-category-item:last-child {
    border-bottom: none;
}

.mobile-category-link {
    display: flex;
    align-items: center;
    padding: 15px 0;
    text-decoration: none;
    color: #333;
    transition: color 0.3s ease;
}

.mobile-category-link:hover {
    color: #007cba;
}

.mobile-category-link i:first-child {
    margin-right: 12px;
    color: #666;
    width: 16px;
    text-align: center;
}

.mobile-category-link span {
    flex: 1;
    font-size: 14px;
}

.mobile-category-link i:last-child {
    color: #999;
    font-size: 12px;
} 