/* ==============================================
   CTA.CSS - CTAタブ・ボタンスタイル
   ============================================== */

/* ===== PC版CTAタブ ===== */
.pc-cta-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 20px 20px 0;
    transform: scale(1.3);
    transform-origin: left center;
}

.cta-tab {
    width: 160px; /* AIチャットボタンが収まる幅に縮小 */
    height: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px; /* アイコンとテキストの間隔を少し縮小 */
    padding: 12px 16px; /* 左右のパディングを縮小 */
    position: relative;
    overflow: hidden;
    border-radius: 25px;
    background: transparent;
    box-shadow: none;
    border: 2px solid rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
}

.cta-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 3s infinite;
    z-index: 1;
}

@keyframes shine {
    0% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}


.phone-tab {
    background: transparent;
    display: none;
}

.phone-tab::before {
    background: linear-gradient(90deg, transparent, rgba(72, 202, 228, 0.6), transparent);
    animation: shine-repair 4s infinite;
}

.repair-tab {
    background: transparent;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    height: 60px;
    width: 280px !important;
    max-width: 280px;
}

.repair-tab::before {
    background: linear-gradient(90deg, transparent, rgba(72, 202, 228, 0.6), transparent);
    animation: shine-repair 4s infinite;
}

@keyframes shine-repair {
    0% {
        left: -100%;
    }
    40% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

.chat-tab {
    background: transparent;
    display: none;
}

.contact-tab {
    background: transparent;
    display: none;
}

.cta-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.cta-tab-icon img {
    width: 20px; /* アイコンサイズを少し小さく */
    height: 20px;
    object-fit: contain;
    filter: brightness(0) invert(1); /* 白色に変換 */
    transition: filter 0.3s ease;
}

.cta-tab-text {
    font-family: 'Sawarabi Gothic', sans-serif;
    font-size: 16px; /* フォントサイズを拡大 */
    font-weight: 500;
    color: white;
    text-align: left;
    line-height: 1.2;
    letter-spacing: 0.01em; /* 文字間隔を少し詰める */
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    white-space: nowrap;
    transition: color 0.3s ease;
    flex: 1;
}

.repair-tab .cta-tab-text {
    text-align: left;
    font-size: 16px;
    line-height: 1.0;
    white-space: nowrap;
}

.cta-tab:hover {
    background: white !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
    border: 2px solid white;
}

.cta-tab:hover .cta-tab-icon img {
    filter: brightness(0) saturate(100%) invert(17%) sepia(16%) saturate(2618%) hue-rotate(202deg) brightness(92%) contrast(92%); /* 濃い紺色 */
}

.cta-tab:hover .cta-tab-text {
    color: #2c3e50; /* 濃い紺色 */
}

/* ===== モバイル版CTAタブ ===== */
.mobile-cta-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    z-index: 1000;
    display: flex !important;
    flex-direction: row;
    justify-content: space-around;
    gap: 20px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: none;
    overflow-x: auto;
}

.mobile-cta-tabs .cta-tab {
    width: calc(50% - 10px);
    min-width: 120px;
    height: 60px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    padding: 5px 0 0 0;
    position: relative;
    border-radius: 20px;
    background: transparent;
    box-shadow: none;
    border: none;
    margin-bottom: 0;
    flex-shrink: 1;
    flex: 1;
}

.mobile-cta-tabs .cta-tab:last-child {
    border-right: none;
}

.mobile-cta-tabs .cta-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.mobile-cta-tabs .cta-tab-icon img {
    width: 35px !important;
    height: 35px !important;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(17%) sepia(16%) saturate(2618%) hue-rotate(202deg) brightness(92%) contrast(92%);
    transition: filter 0.3s ease;
}

.mobile-cta-tabs .cta-tab-text {
    font-family: 'Sawarabi Gothic', sans-serif;
    font-size: 12px !important;
    font-weight: 500;
    color: #2c3e50;
    text-align: center;
    line-height: 1.1 !important;
    letter-spacing: 0.01em;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    white-space: nowrap;
    transition: color 0.3s ease;
    margin: 0 !important;
    padding: 0 !important;
    display: block;
    height: auto;
    min-height: 0;
}

.mobile-cta-tabs .cta-tab:hover {
    background: rgba(72, 202, 228, 0.1);
    transform: translateY(-1px);
}

.mobile-cta-tabs .cta-tab:hover .cta-tab-icon img {
    filter: brightness(0) saturate(100%) invert(56%) sepia(89%) saturate(1174%) hue-rotate(163deg) brightness(96%) contrast(89%);
}

.mobile-cta-tabs .cta-tab:hover .cta-tab-text {
    color: #48CAE4;
}

/* mobile-cta-tabsのphone-tabにアニメーションを追加 */
.mobile-cta-tabs .phone-tab::before {
    background: linear-gradient(90deg, transparent, rgba(72, 202, 228, 0.6), transparent);
    animation: shine-repair 4s infinite;
}

