h2,
h3 {
    margin: 0;
}

.car-detail-section .container {
    max-width: 1200px;
    padding: 0 120px;
    margin-top: 40px;
}

.wrapper {
    padding: 48px 32px;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0px 4px rgba(0, 0, 0, 0.1);
}

.section-title {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
}

.section-title h2 {
    margin: 0;
    font-weight: 600;
    font-family: "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "メイリオ",
        Meiryo, "ＭＳ Ｐゴシック", sans-serif;
}

.thumbnail.is-active img {
        opacity: .7;
}

.top-level-info {
    display: flex;
    width: 100%;
    gap: 22px;
    margin-bottom: 48px;
}

.car-visual {
    width: 55%;
}

.car-visual__top {
    margin-bottom: 2px;
    position: relative;
}

.car-visual__top img {
    width: 100%;
}
.car-visual__listing-sheet{
    cursor: pointer;
}
.visual-toggle-icons {
    position: absolute;
    display: flex;
    justify-content: space-between;
    width: 98%;
    top: 50%;
    left: 1%;
}

.visual-toggle-icons img {
    width: 32px;
    height: 32px;
    cursor: pointer;
}

.car-visual__other {
    margin-bottom: 16px;
}
.thumbnails {
    display: flex;
    flex-wrap: wrap;
}
.thumbnail {
    width: 10%;
}

.car-visual__other img {
    width: 100%;
}

.other-button {
    display: none;
}

.car-visual__stock-info {
    border-radius: 4px;
    border: 1px solid #cccccc;
}

.car-visual__stock-info.pc {
    display: block;
}

.car-visual__stock-info.sp {
    display: none;
}

.stock-info__header {
    background-color: #eeeeee;
    padding: 16px;
    font-size: 14px;
    font-weight: 700;
    border-bottom: 1px solid #cccccc;
}

.stock-info__detail {
    padding: 16px;
}

.stock-info__detail p {
    margin: 0;
    font-weight: 700;
}

.stock-info__detail div {
    margin-top: 12px;
    font-size: 12px;
}

.stock-info__detail div span {
    margin-right: 15px;
}

.car-info {
    width: 45%;
}

.car-info__price {
    display: flex;
    padding: 8px 0;
    font-weight: 700;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    line-height: 2rem;
}

.car-info__price span {
    color: #cd130e;
    font-size: 24px;
}

.car-info__price div {
    font-size: 36px;
}

.car-info__apply {
    margin-bottom: 16px;
}

.car-info__apply .btn {
    position: relative;
    width: 100%;
    padding-top: 20px;
    padding-bottom: 20px;
}

