/* 商品一覧・詳細で共通の車両情報表。 */
.tn-vehicle-info {
    width: 100%;
    margin: 16px 0;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    text-align: left;
}

.tn-vehicle-info caption {
    padding: 0 0 8px;
    color: inherit;
    font-size: 16px;
    font-weight: bold;
    text-align: left;
    caption-side: top;
}

.tn-vehicle-info th,
.tn-vehicle-info td {
    padding: 8px 10px;
    border: 1px solid #ddd;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.tn-vehicle-info th {
    width: 38%;
    background: #f5f5f5;
    font-weight: normal;
}

.tn-vehicle-info td {
    background: #fff;
}

#page_product_list .tn-vehicle-info th {
    width: 44%;
}

#page_product_list .tn-vehicle-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.5;
}

/* 固定高による縮小・中央寄せを解除し、画像を商品カードの幅いっぱいに表示する。 */
#page_product_list .ec-shelfGrid .ec-shelfGrid__item-image {
    height: auto;
}

#page_product_list .ec-shelfGrid .ec-shelfGrid__item-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
}

#page_product_list .ec-shelfGrid .tn-vehicle-detail-link,
#page_product_detail .tn-vehicle-contact-link {
    display: block;
    padding: 12px 16px;
    background: var(--link_color, #525263);
    color: var(--easys_standard_value006, #fff);
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

#page_product_list .ec-shelfGrid .tn-vehicle-detail-link:hover,
#page_product_detail .tn-vehicle-contact-link:hover {
    background: var(--column3_title_bg_color, #3d3d4a);
    color: var(--easys_standard_value006, #fff);
}

#page_product_detail .tn-vehicle-contact {
    margin: 24px 0;
}

#page_product_detail .tn-vehicle-notes {
    margin: 24px 0;
}

#page_product_detail .tn-vehicle-notes h3 {
    margin: 0;
    padding: 10px 14px;
    background: #525263;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.5;
}

#page_product_detail .tn-vehicle-notes__body {
    padding: 12px 14px;
    border: 1px solid #ddd;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

/* 商品画像のサムネイルは、枚数が増えても横1列のまま送る。 */
#page_product_detail .tn-vehicle-gallery .item_visual {
    margin-bottom: 16px;
}

#page_product_detail .tn-gallery-thumbnails {
    position: relative;
    margin-bottom: 24px;
}

#page_product_detail .tn-vehicle-gallery .item_nav {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0;
    padding: 2px 0;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

#page_product_detail .tn-vehicle-gallery .slideThumb {
    flex: 0 0 calc((100% - 24px) / 3);
    width: calc((100% - 24px) / 3);
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    opacity: 0.7;
    scroll-snap-align: start;
}

#page_product_detail .tn-vehicle-gallery .slideThumb img {
    display: block;
    width: 100%;
    height: auto;
}

#page_product_detail .tn-vehicle-gallery .slideThumb[aria-current="true"] {
    border-color: var(--link_color, #525263);
    opacity: 1;
}

#page_product_detail .tn-vehicle-gallery .slideThumb:focus-visible {
    outline: 2px solid var(--link_color, #525263);
    outline-offset: -2px;
}

#page_product_detail .tn-gallery-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 56px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.65);
    color: #2196f3;
    font-family: Arial, sans-serif;
    font-size: 48px;
    line-height: 1;
    cursor: pointer;
}

#page_product_detail .tn-gallery-prev {
    left: 0;
}

#page_product_detail .tn-gallery-next {
    right: 0;
}

#page_product_detail .tn-gallery-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

/* スマホの在庫一覧は2列。車両情報は全項目を残して余白を調整する。 */
@media (max-width: 767px) {
    #page_product_list .ec-shelfGrid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 12px;
        margin-left: 0;
        margin-right: 0;
    }

    #page_product_list .ec-shelfGrid .ec-shelfGrid__item:nth-child(n) {
        width: auto;
        min-width: 0;
        margin-bottom: 0;
        padding-left: 0;
        padding-right: 0;
    }

    #page_product_list .tn-vehicle-title {
        min-height: 3em;
        margin-bottom: 8px;
        font-size: 14px;
        overflow-wrap: anywhere;
    }

    #page_product_list .tn-vehicle-info {
        margin: 12px 0;
        font-size: 12px;
    }

    #page_product_list .tn-vehicle-info caption {
        padding-bottom: 6px;
        font-size: 14px;
    }

    #page_product_list .tn-vehicle-info th,
    #page_product_list .tn-vehicle-info td {
        padding: 5px 4px;
    }

    #page_product_list .tn-vehicle-info th {
        width: 48%;
    }

    #page_product_list .ec-shelfGrid .ec-productRole__btn {
        margin-bottom: 0;
    }

    #page_product_list .ec-shelfGrid .tn-vehicle-detail-link {
        min-height: 44px;
        padding: 10px 8px;
        font-size: 14px;
    }
}

/* 販売価格0円の車両の「SOLD OUT」表示 */
.ec-price__price.tn-soldout {
  color: #c00;
  font-weight: bold;
}

/* 紹介文（フリーエリア）。車両情報の表の下に表示する。 */
#page_product_detail .tn-vehicle-intro {
    margin: 24px 0;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

/* PC：タイトルの行数が違っても、画像・車両情報・ボタンの開始位置を行ごとにそろえる。 */
@media (min-width: 768px) {
    @supports (grid-template-rows: subgrid) {
        #page_product_list .ec-shelfGrid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
        }

        #page_product_list .ec-shelfGrid .ec-shelfGrid__item {
            display: grid;
            grid-template-rows: subgrid;
            grid-row: span 4;
            row-gap: 0;
            width: auto;
            min-width: 0;
        }

        #page_product_list .ec-shelfGrid .ec-shelfGrid__item > a {
            display: contents;
        }

        #page_product_list .ec-shelfGrid .ec-shelfGrid__item .ec-productRole__btn {
            grid-row: 4;
        }
    }

    /* subgrid非対応のブラウザでは、タイトル3行分の高さを確保する。 */
    @supports not (grid-template-rows: subgrid) {
        #page_product_list .tn-vehicle-title {
            min-height: 4.5em;
        }
    }
}

/* スマホ：タイトルの行数が違っても、画像・車両情報・ボタンの開始位置を行ごとにそろえる。 */
@media (max-width: 767px) {
    @supports (grid-template-rows: subgrid) {
        #page_product_list .ec-shelfGrid {
            gap: 0 12px;
        }

        #page_product_list .ec-shelfGrid .ec-shelfGrid__item:nth-child(n) {
            display: grid;
            grid-template-rows: subgrid;
            grid-row: span 4;
            row-gap: 0;
            margin-bottom: 24px;
        }

        #page_product_list .ec-shelfGrid .ec-shelfGrid__item > a {
            display: contents;
        }

        #page_product_list .ec-shelfGrid .ec-shelfGrid__item .ec-productRole__btn {
            grid-row: 4;
        }

        #page_product_list .tn-vehicle-title {
            min-height: 0;
        }
    }
}
