/* レスポンシブデザイン対応 */

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

/* オーバーレイメニューは初期状態で非表示 */
.mobile-overlay-menu {
    display: none;
}

/* SP表示時の対応 */
@media (max-width: 768px) {
    /* デスクトップ用を非表示 */
    .desktop-only {
        display: none !important;
    }
    
    /* モバイル用を表示 */
    .mobile-only {
        display: block !important;
    }
    
    /* 横スクロール防止 */
    html, body {
        overflow-x: hidden;
        width: 100%;
        height: auto;
    }
    
    /* PCコンテンツを横幅ジャストサイズに縮小 */
    body {
        zoom: 0.4; /* transformの代わりにzoomを使用 */
        width: 100%;
        height: auto;
        min-height: 100vh;
        padding-top: 300px; /* 固定ヘッダーの高さ分 */
        padding-bottom: 160px;
    }
    
    /* 会社概要ページのコンテンツ部分はzoomを無効化 */
    body.company-page {
        zoom: 1 !important;
        padding-top: 120px !important; /* SP専用ヘッダーの高さ分 */
        padding-bottom: 55px !important;
    }
    
    body.company-page #contents_wrapper {
        zoom: 1 !important;
    }
    
    /* 会社概要ページでもSP専用ヘッダーは正常に表示 */
    body.company-page .mobile-fixed-header {
        zoom: 1 !important;
    }
    
    body.company-page .mobile-overlay-menu {
        zoom: 1 !important;
    }
    
    body.company-page .fixed-contact-button {
        zoom: 1 !important;
    }

    div.closing {
        display: none !important;
    }
    
    /* follow、dazhong、faqページは縮小表示 */
    body.dazhong-page,
    body.follow-page,
    body.faq-page {
        zoom: 0.4 !important;
        padding-top: 300px !important;
        padding-bottom: 160px !important;
    }
    
    /* case、approachページはzoom効果を無効化 */
    body.case-page,
    body.approach-page {
        zoom: 1 !important;
        padding-top: 120px !important;
        padding-bottom: 55px !important;
    }
    
    /* plan-pageは縮小表示を維持 */
    body.plan-page {
        zoom: 0.4 !important;
        padding-top: 300px !important;
        padding-bottom: 160px !important;
    }
    
    body.dazhong-page #contents_wrapper,
    body.follow-page #contents_wrapper,
    body.faq-page #contents_wrapper,
    body.case-page #contents_wrapper,
    body.approach-page #contents_wrapper {
        zoom: 1 !important;
    }
    
    /* plan-pageのcontentsは縮小表示を維持 */
    body.plan-page #contents_wrapper {
        zoom: 1 !important;
    }
    
    /* 縮小表示ページのSP専用ヘッダーは通常サイズ */
    body.dazhong-page .mobile-fixed-header,
    body.follow-page .mobile-fixed-header,
    body.faq-page .mobile-fixed-header,
    body.plan-page .mobile-fixed-header {
        zoom: 2.5 !important;
    }
    
    /* 通常表示ページのSP専用ヘッダーは通常サイズ */
    body.case-page .mobile-fixed-header,
    body.approach-page .mobile-fixed-header {
        zoom: 1!important;
    }
    
    /* 縮小表示ページのオーバーレイメニューは通常サイズ */
    body.dazhong-page .mobile-overlay-menu,
    body.follow-page .mobile-overlay-menu,
    body.faq-page .mobile-overlay-menu,
    body.plan-page .mobile-overlay-menu {
        zoom: 2.5 !important;
    }
    
    /* 通常表示ページのオーバーレイメニューは通常サイズ */
    body.case-page .mobile-overlay-menu,
    body.approach-page .mobile-overlay-menu {
        zoom: 1 !important;
    }
    
    /* 縮小表示ページの固定ボタンは通常サイズ */
    body.dazhong-page .fixed-contact-button,
    body.follow-page .fixed-contact-button,
    body.faq-page .fixed-contact-button,
    body.plan-page .fixed-contact-button {
        zoom: 2.5 !important;
    }
    
    /* 通常表示ページの固定ボタンは通常サイズ */
    body.case-page .fixed-contact-button,
    body.approach-page .fixed-contact-button {
        zoom: 1 !important;
    }

    nav#sitenav {
        display: none !important;
    }
    
    /* ビューポートの調整 */
    #contents_wrapper {
        width: 100%;
        height: auto;
        min-height: 100vh;
    }
    
    /* 既存のナビゲーションを非表示 */
    nav #gnav {
        display: none !important;
    }
    
    /* PCの既存ヘッダーを非表示 */
    header:not(.mobile-fixed-header) {
        display: none !important;
    }
    
    /* PCヘッダーがもし表示される場合のレスポンシブ対応 */
    #header .header_closing {
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px !important;
        box-sizing: border-box !important;
    }
    
    #header .logo {
        width: auto !important;
        max-width: 100% !important;
        float: none !important;
        text-align: center !important;
        margin-bottom: 10px !important;
    }
    
    #header .logo img {
        max-width: 100% !important;
        height: auto !important;
        width: auto !important;
    }
    
    #header h1.txt {
        float: none !important;
        width: 100% !important;
        text-align: center !important;
        font-size: 12px !important;
        line-height: 1.4 !important;
        margin: 0 !important;
        padding: 0 10px !important;
    }
    
    /* 仕切り棒の削除 */
    .mobile-divider,
    .border-divider,
    .divider-line,
    hr {
        display: none !important;
    }
    
    /* 固定ヘッダー */
    .mobile-fixed-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10001;
        background: white;
        padding: 8px 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        zoom: 2.5; /* 1/0.4 = 2.5 */
        display: flex;
        flex-direction: column;
        height: auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* ヘッダー上部（ロゴ + ハンバーガーメニュー） */
    .mobile-header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-bottom: 8px;
    }
    
    /* ヘッダーロゴ */
    .mobile-header-logo {
        flex: 1;
        text-align: center;
    }
    
    .mobile-header-logo img {
        max-width: 280px;
        width: auto;
        height: auto;
    }
    
    /* より小さな画面での調整 */
    @media (max-width: 480px) {
        .mobile-header-logo img {
            max-width: 240px;
        }
    }
    
    @media (max-width: 360px) {
        .mobile-header-logo img {
            max-width: 200px;
        }
    }
    
    /* ハンバーガメニューボタン */
    .hamburger-menu {
        width: 40px;
        height: 40px;
        background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%);
        border: none;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        flex-shrink: 0;
        z-index: 10010 !important;
        position: relative;
    }
    
    /* ハンバーガメニューアニメーション */
    .hamburger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translate(3px, 3px);
    }
    
    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger-menu.active span:nth-child(3) {
        transform: rotate(-45deg) translate(4px, -4px);
    }
    
    /* オーバーレイメニュー */
    .mobile-overlay-menu {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: linear-gradient(135deg, rgba(255, 107, 107, 0.95) 0%, rgba(78, 205, 196, 0.95) 100%);
        backdrop-filter: blur(10px);
        z-index: 10002;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        zoom: 2.5; /* 1/0.4 = 2.5 */
    }
    
    .mobile-overlay-menu.active {
        transform: translateX(0);
    }
    
    /* オーバーレイ内の閉じるボタン */
    .overlay-close-button {
        position: absolute;
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%);
        border: none;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        z-index: 10011;
        /* zoom: 2.5; 1/0.4 = 2.5 */
    }
    
    .overlay-close-button span {
        display: block;
        width: 20px;
        height: 2px;
        background: white;
        margin: 4px auto;
        transition: all 0.3s ease;
        border-radius: 1px;
    }
    
    .overlay-close-button:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.05);
    }
    
    /* 閉じるボタンのアニメーション（X形状） */
    .overlay-close-button span:nth-child(1) {
        transform: rotate(45deg) translate(3px, 3px);
    }
    
    .overlay-close-button span:nth-child(2) {
        opacity: 0;
    }
    
    .overlay-close-button span:nth-child(3) {
        transform: rotate(-45deg) translate(4px, -4px);
    }
    
    /* メニューヘッダー */
    .mobile-menu-header {
        padding: 30px 20px;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
        background: rgba(255, 255, 255, 0.1);
    }
    
    .mobile-menu-header img {
        max-width: 250px;
        height: auto;
    }
    
    /* メニューリスト */
    .mobile-menu-list {
        padding: 50px 30px;
        list-style: none;
        margin: 0;
    }
    
    .mobile-menu-list li {
        margin-bottom: 25px;
    }
    
    .mobile-menu-list a {
        display: block;
        padding: 20px 25px;
        color: white;
        text-decoration: none;
        font-size: 20px;
        font-weight: bold;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        transition: all 0.3s ease;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    }
    
    .mobile-menu-list a:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateX(10px);
    }
    
    /* 固定お問い合わせボタン */
    .fixed-contact-button {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%);
        padding: 15px 0;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
        zoom: 2.5; /* 1/0.4 = 2.5 */
        width: 100%;
        margin: 0;
    }
    
    .fixed-contact-button a {
        display: block;
        color: white;
        text-decoration: none;
        text-align: center;
        font-size: 18px;
        font-weight: bold;
        padding: 10px 20px;
        background: linear-gradient(145deg, #FF6B6B 0%, #FA5252 50%, #E03131 100%);
        border: 1px solid #fff;
        border-radius: 8px;
        transition: all 0.3s ease;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
        margin: 0 20px;
        width: calc(100% - 40px);
        box-sizing: border-box;
    }
    
    .fixed-contact-button a:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.02);
    }
    
    #qa .qabox dt a {
        font-size: 40px !important;
    }
    
    #about .whybox .box3 .txtbox {
        width: 94% !important;
    }

    #about .whybox .box3 {
        background: none !important;
    }

    #contents_wrapper .txt {
        font-size: 40px !important;
    }
    
    /* フッターを非表示 */
    footer {
        display: none !important;
    }
    
    .container {
        padding-top: 0 !important; /* 追加の上部余白をリセット */
    }
    
    /* CV用aタグの強制スタイル統一 */
    a[href="/form"] {
        display: inline-block !important;
        background: linear-gradient(135deg, #FF6B6B 0%, #FA5252 25%, #E03131 50%, #C92A2A 75%, #A61E1E 100%) !important;
        color: white !important;
        padding: 15px 30px !important;
        border-radius: 8px !important;
        text-decoration: none !important;
        font-weight: bold !important;
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3) !important;
        transition: all 0.3s ease !important;
        box-sizing: border-box !important;
        width: 90%;
    }

    .closingbox_mail a[href="/form"] {
        font-size: 40px !important;
        line-height: 80px !important;
    }

    .closingbox_mail div.telbox {
        display: none !important;
    }
    
    a[href="/form"]:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4) !important;
    }
    
    /* Closing section緑の三角の拡大調整 */
    .closing-section::after {
        border-left: 60px solid transparent !important;
        border-right: 60px solid transparent !important;
        border-top: 40px solid #2F855A !important;
        bottom: -40px !important;
    }
    
    /* 隙間調整 */
    .closing-section {
        margin-bottom: 40px;
    }
    
    .closingbox_mail {
        padding: 30px 20px;
    }
    
    /* サービス紹介セクションのSP対応強化 */
    .services-section {
        zoom: 2.5; /* 1/0.4 = 2.5 */
        padding: 30px 0 !important;
        margin: 20px 0 !important;
    }
    
    .services-container {
        padding: 0 15px !important;
        max-width: none !important;
    }
    
    .services-title h2 {
        font-size: 22px !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
        text-align: center !important;
    }
    
    .services-title p {
        font-size: 14px !important;
        line-height: 1.6 !important;
        text-align: center !important;
        margin-bottom: 25px !important;
    }
    
    .services-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        margin-bottom: 30px !important;
    }
    
    .service-card {
        padding: 20px 15px !important;
        margin-bottom: 15px !important;
        min-height: 140px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }
    
    .service-card .service-icon {
        margin: 0 auto 15px auto !important;
        display: block !important;
        text-align: center !important;
    }
    
    .service-card .service-icon img {
        max-width: 140px !important;
        max-height: 140px !important;
        display: block !important;
        margin: 0 auto !important;
    }
    
    .service-card h3 {
        font-size: 16px !important;
        line-height: 1.3 !important;
        margin-bottom: 10px !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .service-card p {
        font-size: 12px !important;
        line-height: 1.5 !important;
        text-align: left !important;
        margin: 0 !important;
        width: 100% !important;
    }
    
    /* ホバー効果をSPでは無効化 */
    .service-card:hover {
        transform: none !important;
    }
    
    .service-card:hover .service-icon {
        transform: none !important;
    }
    #contents_wrapper #privacy_box .txt {
        font-size: 12px !important;
    }
    
}

/* タブレット用の調整 */
@media (max-width: 1024px) and (min-width: 769px) {
    .hamburger-menu {
        display: none;
    }
    
    nav #gnav {
        display: block !important;
    }
    
    .mobile-only {
        display: none !important;
    }
    
    .desktop-only {
        display: block !important;
    }
}

/* ハンバーガーメニューのスパン */
.hamburger-menu span {
    display: block;
    width: 20px;
    height: 2px;
    background: white;
    margin: 4px auto;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.hamburger-menu:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* h1をヘッダー内に配置 */
.mobile-h1 h1 {
    padding: 8px 0;
    font-size: 10px;
    font-weight: bold;
    color: #333;
    text-align: center;
    line-height: 1.3;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    width: 100%;
} 