/* ===== 車種詳細モーダル CSS ===== */

/* モーダルオーバーレイ */
.vehicle-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    z-index: 9999;
    overflow: hidden; /* スクロールを無効化 */
}

/* モーダル表示時のhtml要素のスクロール無効化 */
html.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* body要素のスクロールも無効化 */
html.modal-open body {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

.vehicle-modal-overlay.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    overflow: hidden; /* スクロールを確実に無効化 */
}

/* メインモーダルコンテナ */
.vehicle-modal {
    width: 100vw;
    height: 100%;
    background: #ffffff;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow-y: auto;
}

.vehicle-modal.active {
    opacity: 1;
    transform: scale(1);
}

/* モーダルヘッダー */
.vehicle-modal-header {
    position: relative;
    background: #ffffff;
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 70px;
    border-bottom: none;
}

.vehicle-modal-title {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: #000;
    margin: 0;
    text-align: center;
}

/* 閉じるボタン */
.vehicle-modal-close {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    left: 0px;
    width: 66px;
    height: 66px;
    background: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center; background-image: url("../img/arrow3.svg"); background-position: center; background-repeat: no-repeat; background-size: 25px;
}

.vehicle-modal-close::before {
    width: 25px;
    height: 25px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25 33.8'%3E%3Cpath d='M14.8 33.8V8.1L2.9 19.9 0 16.9 16.9 0l16.9 16.9-2.9 3L19 8.1v25.7z' fill='%23e70014'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    transform: rotate(-90deg);
}


/* スクリーンリーダー用テキスト */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* モーダルコンテンツ */
.vehicle-modal-content {
    padding: 0;
    background: #ffffff; 
    padding-top: 25px;
    height: calc(100% - 70px); /* モバイル：ウィンドウ高さからヘッダー高さ（70px）を引く */
    overflow-y: auto; /* 縦方向のスクロールを有効化 */
}

/* アクセントライン */
.vehicle-accent-lines {
    width: 100%;
    height: 11px;
    display: flex;
    flex-direction: column;
    margin-top: -20px;
    position: absolute;
    bottom: -11px;
    left: 0; z-index: 2;
}

.vehicle-accent-line-red {
    width: 100%;
    height: 6px;
    background: #e70014;
}

.vehicle-accent-line-black {
    width: 100%;
    height: 5px;
    background: #000000;
}

/* 車種タイトル */
.vehicle-detail-title {
    display: flex;
    align-items: center;
    padding: 20px 20px 0px 20px;
    background: #ffffff;
}

.vehicle-title {
    display: flex;
    align-items: center;
}

.vehicle-title .vehicle-accent {
    display: flex;
    flex-direction: column;
    margin-right: 12px;
    position: relative;
}

.vehicle-title .vehicle-accent-red {
    width: 4px;
    height: 23px;
    background: #e70014;
    position: absolute;
    top: 0;
    left: 0;
}

.vehicle-title .vehicle-accent-black {
    width: 4px;
    height: 23px;
    background: #1a1311;
    position: absolute;
    top: 0;
    left: 8px;
}

.vehicle-title h3 {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #000;
    margin: 0;
    margin-left: 20px;
}

/* 車種名 */
.vehicle-model-name {
    padding: 0 20px 0 27px; /* デスクトップ: padding-bottom 0 */
    font-family: 'Noto Sans JP', sans-serif;
    font-size:20px;
    font-weight: 800;
    color: #000;
}
.vehicle-model-name span { margin-left: .5em;}

.modalWrap { margin: 0 auto; max-width: 800px; margin: 0 auto;}

/* スペック情報 */
.vehicle-specs-section {
    padding: 10px 20px;
    margin: 0;
    position: relative; 
    max-width: 800px; 
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 15px;
}
#blacks {
    background: #040404; }

.vehicle-specs-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 600px;
    width: 55%;
}

.vehicle-spec-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px; 
    border-bottom: 1px solid #939393; 
    padding: 0 0 10px 0;
}
.vehicle-spec-item:last-of-type { border: none; padding-bottom: 0;}

.vehicle-spec-label {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff; width: 5em;
}

.vehicle-spec-value {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #d1d1d1;    
}
@media (max-width: 767px) {
    .vehicle-spec-value {
        width: calc(100% - 8em);
    text-align: center;
    }
    
    .vehicle-model-name {
        padding: 0 20px 10px 47px; /* モバイル: padding-bottom 10px */
    }
}

.vehicle-spec-divider {
    width: 100%;
    height: 1px;
    background: #939393;
    margin: 10px 0;
    grid-column: 1 / -1;
}

