/* ========================================
   Header CSS - ヘッダー専用スタイル
   common.cssから抽出・header限定版
======================================== */

/* ========== Header Base ========== */
header {
    width: 100%;
}

/* ========== Site Name ========== */
header .site_name {
    width: 100%;
    height: 27px;
    background-color: rgba(28, 26, 16, 1);
}

header .site_name p,
header .site_name h1 {
    font-size: 14px;
    color: #ffffff;
    font-weight: bold;
}

/* ========== Menu Part ========== */
header .menu_part .num {
    gap: 12px;
}

header .menu_part .num_s {
    width: 100%;
    height: 60px;
    background-color: #eee;
}

header .num_s .data {
    gap: 3px;
}

header .num_s .data p {
    font-size: 12px;
    color: #4d4d4d;
}

header .num_s .data p:nth-of-type(2) {
    font-size: 26px;
}

/* ========== Search ========== */
header .search_c {
    gap: 10px;
}

header .search {
    width: 226px;
    height: 40px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    background-color: #ffffff;
}

header .search_c .s_btn {
    height: 40px;
    padding-inline: 8px;
    border: none;
    background-color: #6782ae;
    border-radius: 4px;
    color: #ffffff;
    cursor: pointer;
}

header .search input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    font-size: 12px;
    color: #4d4d4d;
    background-color: #ffffff;
    outline: none;
}

header .search button img {
    width: 20px;
    height: auto;
}

header .search button {
    background-color: #5b7bb0;
    border: none;
    width: 50px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    cursor: pointer;
}

/* ========== MenuBar ========== */
header .menuBar .t_part {
    position: relative;
    padding-top: 47px;
    padding-bottom: 22px;
    margin-bottom: 12px;
}

header .menuBar .ribbon {
    background: url("../img/ribbon.png") no-repeat center / cover;
    position: absolute;
    top: 0;
    left: 0;
    width: 91px;
    height: 116px;
    padding-top: 16px;
}

header .menuBar .ribbon .heart {
    font-size: 18px;
    margin-bottom: 4px;
    width: 20px;
    height: auto;
}

header .menuBar .ribbon .count {
    font-size: 16px;
    margin-bottom: 2px;
    color: #ffffff;
}

header .menuBar .ribbon .label {
    font-size: 14px;
    color: #ffffff;
}

header .menuBar .title {
    width: 225px;
    height: auto;
}

header .menu_list {
    width: 100%;
    margin-bottom: 20px;
    gap: 16px;
}

header .menu_list .menu {
    border: 1px solid #000;
    flex: 1;
    min-width: 111px;
    height: 67px;
    color: #000;
    font-size: 13px;
    text-align: center;
}

header .menu_list .menu:hover {
    background-color: #000;
    color: #ffffff;
}

header .menuBar .ad {
    width: 100%;
    font-size: 12px;
}

header .menuBar .ad .ad_img {
    width: 100%;
    height: auto;
}

header .menuBar .ad p {
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
}

header .menuBar .ad .ad_more {
    width: 100%;
    height: fit-content;
    margin-top: -3px;
    justify-content: right;
    padding-right: 40rem;
    background-color: #86a9c0;
}

header .menuBar .ad .ad_more img {
    height: 25px;
}

header .adSp {
    width: 100%;
    height: auto;
    display: none;
}

header .sp-search {
    width: 100%;
    display: none;
    padding: 7px;
    background-color: #d9d9d9;
}

header .sp-search .search {
    width: 100%;
}

/* ========== Hamburger Menu ========== */
header .hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 32px;
    cursor: pointer;
    position: absolute;
    right: 40rem;
}

header .hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #222;
    border-radius: 2px;
}

/* Sliding menu styles */
header .ham_menu {
    position: fixed;
    top: 0;
    right: -120%;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    transition: right 0.3s ease-in-out;
    z-index: 9999;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

header .ham_menu.show {
    right: 0;
}

header .close-btn {
    background: none;
    border: none;
    cursor: pointer;
    position: absolute;
    top: 20px;
    left: auto;
    color: #333;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: opacity 0.3s;
}

header .close-btn:hover {
    opacity: 0.7;
}

/* ハンバーガーメニュー内のメニューアイテム */
header .ham_menu .menu-items {
    margin-top: 55px;
    padding: 0 20px;
    overflow-y: auto;
}

/* ハンバーガーメニュー内のメニューリンク */
header .ham_menu .menu-items a {
    height: 80px;
}

header .menu-items {
    padding-top: 10px;
    padding-inline: 30px;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 11px;
}

header .menu-items a {
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: #000;
    padding: 8px;
    width: 159px;
    height: 66px;
    border: 1px solid #808080;
    border-radius: 4px;
    box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.2);
    background-color: #ffffff;
}

header .menu-items img {
    width: 50px;
    height: auto;
    margin-right: 10px;
}

