/* 価格比較サイト専用CSS */

/* リセット & ベース設定 */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: #f0fdf4; 
    color: #1a4d3b; 
}

/* ヘッダー */
.header { 
    background: linear-gradient(135deg, #059669 0%, #34d399 100%); 
    color: white; 
    padding: 1rem 0; 
}

.header h1 { 
    text-align: center; 
    font-size: 2rem; 
    margin-bottom: 1rem; 
}

.header p { 
    text-align: center; 
    opacity: 0.9; 
}

/* コンテナ */
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 1rem; 
}

/* 検索フォーム */
.search-form { 
    text-align: center; 
    margin: 2rem 0; 
}

.search-form input[type="text"] { 
    width: 300px; 
    padding: 12px; 
    font-size: 16px; 
    border: 2px solid #ddd; 
    border-radius: 8px; 
    margin-right: 10px; 
}

.search-form button { 
    padding: 12px 24px; 
    font-size: 16px; 
    background: #059669; 
    color: white; 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
}

.search-form button:hover { 
    background: #047857; 
}

/* ソートオプション */
.sort-options { 
    text-align: center; 
    margin: 1rem 0; 
}

.sort-options a { 
    display: inline-block; 
    padding: 8px 16px; 
    margin: 0 5px; 
    background: #e5e7eb; 
    text-decoration: none; 
    border-radius: 5px; 
    color: #374151; 
}

.sort-options a.active { 
    background: #059669; 
    color: white; 
}

/* 検索結果ヘッダー */
.results-header { 
    text-align: center; 
    margin: 2rem 0; 
}

.results-header h2 { 
    color: #0f4f3c; 
    font-size: 1.8rem; 
}

/* 比較テーブル */
.comparison-table { 
    display: grid; 
    grid-template-columns: 1fr 1fr 1fr; 
    gap: 20px; 
    margin: 2rem 0; 
}

/* サイト列 */
.site-column { 
    background: white; 
    border-radius: 12px; 
    padding: 20px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
}

/* サイトヘッダー */
.site-header { 
    text-align: center; 
    margin-bottom: 20px; 
    padding: 15px; 
    border-radius: 8px; 
}

.site-header.amazon { 
    background: #ff9900; 
    color: white; 
}

.site-header.rakuten { 
    background: #bf0000; 
    color: white; 
}

.site-header.yahoo { 
    background: #0078ff; 
    color: white; 
}

.site-header h3 { 
    font-size: 1.2rem; 
    margin-bottom: 5px; 
}

.site-header .count { 
    font-size: 0.9rem; 
    opacity: 0.9; 
}

/* 商品アイテム */
.product-item { 
    border: 1px solid #e5e7eb; 
    border-radius: 8px; 
    padding: 15px; 
    margin-bottom: 15px; 
    overflow: hidden; 
}

.product-item img { 
    max-width: 80px; 
    height: 80px; 
    object-fit: cover; 
    border-radius: 4px; 
    float: left; 
    margin-right: 15px; 
}

.product-title { 
    font-weight: bold; 
    font-size: 0.9rem; 
    margin-bottom: 8px; 
    line-height: 1.3; 
}

.product-price { 
    color: #dc2626; 
    font-weight: bold; 
    font-size: 1.1rem; 
    margin: 8px 0; 
}

.product-shop { 
    color: #6b7280; 
    font-size: 0.8rem; 
    margin-bottom: 10px; 
}

.product-link { 
    display: inline-block; 
    padding: 8px 16px; 
    background: #059669; 
    color: white; 
    text-decoration: none; 
    border-radius: 4px; 
    font-size: 0.85rem; 
}

.product-link:hover { 
    background: #047857; 
}

/* 検索結果なし */
.no-results { 
    text-align: center; 
    padding: 40px; 
    color: #6b7280; 
}