/* サブ画像（スペックセクション内に配置） */
.vehicle-sub-image {
    
    width: 45%;
    height: 91px;
    border-radius: 6px;
    overflow: hidden;
}

.vehicle-sub-image img {
    width: 100%;
    height: 100%;
    object-fit:contain;
}

/* メイン画像セクション */
.vehicle-main-image {
    padding: 20px 15px;
    background: #ffffff;
}

.vehicle-image-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    /*border-radius: 6px;*/
    overflow: hidden;
}

.vehicle-carousel {
    width: 100%;
    /*height: 307px;*/
    position: relative;
    /*background: #f0f0f0;*/
    aspect-ratio: 375 / 252;
}

.swiper-slide {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-image: url(../img/bgA.jpg);
}

.swiper-slide img {
    width: 120%;
    height: 120%; /* ボタン用のスペースを確保 */
    object-fit: cover;
    flex-shrink: 0;
        /*background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-image: url(../img/bgA.jpg);*/
    position: absolute;
    top: 40%;
    left: 55%;
    transform: translate(-50%, -50%);
}

/* 3D Viewを表示ボタン */
.view-3d-button {
    width: 100%;
    margin-top: 15px;
    background: #e70014;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans JP', sans-serif;
    flex-shrink: 0; max-width: 200px; display:none;
}

.view-3d-button:hover {
    background: #c50011;
    transform: translateY(-2px);
}

.view-3d-button:active {
    transform: translateY(0);
}

/* カラーパレット */
.vehicle-colors {
    padding: 0 20px;
    background: #ffffff;
    text-align: center;
    position: relative;
}

.vehicle-colors-grid {
    display: inline-flex;
    gap: 10px;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    max-width: 100%;
    padding: 0 20px;
}

.vehicle-colors-grid::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.vehicle-colors-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.vehicle-colors-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 10;
    transition: all 0.3s ease;
}

.vehicle-colors-scroll-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.vehicle-colors-scroll-btn.prev {
    left: 0;
}

.vehicle-colors-scroll-btn.next {
    right: 0;
}

.vehicle-colors-scroll-btn.hidden {
    display: none;
}

.vehicle-color-sample {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0,0,0,.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0; box-sizing: border-box;
}

.vehicle-color-sample:hover {
    /*transform: scale(1.1);*/
    border-color: #333;
}

.vehicle-color-sample.active {
    border: 2px solid #333;
    /*transform: scale(1.1);*/
}

/* 説明テキスト */
.vehicle-description {
    padding: 20px 30px 80px 30px;
    background: #ffffff; max-width: 800px; box-sizing: border-box; margin: 0 auto;
}

.vehicle-description-text {
    font-family: 'Noto Sans JP', sans-serif;
    /*font-size: 16px;*/
    font-weight: 400;
    color: #000;
    line-height: 1.5;
    padding-top: 0.7em;
}

/* vehicle-description内の.vehicle-detail-titleのみ */
.vehicle-description .vehicle-detail-title {
    padding-left: 0.4em;
}

.tuning-title { margin-bottom: 0; line-height: 1;}