.car-info__apply img {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.car-info__number {
    margin-bottom: 16px;
}

.car-info__scores {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    overflow-x: auto;
    white-space: nowrap;
}

.scores__rate {
    width: 20%;
    border: 1px solid #000000;
    padding: 8px;
    text-align: center;
}

.rate__value {
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
}

.scores__other {
    display: flex;
    width: 80%;
    flex-wrap: wrap;
}

.scores__other .other-item {
    width: 50%;
    padding: 16px 0px;
    text-align: center;
    /* height: 100px; */
    min-width: 95px;
    border-top: 1px solid #000000;
}
.scores__other .other-item:nth-child(3),
.scores__other .other-item:nth-child(4) {
    border-bottom: 1px solid #000000;
}

.other-item__value {
    /* height: 92px; */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
}

.doc__image {
    margin-top: 8px;
    padding: 16px;
    border: 1px solid #cccccc;
    position: relative;
}

.image-zoom {
    display: flex;
    align-items: center;
    width: 40px;
    font-size: 12px;
    font-weight: 700;
    flex-direction: column;
    position: absolute;
    top: 10px;
    right: 0px;
}

.zoom-icon {
    width: 20px;
    height: 20px;
}

.document-image {
    width: 100%;
}

.doc__info {
    font-size: 12px;
    font-weight: 700;
}

/* --- モーダルウィンドウ --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal-content {
    position: relative;
    background-color: #fff;
    padding: 20px;
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
    transform: scale(1);
    transition: transform 0.3s;
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.9);
}

.modal-image {
    display: block;
    max-width: 100%;
    height: auto;
}

.modal-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.modal-close-button:hover {
    color: #000;
}

.detail-info__header {
    background-color: #eeeeee;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-left: 4px solid #0096e5;
    margin-bottom: 32px;
}

.detail-info__card {
    display: none;
    border-radius: 4px;
    padding: 12px;
    background-color: #ffffff;
    margin-bottom: 24px;
    border: 1px solid #cccccc;
}

.result-card h3 {
    margin-top: 0;
}

.card-wrapper {
    display: none;
}

.card-item {
    display: grid;
    grid-template-columns: 1fr 7fr;
    gap: 8px;
    margin: 12px 0;
    font-size: 12px;
}

.card-item__image img {
    max-width: 100px;
    height: auto;
}

.card-item__tables {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.card-item__tables th {
    background-color: #eeeeee;
}

.card-item__tables table {
    border: 1px #cccccc solid;
    border-collapse: collapse;
    border-right: 0;
    border-bottom: 0;
}

.card-item__tables th,
.card-item__tables td {
    border: 1px #cccccc solid;
    text-align: left;
    border-right: 0;
    border-bottom: 0;
}
.card-item__tables th {
    width: calc(3em);
}
.card-item__tables td {
    width: calc(6em);
}

.item-primary {
    display: flex;
    grid-column: 1 / -1;
    height: 66px;
}

.item-primary__rate,
.item-primary__price {
    width: 100%;
    border: 1px #cccccc solid;
    text-align: center;
}

.item-primary__rate p,
.item-primary__price p {
    text-align: left;
    font-size: 0.625rem;
    margin: 0 5px;
}

.item-primary__rate div,
.item-primary__price div {
    font-size: 1.75em;
    text-align: right;
    font-weight: 600;
    display: inline-block;
}

.item-primary__rate {
    border-right: 0;
}

.table-right {
    border-right: 1px #cccccc solid !important;
}

.detail-info__card .btn {
    width: 100%;
}

.detail-info__table {
    font-size: 14px;
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ccc;
}

.detail-info__table th,
.detail-info__table td {
    border: 1px solid #ccc;
    padding: 12px;
    text-align: left;
    vertical-align: middle;
}

.detail-info__table th {
    background-color: #f2f2f2;
    font-weight: bold;
    width: 25%;
}

.detail-info__table td {
    background-color: #fff;
}

.detail-info__table .table_score {
    display: none;
}

.back-list-btn-section .container {
    margin-top: 40px;
    margin-bottom: 50px;
}

.back-list-btn-section .btn {
    width: 200px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.item-primary__price span {
    font-size: 0.5em;
    margin-left: 0.25rem;
}

.car-info__doc-open.car-info__apply .btn {
    justify-content: center;
}

.evaluation_sheet {
    position: fixed;
    width: calc(100% - 8rem);
    height: calc(100% - 4rem);
    top: 0;
    left: 0;
    background: #0009;
    padding: 2rem 4rem;
    z-index: 999;
}
.evaluation_sheet .close_button {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    line-height: 1;
    font-weight: bold;
    color: #fff;
}
.evaluation_sheet .evaluation_sheet_content {
    max-width: 900px;
    height: calc(100% - 4rem);
    margin: 0 auto;
    background: #fff;
    padding: 2rem;
    overflow-y: scroll;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.evaluation_sheet table {
    width: 100%;
    border-collapse: collapse;
}
.evaluation_sheet table td,
.evaluation_sheet table th {
    padding: 0.5rem;
    border: 1px solid #ccc;
}
.evaluation_sheet table th {
    background-color: #0096e5;
    color: #fff;
}
.evaluation_sheet table.main_sheet tr td:not(:nth-child(2)) {
    text-align: center;
}
.thumb-arrow ,.thumbnail-toggle-icons{
    display: none;
}
/* tb size */
@media screen and (max-width: 834px) {
    .section-title {
        margin-bottom: 1rem;
        display: block;
    }
    .tag {
        padding: 3px 5px;
    }
    .section-title h2 {
        display: inline;
        font-size: 1.25rem;
    }
    .car-detail-section .container {
        padding: 0px 24px;
    }

    .wrapper {
        padding: 48px 24px;
    }

    .car-visual__other {
        grid-template-columns: repeat(7, 1fr);
    }

    .car-info__price span {
        font-size: 20px;
    }

    .car-info__price div {
        font-size: 32px;
    }
}

/* sp Size */
@media screen and (max-width: 640px) {
    .section-title {
        margin-bottom: 0.5rem;
    }
    .section-title h2 {
        font-size: 1rem;
    }
    .car-detail-section .container {
        padding: 0;
        margin-top: 0;
    }

    .wrapper {
        padding: 40px 20px;
        border-radius: 0px;
    }

    .top-level-info {
        flex-direction: column;
    }

    .car-visual,
    .car-info {
        width: 100%;
    }

    .car-visual {
        position: relative;
    }

    .car-visual__other {
        display: flex;
        overflow: hidden;
    }

    .car-visual__other img {
        width: 100%;
        height: 100%;
    }

    .other-button {
        display: none;
        width: 98%;
        position: absolute;
        z-index: 5;
        display: flex;
        justify-content: space-between;
        margin-left: 1%;
        pointer-events: none;
    }

    .other-button span {
        pointer-events: auto;
    }

    .other-button path {
        fill: rgba(51, 97, 161, 1);
    }

    .detail-info__header {
        gap: 4px;
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 16px;
        margin-bottom: 24px;
    }

    .detail-info__card {
        display: block;
    }

    .car-info__scores {
        display: none;
    }

    .detail-info__table {
        font-size: 12px;
    }

    .detail-info__table,
    .detail-info__table tbody,
    .detail-info__table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .detail-info__table tr {
        display: flex;
        flex-wrap: wrap;
    }

    .detail-info__table th {
        width: calc(6em + 14px);
        font-weight: bold;
        box-sizing: border-box;
        padding: 0.5em;
    }

    .detail-info__table td {
        flex-grow: 1;
        width: calc(100% - (6em + 14px));
        box-sizing: border-box;
        padding: 0.5em;
    }

    .detail-info__table td[colspan="3"] {
        width: calc(100% - (6em + 14px));
    }

    .detail-info__table .table_score {
        display: flex;
    }

    .other-button {
        display: flex;
    }

    .car-visual__stock-info.pc {
        display: none;
    }

    .car-visual__stock-info.sp {
        margin-top: 20px;
        display: block;
    }
    .card-item {
        display: flex;
    }
    .card-item__image {
        flex: 1;
    }
    .card-item__image img {
        width: 100%;
        max-width: unset;
    }
    .item-primary__price span {
        display: block;
    }

    .evaluation_sheet {
        width: calc(100% - 2rem);
        height: calc(100% - 8rem);
        padding: 4rem 1rem;
        font-size: 11px;
    }
    .evaluation_sheet .evaluation_sheet_content {
        height: calc(100% - 1rem);
        padding: 1rem;
        gap: 1rem;
    }
    .evaluation_sheet table{
        font-size:11px;
    }
    .evaluation_sheet table td,
    .evaluation_sheet table th {
        padding: 0.25rem;
    }
    .card-item__tables {
        /* width: 65%; */
    }

    .card-item__tables th,
    .card-item__tables td {
        font-size: 12px;
    }
    /* コンテナははみ出しを隠す or スクロール許可 */
    .car-visual__other .thumbnail-list {
        overflow: hidden;
    }

    .car-visual__other .thumbnails {
        display: flex;
        flex-wrap: nowrap; /* ← 折り返し禁止（重要） */
        gap: 8px;
        overflow-x: auto; /* ← 横スクロール可能に（重要） */
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    .car-visual__other .thumbnail {
        flex: 0 0 auto;
    }
    .car-visual__other .thumbnail img {
        display: block;
    }
    .thumb-arrow {
        background: rgba(255, 255, 255, 0.8);
        border: none;
        cursor: pointer;
        padding: 4px;
        border-radius: 50%;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
    }

    .thumb-arrow-left {
        left: -20px; /* 位置は好みに合わせて調整 */
    }
    .thumb-arrow-right {
        right: -20px;
    }

    .thumb-arrow img {
        width: 20px;
        height: 20px;
    }
    .thumbnail {
        width: 22%;
        height: 55px;
    }
    .thumbnail-list {
  position: relative;
}

.thumbnail-toggle-icons {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  pointer-events: none; /* アイコンの外側でのクリックを無効化 */
}

.thumbnail-toggle-icons img {
  pointer-events: auto; /* アイコン自体はクリック可能に */
  cursor: pointer;
  width: 24px;
  height: 24px;
}
}