/* Amazon検索案内 */
.amazon-search-notice { 
    text-align: center; 
    padding: 20px; 
    background: #fef3c7; 
    border: 1px solid #f59e0b; 
    border-radius: 8px; 
    margin: 10px 0; 
}

.amazon-search-link { 
    display: inline-block; 
    padding: 10px 20px; 
    background: #ff9900; 
    color: white; 
    text-decoration: none; 
    border-radius: 6px; 
    margin-top: 10px; 
}

.amazon-search-link:hover { 
    background: #e68900; 
}

/* フッター */
footer { 
    background: #f9fafb; 
    padding: 40px 0; 
    margin-top: 60px; 
    text-align: center; 
    color: #6b7280; 
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .comparison-table { 
        display: grid;
        grid-template-columns: 1fr 1fr 1fr; 
        gap: 8px; 
        width: 100%;
    }
    
    .site-column {
        min-width: 0; /* 幅を強制的に均等にする */
        width: 100%; /* 親グリッドに完全に合わせる */
        padding: 15px 8px; /* 左右パディングを調整 */
    }
    
    .search-form input[type="text"] { 
        width: 250px; 
        margin-bottom: 10px; 
    }
    
    .container { 
        padding: 0 0.5rem; 
    }
    
    .header h1 { 
        font-size: 1.5rem; 
    }
    
    .product-item img { 
        float: none; 
        display: block; 
        margin: 0 auto 10px; 
    }
}

@media (max-width: 480px) {
    .comparison-table { 
        display: grid;
        grid-template-columns: 1fr 1fr 1fr; 
        gap: 5px; 
        width: 100%;
    }
    
    .search-form input[type="text"] { 
        width: 200px; 
    }
    
    .site-column { 
        min-width: 0; /* 幅を強制的に均等にする */
        width: 100%; /* 親グリッドに完全に合わせる */
        padding: 8px 4px; /* さらにパディング調整 */
        font-size: 0.9rem;
    }
    
    .site-header { 
        padding: 10px 5px; 
        margin-bottom: 10px; 
    }
    
    .site-header h3 { 
        font-size: 0.9rem; 
    }
    
    .count { 
        font-size: 0.8rem; 
    }
    
    .product-item { 
        padding: 8px; 
        font-size: 0.8rem;
    }
    
    .product-item img { 
        max-width: 60px; 
        height: 60px; 
        margin-right: 8px; 
    }
    
    .product-title { 
        font-size: 0.8rem; 
        margin-bottom: 4px; 
    }
    
    .product-price { 
        font-size: 0.9rem; 
        margin: 4px 0; 
    }
    
    .product-shop { 
        font-size: 0.7rem; 
        margin-bottom: 6px; 
    }
    
    .product-link { 
        padding: 6px 10px; 
        font-size: 0.8rem; 
    }
    
    /* スマホでの商品表示を縦配置に変更 */
    .product-item { 
        text-align: center; 
    }
    
    .product-item img { 
        float: none; 
        display: block; 
        margin: 0 auto 6px; 
    }
}

/* さらに小さい画面向け（320px以下） */
@media (max-width: 320px) {
    .comparison-table { 
        display: grid;
        grid-template-columns: 1fr 1fr 1fr; 
        gap: 2px; 
        width: 100%;
    }
    
    .site-column { 
        min-width: 0; /* 幅を強制的に均等にする */
        width: 100%; /* 親グリッドに完全に合わせる */
        padding: 6px 2px; /* 最小パディング */
        font-size: 0.8rem;
    }
    
    .site-header h3 { 
        font-size: 0.8rem; 
    }
    
    .product-item { 
        padding: 6px; 
    }
    
    .product-item img { 
        max-width: 50px; 
        height: 50px; 
    }
    
    .product-title { 
        font-size: 0.75rem; 
    }
    
    .product-price { 
        font-size: 0.85rem; 
    }
    
    .product-link { 
        padding: 5px 8px; 
        font-size: 0.75rem; 
    }
}