/* ValueCommerce Products Styling (3段構成版) */

/* 全体のラッパー */
.valuecommerce-products-wrapper {
    margin-bottom: 20px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
    background: #fff;
    overflow: hidden;
}

/* ① 上段：ヘッダー部分 */
.product-header-fixed {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 8px 16px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ccc;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

.product-pr-label {
    display: inline-block;
    background-color: #ff6b6b;
    color: white;
    font-size: 0.65em;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 3px;
    flex-shrink: 0;
    white-space: nowrap;
}

.product-header-fixed .product-header-link,
.product-header-fixed a {
    flex: 1;
    text-align: left;
    font-size: 0.7em;
    color: #007bff;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-header-fixed a:hover {
    text-decoration: underline;
}

/* ② 中段：カルーセルスライド本体 */
.valuecommerce-swiper {
    width: 100%;
    padding: 12px 16px;
    box-sizing: border-box;
    background: #fff;
}

/* Swiper内部のボタン・ページネーションは下段に分離するため非表示 */
.valuecommerce-swiper .swiper-button-prev,
.valuecommerce-swiper .swiper-button-next,
.valuecommerce-swiper .swiper-pagination {
    display: none;
}

.swiper-wrapper {
    box-sizing: border-box;
}

.swiper-slide {
    height: auto;
    box-sizing: border-box;
    width: 100%;
}

/* 商品カード */
.product-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
}

/* 商品の本体部分（画像＋テキスト横並び） */
.product-body {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

/* 画像コンテナ */
.product-image-container {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 商品詳細エリア */
.product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    box-sizing: border-box;
}

/* h タグを使わず p タグで商品タイトル */
.product-title {
    margin: 0 0 4px 0;
    font-size: 0.75em;
    font-weight: bold;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-title a {
    text-decoration: none;
    color: #333;
}

.product-title a:hover {
    color: #007bff;
    text-decoration: underline;
}

.merchant-name {
    font-size: 0.65em;
    color: #666;
    margin: 0 0 4px 0;
    word-wrap: break-word;
}

.product-description {
    margin: 0 0 6px 0;
    font-size: 0.65em;
    line-height: 1.4;
    color: #555;
    word-wrap: break-word;
}

/* 商品詳細ボタン */
.product-details-button {
    display: inline-block;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 3px;
    font-size: 0.65em;
    text-align: center;
    margin-top: auto;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    align-self: flex-start;
}

.product-details-button:hover {
    background-color: #0056b3;
    color: white;
    text-decoration: none;
}

/* ③ 下段：カルーセルナビゲーション */
.vc-carousel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 16px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    box-sizing: border-box;
}

/* 下段のナビボタン（Swiperのabsolute配置を解除） */
.vc-carousel-nav .swiper-button-prev,
.vc-carousel-nav .swiper-button-next {
    position: static;
    margin: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #ccc;
    color: #007bff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vc-carousel-nav .swiper-button-prev:after,
.vc-carousel-nav .swiper-button-next:after {
    font-size: 14px;
    font-weight: bold;
}

.vc-carousel-nav .swiper-button-prev:hover,
.vc-carousel-nav .swiper-button-next:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* 下段のページネーション */
.vc-carousel-nav .swiper-pagination {
    position: static;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.vc-carousel-nav .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #007bff;
    opacity: 0.3;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
}

.vc-carousel-nav .swiper-pagination-bullet-active {
    opacity: 1;
}

/* エラーメッセージ */
.error {
    color: #d32f2f;
    background: #ffebee;
    padding: 10px;
    border-radius: 4px;
    border-left: 4px solid #d32f2f;
}

/* スマホ（767px以下） */
@media screen and (max-width: 767px) {
    .product-header-fixed {
        padding: 6px 12px;
    }

    .valuecommerce-swiper {
        padding: 10px 12px;
    }

    .product-image-container {
        width: 80px;
        height: 80px;
    }

    .product-title {
        font-size: 0.7em;
    }

    .merchant-name,
    .product-description {
        font-size: 0.6em;
    }

    .product-details-button {
        font-size: 0.6em;
        padding: 4px 10px;
    }

    .vc-carousel-nav .swiper-button-prev,
    .vc-carousel-nav .swiper-button-next {
        width: 28px;
        height: 28px;
    }

    .vc-carousel-nav .swiper-button-prev:after,
    .vc-carousel-nav .swiper-button-next:after {
        font-size: 12px;
    }
}

/* タブレット・PC（768px以上） */
@media screen and (min-width: 768px) {
    .product-image-container {
        width: 120px;
        height: 120px;
    }

    .product-title {
        font-size: 0.8em;
    }

    .merchant-name {
        font-size: 0.7em;
    }

    .product-description {
        font-size: 0.7em;
    }

    .product-details-button {
        font-size: 0.7em;
        padding: 6px 14px;
    }
}
