/* FANZAキャンペーンウィジェット メインスタイル */

.fcw-campaign-widget {
    padding: 10px;
    border-radius: 8px;
    position: relative;
    max-width: 1500px;
    margin: 0 auto;
}

/* キャンペーンタイトル */
.fcw-campaign-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom:2px;
    padding: 12px;
    background: #ffa500;
    color: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.fcw-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fcw-badge-campaign {
    background: #ff6b6b;
    color: #fff;
}

.fcw-badge-popular {
    background: #4ecdc4;
    color: #fff;
}

.fcw-campaign-period {
    margin-left: auto;
    font-size: 14px;
    opacity: 0.9;
}

/* グリッド表示 */
.fcw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* 商品カード */
.fcw-item-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.fcw-has-border .fcw-item-card {
    border: 1px solid #e0e0e0;
}

.fcw-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.fcw-item-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* 商品画像 */
.fcw-item-image {
    position: relative;
    padding-top: 133%; /* 3:4のアスペクト比 */
    overflow: hidden;
    background: #f5f5f5;
}

.fcw-item-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
    transform: none !important;  /* 初期transform無効化 */
}

/* スライダー初期化前は非表示 */
.fcw-display-slider .swiper-slide {
    opacity: 0;
}

.fcw-display-slider .swiper-slide.swiper-slide-initialized {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.fcw-item-card:hover .fcw-item-image img {
    transition: transform 0.3s ease;
    transform: scale(1.05) !important;  /* ホバー時のみ拡大 */
}

/* 割引バッジ */
.fcw-discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff3838;
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(255,56,56,0.3);
}

/* 商品情報 */
.fcw-item-info {
    padding: 15px;
}

.fcw-item-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
}

/* 価格表示 */
.fcw-item-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.fcw-list-price {
    text-decoration: line-through;
    color: #999;
    font-size: 13px;
}

.fcw-current-price {
    font-size: 18px;
    font-weight: bold;
    color: #ff3838;
}

/* 評価 */
.fcw-item-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

.fcw-stars {
    display: flex;
    gap: 2px;
}

.fcw-star {
    color: #ffd700;
}

.fcw-star-empty {
    color: #ddd;
}

.fcw-review-count {
    color: #666;
    font-size: 12px;
}

/* Swiperカスタマイズ */
.fcw-swiper {
    padding: 0 50px;
}

.fcw-swiper .swiper-button-prev,
.fcw-swiper .swiper-button-next {
    color: #667eea;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.fcw-swiper .swiper-button-prev:after,
.fcw-swiper .swiper-button-next:after {
    font-size: 20px;
}

.fcw-swiper .swiper-pagination-bullet {
    background: #667eea;
    opacity: 0.3;
}

.fcw-swiper .swiper-pagination-bullet-active {
    opacity: 1;
}

/* レスポンシブ - タブレット */
@media (max-width: 768px) {
    .fcw-campaign-widget {
        padding: 15px;
    }
    
    .fcw-campaign-title {
        font-size: 16px;
        padding: 10px;
    }
    
    .fcw-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .fcw-swiper {
        padding: 0 30px;
    }
    
    .fcw-item-info {
        padding: 12px;
    }
    
    .fcw-item-title {
        font-size: 13px;
    }
    
    .fcw-current-price {
        font-size: 16px;
    }
}

/* レスポンシブ - スマートフォン */
@media (max-width: 480px) {
    .fcw-campaign-widget {
        padding: 10px;
    }
    
    .fcw-campaign-title {
        font-size: 14px;
        padding: 8px;
        flex-wrap: wrap;
    }
    
    .fcw-campaign-period {
        margin-left: 0;
        width: 100%;
        margin-top: 5px;
    }
    
    .fcw-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .fcw-swiper {
        padding: 0;
    }
    
    .fcw-swiper .swiper-button-prev,
    .fcw-swiper .swiper-button-next {
        display: none;
    }
    
    .fcw-item-info {
        padding: 10px;
    }
    
    .fcw-item-title {
        font-size: 12px;
        min-height: 35px;
    }
    
    .fcw-current-price {
        font-size: 14px;
    }
    
    .fcw-discount-badge {
        font-size: 12px;
        padding: 3px 8px;
    }
}

/* エラー表示 */
.fcw-no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 14px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* ローディング */
.fcw-loading {
    text-align: center;
    padding: 40px;
}

.fcw-loading:after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: fcw-spin 1s linear infinite;
}

@keyframes fcw-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* タイトル位置 */
.widget-title {
    margin-bottom: 20px;
}

h2.widget-title,
h3.widget-title {
    text-align: var(--fcw-title-align, center);
    color: var(--fcw-title-color, #333);
    font-weight: var(--fcw-title-weight, bold);
}

/* カスタムスタイル用CSS変数 */
.fcw-campaign-widget {
    --fcw-bg-color: #ffffff;
    --fcw-text-color: #333333;
    --fcw-border-color: #dddddd;
}

.fcw-campaign-widget[style*="background-color"] {
    background-color: var(--fcw-bg-color);
}

.fcw-campaign-widget .fcw-item-title,
.fcw-campaign-widget .fcw-item-info {
    color: var(--fcw-text-color);
}

.fcw-has-border .fcw-item-card {
    border-color: var(--fcw-border-color);
}