/* ===== CTAタブラッパー配置 ===== */
.cta-tabs-wrapper {
    position: fixed !important;
    left: 30px !important;
    top: calc(52% + 100px) !important;
    z-index: 100 !important;
    transform: translateY(-52%) !important;
    pointer-events: auto !important;
    display: block !important; /* デフォルトで表示 */
}

/* ===== 受付時間・電話番号情報 ===== */
.cta-contact-info {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.contact-hours h3 {
    font-family: 'Sawarabi Gothic', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 10px;
}

.contact-hours p {
    font-family: 'Sawarabi Gothic', sans-serif;
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 8px;
    line-height: 1.4;
}

.contact-phone {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.contact-phone .phone-icon img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.contact-phone .phone-number {
    font-family: 'Sawarabi Gothic', sans-serif;
    font-size: 25px;
    font-weight: 700;
    color: #ffffff;
}

/* ===== 詳細セクションCTAスタイル ===== */
.detail-cta-section {
    background: url('../images/CTAbanner01.png') no-repeat center center;
    background-size: cover;
    color: #2c3e50;
    padding: 2.5rem;
    border-radius: 0 !important;
    text-align: left !important;
    margin-top: 3rem;
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
    min-height: 400px;
    display: grid;
    grid-template-columns: auto auto;
    grid-auto-rows: auto;
    align-items: center;
    justify-items: start;
    column-gap: 10px;
    row-gap: 1rem;
}

/* PC以外（1023px以下）では非表示 */
@media (max-width: 1023px) {
    .detail-cta-section {
        display: none !important;
    }
}

.detail-cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #48CAE4, #0077BE);
}

.detail-cta-section h3 {
    font-family: 'Sawarabi Gothic', sans-serif;
    margin-bottom: 0.75rem;
    font-size: 2.25rem;
    font-weight: 600;
    color: #1a365d;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    z-index: 2;
    width: 70%;
    grid-column: 1 / -1;
}

.detail-cta-section h3::before,
.detail-cta-section h3::after {
    content: '';
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23444444' viewBox='0 0 24 24'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.7;
}

.detail-cta-section h3::after {
    transform: scaleX(-1); /* 右側アイコンを左右反転 */
}

.detail-cta-section p {
    font-family: 'Sawarabi Gothic', sans-serif;
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    color: #ffffff;
    max-width: 600px;
    margin-left: 0;
    margin-right: auto;
    z-index: 2;
    grid-column: 1 / -1;
    text-align: left !important;
}

/* 電話表示エリア */
.detail-phone-display {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 1rem;
    grid-column: 1 / -1;
    z-index: 2;
}

.detail-phone-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-phone-icon img {
    width: 100%;
    height: 100%;
    filter: brightness(0) saturate(100%) invert(20%) sepia(50%) saturate(2000%) hue-rotate(200deg) brightness(0.7) contrast(1.2);
}

.detail-phone-number {
    font-family: 'Sawarabi Gothic', sans-serif;
    font-size: 3rem;
    font-weight: 600;
    color: #1a365d;
}

/* 電話ボタン（グリーン） */
.detail-cta-btn.phone-btn {
    background: #28a745;
    color: white;
    border: 2px solid #28a745;
    padding: 1.25rem 2.5rem;
    border-radius: 8px;
    font-family: 'Sawarabi Gothic', sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0.5rem;
    text-decoration: none;
    display: inline-block;
    z-index: 2;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.detail-cta-btn.phone-btn:hover {
    background: #218838;
    border-color: #218838;
    transform: translateY(-2px);
}

/* 高specificity - 電話ボタンの通常状態とホバー時の高速レスポンス */
.detail-content-visible .detail-cta-section > .detail-cta-btn.phone-btn {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transition-delay: 0s !important;
}

.detail-content-visible .detail-cta-section > .detail-cta-btn.phone-btn:hover {
    background: #218838;
    border-color: #218838;
    transform: translateY(-2px);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transition-delay: 0s !important;
}

/* フォームボタン（グリーン） */
.detail-cta-btn.form-btn {
    background: #28a745;
    color: white;
    border: 2px solid #28a745;
    padding: 1.25rem 2.5rem;
    border-radius: 8px;
    font-family: 'Sawarabi Gothic', sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0;
    text-decoration: none;
    display: inline-block;
    z-index: 2;
    position: relative;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.detail-cta-btn.form-btn:hover {
    background: #218838;
    border-color: #218838;
    transform: translateY(-2px);
}

/* 高specificity - フォームボタンの通常状態とホバー時の高速レスポンス */
.detail-content-visible .detail-cta-section > .detail-cta-btn.form-btn {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transition-delay: 0s !important;
}

.detail-content-visible .detail-cta-section > .detail-cta-btn.form-btn:hover {
    background: #218838;
    border-color: #218838;
    transform: translateY(-2px);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transition-delay: 0s !important;
}

/* 既存のボタンスタイル（後方互換性のため） */
.detail-cta-btn {
    background: #0077BE;
    color: white;
    border: 2px solid #0077BE;
    padding: 1.25rem 2.5rem;
    border-radius: 8px;
    font-family: 'Sawarabi Gothic', sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0.5rem;
    text-decoration: none;
    display: inline-block;
}

.detail-cta-btn:hover {
    background: #005a94;
    border-color: #005a94;
    transform: translateY(-2px);
}

/* サービス詳細内のCTAボタン（透明スタイル） */
.detail-service-cta .detail-cta-btn {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-family: 'Sawarabi Gothic', sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.detail-service-cta .detail-cta-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* 詳細コンテンツ非表示時のCTAアニメーション */
.detail-content-hidden .detail-cta-section > h3,
.detail-content-hidden .detail-cta-section > p,
.detail-content-hidden .detail-cta-section > button {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==============================================
   レスポンシブ対応・配置制御
   ============================================== */

/* モバイル（959px以下）でのCTA表示制御 */
@media (max-width: 959px) {
    
    /* モバイルCTAタブ表示 */
    .mobile-cta-tabs {
        display: flex !important;
    }
    
    /* PC版CTAタブ非表示 */
    .cta-tabs-wrapper {
        display: none !important;
    }
}

/* mobile-cta-tabsを常に表示（ファーストビューから） */
.mobile-cta-tabs {
    display: flex !important;
    z-index: 9999 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* PC版（1024px以上）では非表示 */
@media (min-width: 1024px) {
    .mobile-cta-tabs {
        display: none !important;
    }
}

/* モバイル（1023px以下）：PC版CTAタブを非表示 */
@media (max-width: 1023px) {
    .cta-tabs-wrapper {
        display: none !important;
    }
}

/* 1023px以下では疑似2カラム時でもpc-cta-tabsを非表示 */
@media (max-width: 1023px) {
    .layout-container.pseudo-two-column .pc-cta-tabs {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        z-index: -1 !important;
    }
}

/* 詳細表示モーダルが開いた時にpc-cta-tabsを非表示（全画面サイズで適用） */
body.mobile-detail-active .pc-cta-tabs,
body.detail-mode .pc-cta-tabs,
.detail-column.active ~ .pc-cta-tabs {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    z-index: -1 !important;
}

/* ===== 新体系でのCTAタブ配置 ===== */

/* デスクトップ (1500px以上) - 3カラム時のCTAタブ配置 */
@media (min-width: 1500px) {
    .cta-tabs-wrapper {
        left: calc(50vw + clamp(300px, 30vw, 400px) + 20px) !important; /* 中央+右カラム半分+余白 */
    }
}

/* タブレット (1024px-1499px) - 2カラム時のCTAタブ配置 */
@media (min-width: 1024px) and (max-width: 1499px) {
    .cta-tabs-wrapper {
        left: calc(clamp(600px, 60vw, 800px) + 20px) !important; /* 中央カラム右端から20px（3カラム時と同じ距離感） */
    }
}

/* 疑似2カラム時のCTAタブ固定：新体系対応 */
.layout-container.pseudo-two-column .cta-tabs-wrapper {
    position: fixed !important;
    left: calc(clamp(600px, 60vw, 800px) + 20px) !important; /* 新体系中央カラム右端から20px */
    right: auto !important;
    top: 52% !important;
    transform: translateY(-52%) !important;
    z-index: 200 !important;
}

/* 480pxブレークポイント削除: 比率ベースで自動調整
   mobile-cta-tabsは既存のメイン定義で自動対応 */

/* ===== detail-cta-section レスポンシブ対応 ===== */

/* タブレット（768px以下）での調整 */
@media (max-width: 768px) {
    .detail-cta-section {
        min-height: 300px;
        padding: 2rem 1.5rem;
        text-align: left !important;
        grid-template-columns: 1fr auto;
        align-items: center;
        justify-items: start;
    }
    
    .detail-cta-section h3 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        justify-content: flex-start;
        width: 70%;
    }
    
    .detail-cta-section p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        margin-left: 0;
        margin-right: auto;
    }
}

/* モバイル（480px以下）での調整 */
@media (max-width: 480px) {
    .detail-cta-section {
        min-height: 250px;
        padding: 1.5rem 1rem;
        text-align: left !important;
        grid-template-columns: 1fr auto;
        align-items: center;
        justify-items: start;
    }
    
    .detail-cta-section h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
        justify-content: flex-start;
        width: 80%;
    }
    
    .detail-cta-section p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
        margin-left: 0;
        margin-right: auto;
    }
    
    .detail-cta-btn.phone-btn,
    .detail-cta-btn.form-btn {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
} 

/* Ensure buttons are side-by-side inside grid */
.detail-cta-section .detail-cta-btn {
    grid-column: auto;
    margin: 0; /* Reset margins to ensure exact 10px gap */
} 