/* ===== 広告エリアのスタイル ===== */

/* 広告コンテナの基本スタイル */
.ad-container {
    background: #F8F9FA;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    position: relative;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 広告プレースホルダー表示 */
.ad-placeholder {
    color: #999;
    font-size: 13px;
    line-height: 1.6;
}

.ad-placeholder-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.ad-placeholder-icon {
    font-size: 32px;
    color: #DDD;
    margin-bottom: 12px;
}

/* サイドバー広告エリア（PC版のみ） */
.sidebar-ad-area {
    width: 300px;
    position: sticky;
    top: 100px;
    height: fit-content;
    display: none; /* デフォルトは非表示 */
}

/* PC版で表示 */
@media (min-width: 1200px) {
    .main-content {
        max-width: 1400px;
        grid-template-columns: 200px 1fr 320px;
    }
    
    .sidebar-ad-area {
        display: block;
    }
}

/* サイドバー広告のスタイル */
.sidebar-ad {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.sidebar-ad .ad-container {
    min-height: 280px;
}

/* インフィード広告（結果表示エリア） */
.infeed-ad-area {
    margin: 2rem 0;
    padding: 2rem 0;
    border-top: 1px solid #E0E0E0;
    border-bottom: 1px solid #E0E0E0;
    display: none; /* デフォルトは非表示 */
}

/* リサイズプレビュー表示時のみ表示 */
.infeed-ad-area.show {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

.infeed-ad {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 1rem;
}

.infeed-ad .ad-container {
    min-height: 120px;
}

/* 広告ラベル */
.ad-label {
    font-size: 11px;
    color: #999;
    text-align: left;
    margin-bottom: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* モバイル対応 */
@media (max-width: 1199px) {
    /* モバイルではサイドバー広告を非表示 */
    .sidebar-ad-area {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .infeed-ad {
        margin: 0 1rem;
    }
    
    .infeed-ad .ad-container {
        min-height: 100px;
        padding: 15px;
    }
}

/* Amazon商品リンクのスタイル（将来の実装用） */
.amazon-product-widget {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    text-align: left;
    transition: all 0.3s ease;
}

.amazon-product-widget:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.amazon-product-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    flex-shrink: 0;
}

.amazon-product-info {
    flex: 1;
}

.amazon-product-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.4;
}

.amazon-product-price {
    font-size: 16px;
    color: #B12704;
    font-weight: 700;
}

.amazon-badge {
    background: #FF9900;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    display: inline-block;
    margin-top: 4px;
}

/* Amazon商品カードスタイル */
.amazon-product-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    width: 100%;
}

.amazon-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #FF9900;
}

.product-image-container {
    position: relative;
    background: #F8F9FA;
    padding: 20px;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #FF9900;
    color: white;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    color: #0066C0;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    font-size: 13px;
    color: #565959;
    margin-bottom: 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-price {
    font-size: 18px;
    color: #B12704;
    font-weight: 700;
}

.product-rating {
    font-size: 13px;
    color: #FF9900;
}

/* Amazon検索ウィジェット */
.amazon-search-widget {
    padding: 15px;
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
}

.amazon-search-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #E0E0E0;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 10px;
    transition: border-color 0.3s;
}

.amazon-search-input:focus {
    outline: none;
    border-color: #FF9900;
}

.amazon-search-button {
    width: 100%;
    padding: 10px;
    background: #FF9900;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.amazon-search-button:hover {
    background: #E47911;
}

.amazon-search-suggestions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.suggestion-tag {
    padding: 4px 10px;
    background: #F3F3F3;
    color: #565959;
    font-size: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.suggestion-tag:hover {
    background: #FF9900;
    color: white;
}

/* カルーセル表示 */
.amazon-carousel {
    width: 100%;
}

.carousel-header {
    font-size: 16px;
    font-weight: 600;
    color: #232F3E;
    margin-bottom: 15px;
    padding-left: 5px;
}

.carousel-track {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #DDD #F8F9FA;
}

.carousel-track::-webkit-scrollbar {
    height: 6px;
}

.carousel-track::-webkit-scrollbar-track {
    background: #F8F9FA;
    border-radius: 3px;
}

.carousel-track::-webkit-scrollbar-thumb {
    background: #DDD;
    border-radius: 3px;
}

.carousel-track::-webkit-scrollbar-thumb:hover {
    background: #BBB;
}

.carousel-item {
    flex: 0 0 280px;
}

.carousel-footer {
    font-size: 11px;
    color: #999;
    margin-top: 10px;
    padding-left: 5px;
}

/* 商品リンクテキスト */
.product-link-text {
    font-size: 12px;
    color: #0066C0;
    font-weight: 500;
    margin-left: auto;
}

/* 画像エラー時のプレースホルダー */
.product-image.error {
    background: #F8F9FA;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

/* レスポンシブ調整 */
@media (max-width: 768px) {
    .amazon-product-card {
        font-size: 14px;
    }
    
    .product-title {
        font-size: 13px;
    }
    
    .product-description {
        font-size: 12px;
    }
    
    .product-price {
        font-size: 16px;
    }
}