/* LinkShare Products Styling (カルーセル表示版 - 枠固定) */

/* 全体のラッパー - 外枠を設定 */
.linkshare-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: 12px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ccc; /* 下側のみ境界線 */
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0;
    position: relative;
    z-index: 10; /* カルーセルより前面に表示 */
}

.product-pr-label {
    display: inline-block;
    background-color: #ff6b6b;
    color: white;
    font-size: 0.7em;
    font-weight: bold;
    padding: 4px 10px;
    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.75em;
    color: #007bff;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

/* カルーセル本体 - 枠内に収める */
.linkshare-swiper {
    width: 100%;
    padding: 20px 50px 60px 50px;
    box-sizing: border-box;
    background: #fff;
}

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

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

/* 商品カード - 境界線を削除(枠は外側にあるため) */
.product-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    transition: box-shadow 0.3s ease;
    overflow: hidden;
    padding: 0 10px; /* 内側に余白を追加 */
}

.product-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 商品の本体部分 */
.product-body {
    display: flex;
    flex-direction: column;
    padding: 15px 0;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

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

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

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

.product-title {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 0.8em;
    line-height: 1.4;
    min-height: 2.8em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-title a {
    text-decoration: none;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

.merchant-name {
    font-size: 0.7em;
    color: #666;
    margin-bottom: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

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

/* Swiperのナビゲーションボタンのカスタマイズ */
.linkshare-swiper .swiper-button-prev,
.linkshare-swiper .swiper-button-next {
    color: #007bff;
    background: rgba(255, 255, 255, 0.9);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

.linkshare-swiper .swiper-button-prev:hover,
.linkshare-swiper .swiper-button-next:hover {
    background: #007bff;
    color: white;
}

/* ページネーション(ドット)のカスタマイズ */
.linkshare-swiper .swiper-pagination {
    bottom: 20px;
}

.linkshare-swiper .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: #007bff;
    opacity: 0.3;
}

.linkshare-swiper .swiper-pagination-bullet-active {
    opacity: 1;
}

/* レスポンシブ対応 - スマホ */
@media screen and (max-width: 767px) {
    .product-header-fixed {
        padding: 10px 15px;
    }
    
    .linkshare-swiper {
        padding: 15px 10px 50px 10px;
    }
    
    .product-item {
        padding: 0 5px;
    }
    
    .product-image-container {
        min-height: 150px;
    }
    
    .product-title {
        font-size: 0.75em;
        min-height: 2.4em;
    }
    
    .merchant-name {
        font-size: 0.65em;
    }
    
    .product-details-button {
        font-size: 0.7em;
        padding: 8px 16px;
    }
    
    .linkshare-swiper .swiper-button-prev,
    .linkshare-swiper .swiper-button-next {
        width: 35px;
        height: 35px;
    }
    
    .linkshare-swiper .swiper-button-prev:after,
    .linkshare-swiper .swiper-button-next:after {
        font-size: 16px;
    }
    
    .product-header-fixed .product-header-link,
    .product-header-fixed a {
        font-size: 0.7em;
    }
    
    .product-pr-label {
        font-size: 0.65em;
        padding: 3px 8px;
    }
}

/* タブレット・PC表示(768px以上)では左右配置 */
@media screen and (min-width: 768px) {
    .product-body {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .product-image-container {
        width: 30%;
        min-width: 200px;
        max-width: 300px;
        margin-right: 20px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .product-details {
        flex: 1;
        width: auto;
        min-width: 0;
    }
    
    .product-title {
        font-size: 0.9em;
        min-height: auto;
    }
    
    .merchant-name {
        font-size: 0.75em;
    }
    
    .product-details-button {
        font-size: 0.8em;
        max-width: 200px;
    }
    
    .product-header-fixed .product-header-link,
    .product-header-fixed a {
        font-size: 0.8em;
    }
    
    .product-pr-label {
        font-size: 0.75em;
    }
}

/* 中サイズ画面の調整(768px-1024px) */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .linkshare-swiper {
        padding: 20px 40px 60px 40px;
    }
    
    .product-header-fixed {
        padding: 12px 18px;
    }
}