/* デスクトップ対応 */
@media (min-width: 768px) {
    .vehicle-modal-overlay.active {
        align-items: center;
        padding: 0px;
    }
    
    .vehicle-modal {
        width: 100vw;
        height: auto;
        max-height: 100svh;
        border-radius: 0px;
    }
    
    .vehicle-modal-title {
        font-size: 34px;
    }
    
    .vehicle-modal-close {
        width: 89px;
        height: 89px; background-size: 33px;
    }
    
    .vehicle-modal-close::before {
        width: 33px;
        height: 33px;
    }
    
    /* デスクトップでのヘッダー高さ調整 */
    .vehicle-modal-header {
        height: 90px;
        padding: 25px 0;
    }
    
    /* デスクトップでのコンテンツ高さ調整 */
    .vehicle-modal-content {
        height: calc(100svh - 90px); /* デスクトップ：ウィンドウ高さからヘッダー高さ（90px）を引く */
        padding-top: 50px;
    }
    
    .vehicle-image-container {
        max-width: 800px;
    }
    
    .vehicle-carousel {
        /*height: 524px;*/
    }
    
    .vehicle-colors-grid {
        gap: 20px;
    }
    
    .vehicle-colors-container {
        max-width: 800px;
    }
    
    .vehicle-colors-scroll-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .vehicle-color-sample {
        width: 30px;
        height: 30px;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        flex-shrink: 0;border: 2px solid rgba(0,0,0,.1);
    }
    
    .vehicle-color-sample:hover {
        border-color: #333;
    }
    
    .vehicle-color-sample.active {
        border: 2px solid #333;
    }
    
    .vehicle-specs-grid {
        max-width: 600px;
        margin: 0 auto;
        gap: 10px;
        display: flex;
        flex-direction: column;
    }
    
    .vehicle-main-image {
        padding: 40px;
        background: #f6f6f6;
    }
    
    .vehicle-description {
        padding: 40px 0 80px 0;
    }
    
    /* デスクトップでのサブ画像位置調整 */
    .vehicle-sub-image {
        position: static;
        width: 169px;
        height: 97px;
      background: #040404;
      display: flex;
    justify-content: center;
    align-items: center;
    }
    
    .vehicle-specs-section {
        display: flex;
        align-items: center;
        gap: 20px;
        padding: 20px 0px;
    }
    
    .vehicle-specs-grid {
        flex: 1;
    }

    #blacks { background: none;}
    .vehicle-sub-image img {
        width: 90%;
    height: 90%;
    object-fit: contain;
    object-position: center;
    }
    .vehicle-spec-label,.vehicle-spec-value { color: #000;}
    .vehicle-colors {background: #f6f6f6f6;padding: 0 20px 40px 20px;}
    .vehicle-detail-title { padding-left: 0;}
    .vehicle-detail-title { padding-bottom: 0;}
    .vehicle-specs-section { padding-bottom: 40px;}
    /* デスクトップ: vehicle-description内の.vehicle-detail-title */
    .vehicle-description .vehicle-detail-title {
        padding-left: 0.4em;
        padding-top: 0;
    }
}

/* Swiper カスタマイズ */
.swiper-pagination-bullet {
    background: #e70014;
    opacity: 0.3;
}

.swiper-pagination-bullet-active {
    opacity: 1;
    background: #e70014;
}

.swiper-button-next,
.swiper-button-prev {
    color: #000; background-color: rgba(255,255,255,.6); width: 50px; height: 50px; border-radius: 50%;
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 20px;
}

/* モバイルでもナビゲーションボタンを表示 */
@media (max-width: 767px) {
    .swiper-button-next,
    .swiper-button-prev {
        display: flex;
        width: 30px;
        height: 30px;
    }
    
    .swiper-button-next:after,
    .swiper-button-prev:after {
        font-size: 16px;
    }
}

@media (max-width: 768px) and  (min-width: 480px) {
    .modalWrap,#blacks { padding: 0 15px;}
    .vehicle-description {
        padding: 40px 15px 80px 15px;
    }
}


/* ===== 画像拡大モーダル CSS ===== */

/* 画像拡大モーダルオーバーレイ */
.image-modal-overlay {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    z-index: 99999 !important; /* 既存のモーダルより上に表示 */
    overflow: hidden;
    align-items: center;
    justify-content: center;
}

.image-modal-overlay.active {
    display: flex;
}

/* 画像拡大モーダルコンテナ */
.image-modal {
    width: 90vw;
    max-width: 1200px;
    max-height: 90vh;
    background: #ffffff;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease-in-out;
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 99999 !important; /* 確実に最前面に表示 */
    border-radius: .6em;
}

.image-modal.active {
    opacity: 1;
    transform: scale(1);
}

/* 画像拡大モーダル閉じるボタン */
.image-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001 !important; /* 閉じるボタンも最前面に */
}

.image-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.image-modal-close .material-symbols-outlined {
    font-size: 24px;
    color: var(--text-primary);
}

/* 画像拡大モーダルコンテンツ */
.image-modal-content {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    flex: 1;
    overflow: hidden;
}

.image-modal-content img {
    max-width: 100%;
    max-height: calc(90vh - 100px);
    height: auto;
    object-fit: contain;
}

.cloudimage-360-view-360-icon {
}

/* Cloudimage 360 View スタイル */
.image-modal-content .cloudimage-360 {
    width: 100%;
    height: 100%;
    /*min-height: 400px;*/
    max-height: calc(90vh - 100px);
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-content .cloudimage-360 canvas {
    width: 100% !important;
    height: auto !important;
    max-height: calc(90vh - 100px) !important;
    object-fit: contain;
    transform: scale(1.3);
    transform-origin: center center;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .image-modal {
        width: 95vw;
        max-height: 95vh;
    }
    
    .image-modal-close {
        top: 15px;
        right: 15px;
    }
    
    .image-modal-content {
        padding: 15px;
    }
    
    .image-modal-content img {
        max-height: calc(95vh - 80px);
    }
    
    /* 3D Viewボタンのモバイル対応 */
    .view-3d-button {
        margin-top: 10px;
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .swiper-slide img {
        /*height: calc(100% - 0px);*/ /* モバイル用のボタンスペース */
    }
}
#vehicleModelTypeTitle span { margin-left: .5em;}
.swiper-button-lock { display: none;}
