/**
 * HUG Vehicle ショートコード用グリッドレイアウト
 * レスポンシブ対応の汎用グリッドスタイル
 */

/* ショートコードコンテナ */
.hug-vehicle-shortcode-grid {
    margin: 20px 0;
}

/* グリッドレイアウト - 4列基本 */
.hug-vehicle-shortcode-grid .vehicle-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 0;
}

/* 車両カード */
.hug-vehicle-shortcode-grid .vehicle-item {
    background: #ffffff;
    border: 1px solid #ddd;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.hug-vehicle-shortcode-grid .vehicle-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* 画像コンテナ */
.hug-vehicle-shortcode-grid .vehicle-image {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 アスペクト比 */
    overflow: hidden;
    background: #f5f5f5;
}

.hug-vehicle-shortcode-grid .vehicle-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 成約済スタンプ */
.hug-vehicle-shortcode-grid .vehicle-image .soldout {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: auto;
    object-fit: contain;
    z-index: 10;
}

/* 車両情報 */
.hug-vehicle-shortcode-grid .vehicle-info {
    padding: 12px;
}

.hug-vehicle-shortcode-grid .vehicle-title {
    font-size: 15px;
    font-weight: bold;
    margin: 0 0 8px;
    line-height: 1.3;
    min-height: 2.6em;
}

.hug-vehicle-shortcode-grid .vehicle-title a {
    color: #333;
    text-decoration: none;
    display: block;
}

.hug-vehicle-shortcode-grid .vehicle-title a:hover {
    color: #007cba;
}

/* 車両詳細 */
.hug-vehicle-shortcode-grid .vehicle-meta {
    font-size: 13px;
    color: #666;
    margin: 5px 0;
}

.hug-vehicle-shortcode-grid .vehicle-meta strong {
    color: #333;
    font-weight: bold;
}

/* 価格表示 */
.hug-vehicle-shortcode-grid .vehicle-price {
    font-size: 14px;
    color: #000;
    margin: 10px 0 8px;
    font-weight: bold;
}

.hug-vehicle-shortcode-grid .vehicle-price .amount {
    font-size: 20px;
    color: #e74c3c;
    font-weight: bold;
}

/* 店舗情報 */
.hug-vehicle-shortcode-grid .vehicle-store {
    background: #333;
    color: #fff;
    padding: 5px 10px;
    font-size: 12px;
    text-align: center;
    margin-top: 8px;
}

/* レスポンシブ対応 */
/* タブレット: 3列 */
@media screen and (max-width: 991px) {
    .hug-vehicle-shortcode-grid .vehicle-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

/* 小型タブレット: 2列 */
@media screen and (max-width: 767px) {
    .hug-vehicle-shortcode-grid .vehicle-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .hug-vehicle-shortcode-grid .vehicle-title {
        font-size: 14px;
        min-height: 2.8em;
    }

    .hug-vehicle-shortcode-grid .vehicle-meta {
        font-size: 12px;
    }

    .hug-vehicle-shortcode-grid .vehicle-price .amount {
        font-size: 18px;
    }
}

/* スマートフォン: 1列 */
@media screen and (max-width: 480px) {
    .hug-vehicle-shortcode-grid .vehicle-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .hug-vehicle-shortcode-grid .vehicle-info {
        padding: 10px;
    }

    .hug-vehicle-shortcode-grid .vehicle-title {
        min-height: auto;
    }
}

/* トップページ特有の調整 */
body.home .hug-vehicle-shortcode-grid {
    margin: 30px 0;
}

body.home .hug-vehicle-shortcode-grid .vehicle-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* トップページのレスポンシブ */
@media screen and (max-width: 991px) {
    body.home .hug-vehicle-shortcode-grid .vehicle-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 767px) {
    body.home .hug-vehicle-shortcode-grid .vehicle-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 480px) {
    body.home .hug-vehicle-shortcode-grid .vehicle-grid {
        grid-template-columns: 1fr;
    }
}

/* 既存テーマとの互換性調整 */
#stockcars .hug-vehicle-shortcode-grid {
    width: 100%;
}

#stockcars .hug-vehicle-shortcode-grid .vehicle-grid {
    list-style: none;
    padding: 0;
    margin: 0;
}