/* Header CTA Styles */

* {
    box-sizing: border-box;
}

/* 共通 */
.header-cta-wrapper {
    display: none;
    /* デフォルト非表示、メディアクエリで制御 */
}

/* PC styles (Desktop) */
@media (min-width: 769px) {
    header .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    header nav {
        flex: 1;
        margin: 0 20px;
    }

    header nav ul {
        display: flex;
        justify-content: center;
        gap: 20px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .header-cta-wrapper {
        display: flex;
        align-items: center;
        gap: 20px;
    }

    .header-tel-box {
        text-align: right;
    }

    .tel-link {
        display: block;
        font-size: 1.2rem;
        font-weight: bold;
        color: #333;
        text-decoration: none;
        line-height: 1.2;
    }

    .tel-link:hover {
        opacity: 0.8;
    }

    .tel-address {
        display: block;
        font-size: 0.7rem;
        color: #666;
        margin-top: 2px;
    }

    .btn-header-cta {
        background-color: #d9534f;
        color: #fff !important;
        padding: 10px 20px;
        border-radius: 4px;
        text-decoration: none;
        font-weight: bold;
        display: inline-block;
        text-align: center;
        line-height: 1.2;
        transition: opacity 0.3s;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }

    .btn-header-cta:hover {
        opacity: 0.9;
    }

    .btn-header-cta span {
        display: block;
        font-size: 0.75rem;
        font-weight: normal;
        margin-top: 2px;
        opacity: 0.9;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    body {
        padding-top: 40px;
        /* CTAバーの高さ分空ける */
        margin-top: 0;
        /* マージンリセット */
    }

    .header-cta-wrapper {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 40px;
        background-color: #fff;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        z-index: 9999;
        padding: 0 10px;
        box-sizing: border-box;
        align-items: center;
        justify-content: center;
        /* 中央寄せで隙間を作る */
        gap: 10px;
    }

    .header-tel-box {
        margin: 0;
        margin-right: 5px;
        display: flex;
        /* ブロック要素内の空白文字影響を排除 */
        flex-direction: column;
        justify-content: center;
    }

    .tel-address {
        display: none;
        /* スマホでは住所非表示 */
    }

    .tel-link {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #f0f0f0;
        color: #333;
        text-decoration: none;
        font-weight: bold;
        padding: 8px 12px;
        border-radius: 4px;
        font-size: 0.9rem;
        height: 40px;
        /* ボタンと高さを揃える */
        margin: 0;
        line-height: 1;
        box-sizing: border-box;
    }

    .tel-link::before {
        /* content: "📞"; FontAwesomeがないので文字で代用 */
        margin-right: 5px;
    }

    .btn-header-cta {
        background-color: #d9534f;
        color: #fff !important;
        padding: 5px 15px;
        /* 上下パディング調整 */
        border-radius: 4px;
        text-decoration: none;
        font-weight: bold;
        font-size: 0.85rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 40px;
        /* TELと高さを揃える */
        box-sizing: border-box;
        flex: 1;
        /* 残りの幅を埋める */
        max-width: 220px;
    }

    .btn-header-cta span {
        font-size: 0.7rem;
        font-weight: normal;
        opacity: 0.9;
        margin-top: 0;
    }

    /* 既存ヘッダー（ナビ）の調整
   CTAバーが固定(fixed)なので、その分ナビゲーションを下にずらす */
    header nav {
        padding-top: 10px;
        /* CTAバーの高さ(60px) + 余白 */
        padding-bottom: 10px;
        display: block;
        /* 念のため */
    }

    /* ナビゲーションメニューのスマホ最適化 */
    header nav ul {
        display: flex;
        flex-wrap: wrap;
        /* 折り返しを許可 */
        justify-content: center;
        /* 中央寄せ */
        gap: 10px 15px;
        /* 上下左右の間隔 */
        padding: 0 10px;
        margin: 0;
        /* マージンをリセット */
    }

    header nav ul li {
        margin: 0;
        /* 既存のマージンをリセット */
    }

    header nav ul li a {
        font-size: 0.85rem;
        /* 少し小さくして収まりを良くする */
        white-space: nowrap;
        /* テキストの折り返し防止 */
        padding: 5px 0;
        display: block;
    }

    header {
        margin-top: 0;
        padding-top: 0;
        /* 余分なパディングを排除 */
    }
}