/* TOPボタン */
header .ham-menu-footer {
    margin: 0 auto !important;
    text-align: center !important;
    padding: 20px !important;
}

header .ham-menu-footer .top-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    text-decoration: none;
    transition: opacity 0.3s;
}

header .ham-menu-footer .top-btn:hover {
    opacity: 0.7;
}

header .ham-menu-footer .top-btn img {
    width: auto;
    height: 40px;
}

/* ========== SP用ヘッダー要素 ========== */
header .ribbonSp {
    display: none;
}

header .ribbonSpimg {
    position: relative;
    background: url("../img/ribbon.png") no-repeat center / cover;
    width: 40px;
    height: 50px;
}

header .ribbonSp p {
    font-size: 8px;
    color: #424031;
    font-weight: bold;
}

header .noti {
    background-color: #ffffff;
    position: absolute;
    top: 10px;
    right: -40px;
    padding-inline: 8px;
    padding-block: 3px;
    border: 1px solid #6782ae;
    border-radius: 10px;
    z-index: 10;
    color: #1c1a10;
    font-size: 20px;
}

/* スマホ用キーワード検索 */
header .sp-keyword-search {
    display: none;
    width: 100%;
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 1px solid #E5E5E5;
}

header .sp-keyword-search .search-container {
    display: flex;
    align-items: center;
    background: #F8F8F8;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}

header .sp-keyword-search .search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    padding: 10px 15px;
    color: #333;
}

header .sp-keyword-search .search-input::placeholder {
    color: #999;
}

header .sp-keyword-search .search-btn {
    background: #6782AE;
    border: none;
    width: 44px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

header .sp-keyword-search .search-btn:hover {
    background: #5670A0;
}

header .sp-keyword-search .search-btn img {
    width: 20px;
    height: 20px;
}

/* 検索ボタンの背景色を#6782AEに統一 */
header .search button,
header .sBtn,
header .search_c .search button {
    background-color: #6782AE !important;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

header .search button:hover,
header .sBtn:hover,
header .search_c .search button:hover {
    background-color: #5670A0 !important;
}

header .search button img,
header .sBtn img,
header .search_c .search button img {
    width: 20px;
    height: 20px;
}

/* ========== Responsive Header ========== */
@media (max-width: 1024px) {
    header .menu_list {
        display: none;
    }
    header .search_c {
        display: none;
    }
    header .menu_part .num {
        gap: 40rem;
        width: 100%;
        justify-content: center;
    }
    header .hamburger {
        display: flex;
    }
}

@media (max-width: 768px) {
    header .menuBar .t_part {
        padding-inline: 19px;
        justify-content: space-between;
    }
    /* スマホでメニューのmargin-topを0に */
    header .menu-items {
        margin-top: 0;
    }
    /* スマホでスクロール時にヘッダー固定 */
    body.scrolled header .menuBar .t_part {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background-color: #ffffff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    header .hamburger {
        position: unset;
    }
    header .ribbon {
        display: none;
    }
    header .ribbonSp {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    header .ad {
        display: none;
    }
    header .adSp {
        display: block;
    }
    header .sp-search {
        display: flex;
    }
    header .num_s .data p {
        font-size: 10px;
        font-weight: 700;
    }
    header .num_s .data p:nth-of-type(2) {
        font-size: 10px;
    }
    header .menu_part .num_s {
        height: fit-content;
        padding: 3px 0px;
    }
    header .menu_part .num {
        gap: 8px;
    }
    header .site_name p {
        font-size: 10px;
    }
    header .sp-keyword-search {
        display: block;
    }
}

/* スマホ表示（425px以下）で2カラムレイアウト */
@media (max-width: 425px) {
    header .menu-items {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding-inline: 15px;
    }

    header .menu-items a {
        width: 100%;
        height: 60px;
        font-size: 14px;
        line-height: 1.2;
        padding: 6px;
        margin: 0;
    }

    header .menu-items img {
        width: 40px;
        margin-right: 8px;
    }
}

@media (max-width: 500px) {
    header .menuBar .title {
        width: 117px;
    }
    header .hamburger {
        width: 24px;
        height: 24px;
    }
    header .menuBar .t_part {
        padding: 16px;
        margin: 0;
    }
    header .ribbonSpimg {
        width: 20px;
        height: 25px;
    }
    header .noti {
        top: 3px;
        right: -14px;
        padding-inline: 5px;
        padding-block: 2px;
        border-radius: 3px;
        font-size: 10px;
    }
}

@media (max-width: 375px) {
    header .menu_part .num_s {
        height: fit-content;
        padding: 3px 0px;
    }
    header .num_s .data p {
        font-size: 9px;
        font-weight: 700;
    }
    header .num_s .data p:nth-of-type(2) {
        font-size: 9px;
    }
}
